[hg] EA-28846 Take local revisions (with empty changeset information) into account...
authorKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Sat, 11 Aug 2012 09:19:32 +0000 (13:19 +0400)
committerKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Sat, 11 Aug 2012 09:19:32 +0000 (13:19 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/HgRevisionNumber.java

index 639e858e2ae1161a160b7df07399d00cabdea14a..9bd11c8d2e18d5b68cbc2ce952c5f249104a8d43 100644 (file)
@@ -111,6 +111,14 @@ public class HgRevisionNumber implements VcsRevisionNumber {
       return 0;
     }
 
+    // One of the revisions is local. Local is "greater" than any from the history.
+    if (changeset.isEmpty()) {
+      return 1;
+    }
+    if (other.changeset.isEmpty()) {
+      return -1;
+    }
+
     // compare revision numbers.
     final int revCompare = java.lang.Long.valueOf(getRevisionNumber()).compareTo(java.lang.Long.valueOf(other.getRevisionNumber()));
     if (revCompare != 0) {