HgFile: correctly calculate relative path for root.
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Mon, 11 Apr 2011 12:29:24 +0000 (16:29 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Mon, 11 Apr 2011 12:29:24 +0000 (16:29 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/HgFile.java

index c1303b834d13537eb24e2eb8cb68975e2391d9e0..15a7d85718c8e42f3a189bfec34061152ad5b695 100644 (file)
@@ -75,6 +75,9 @@ public class HgFile {
   }
 
   private static String buildRelativePath(File anchestor, File descendant) {
+    if (anchestor.equals(descendant)) {
+      return ".";
+    }
     if (anchestor.equals(descendant.getParentFile())) {
       return descendant.getName();
     }