IDEA-68765 Don't pass empty revision number to hg revert --rev
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 28 Apr 2011 14:22:52 +0000 (18:22 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 28 Apr 2011 16:06:51 +0000 (20:06 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRevertCommand.java

index 646b2c20159ed4555309d13f79c4f49c229b504d..8a11f380d769969d2b66cd32ec6a2a79246964b0 100644 (file)
@@ -35,7 +35,7 @@ public class HgRevertCommand {
 
   public void execute(VirtualFile repo, Collection<FilePath> files, HgRevisionNumber vcsRevisionNumber, boolean backupFile) {
     final List<String> options = new LinkedList<String>();
-    if (vcsRevisionNumber != null) {
+    if (vcsRevisionNumber != null && !HgRevisionNumber.NULL_REVISION_NUMBER.equals(vcsRevisionNumber)) {
       options.add("--rev");
       if (StringUtils.isNotBlank(vcsRevisionNumber.getChangeset())) {
         options.add(vcsRevisionNumber.getChangeset());