[hg] Update HgWidget with current revision after merge, update, rebase, revert. IDEA...
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 14 Apr 2011 13:13:42 +0000 (17:13 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Mon, 18 Apr 2011 09:15:04 +0000 (13:15 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgMergeCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRebaseCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRevertCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgUpdateCommand.java

index 600c8be8c4a30bdb24aba6f33466b9cf6b8ed7cf..55fcc5d9da82be6d159d70a522f1b58f0d593a0f 100644 (file)
@@ -16,6 +16,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vfs.VirtualFile;
 import org.apache.commons.lang.StringUtils;
 import org.jetbrains.annotations.Nullable;
+import org.zmlx.hg4idea.HgVcs;
 import org.zmlx.hg4idea.execution.HgCommandExecutor;
 import org.zmlx.hg4idea.execution.HgCommandResult;
 
@@ -54,7 +55,9 @@ public class HgMergeCommand {
     } else if (StringUtils.isNotBlank(branch)) {
       arguments.add(branch);
     }
-    return commandExecutor.executeInCurrentThread(repo, "merge", arguments);
+    final HgCommandResult result = commandExecutor.executeInCurrentThread(repo, "merge", arguments);
+    project.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(project);
+    return result;
   }
 
 }
index b91555d8a72fd40ccd37f4ce6290971bc41d33c7..fd8fa259e24096f7a94f80c15144581396ac282b 100644 (file)
@@ -15,6 +15,7 @@ package org.zmlx.hg4idea.command;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vfs.VirtualFile;
 import org.jetbrains.annotations.NotNull;
+import org.zmlx.hg4idea.HgVcs;
 import org.zmlx.hg4idea.execution.HgCommandExecutor;
 
 import java.util.Arrays;
@@ -31,6 +32,7 @@ public class HgRebaseCommand {
 
   public void continueRebase() {
     new HgCommandExecutor(project).execute(repo, "rebase", Arrays.asList("--continue"), null);
+    project.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(project);
   }
 
 }
index d81e13afd3c14a83c2de403e97887b1cc74b483d..f8c984be9ba1524cd9c9d7a4ec556b54669a47d8 100644 (file)
@@ -17,6 +17,7 @@ import com.intellij.util.containers.ContainerUtil;
 import org.apache.commons.lang.StringUtils;
 import org.zmlx.hg4idea.HgFile;
 import org.zmlx.hg4idea.HgRevisionNumber;
+import org.zmlx.hg4idea.HgVcs;
 import org.zmlx.hg4idea.execution.HgCommandExecutor;
 
 import java.util.LinkedList;
@@ -50,5 +51,6 @@ public class HgRevertCommand {
     ContainerUtil.addAll(arguments, hgFile.getRelativePath());
 
     new HgCommandExecutor(project).execute(hgFile.getRepo(), "revert", arguments, null);
+    project.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(project);
   }
 }
index b4f6c28ab145ab724861059a852693e1689c13a2..c4a2743647d0e7f60db526628a211950b63d66a1 100644 (file)
@@ -17,6 +17,7 @@ import com.intellij.openapi.vfs.VirtualFile;
 import org.apache.commons.lang.StringUtils;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
+import org.zmlx.hg4idea.HgVcs;
 import org.zmlx.hg4idea.execution.HgCommandExecutor;
 import org.zmlx.hg4idea.execution.HgCommandResult;
 
@@ -65,7 +66,9 @@ public class HgUpdateCommand {
 
     final HgCommandExecutor executor = new HgCommandExecutor(project);
     executor.setShowOutput(true);
-    return executor.executeInCurrentThread(repo, "update", arguments);
+    final HgCommandResult result = executor.executeInCurrentThread(repo, "update", arguments);
+    project.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(project);
+    return result;
   }
 
 }