From b189061b82b696c769813fa96c8edffaca73b0f9 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Tue, 11 Feb 2014 18:23:46 +0400 Subject: [PATCH] Problem With outdated HgRepository information when branch or bookmark created fixed. --- .../org/zmlx/hg4idea/action/HgBranchPopupActions.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgBranchPopupActions.java b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgBranchPopupActions.java index 4d47795d73fc..b2b4f99fd946 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgBranchPopupActions.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgBranchPopupActions.java @@ -50,10 +50,11 @@ import org.zmlx.hg4idea.provider.update.HgHeadMerger; import org.zmlx.hg4idea.repo.HgRepository; import org.zmlx.hg4idea.ui.HgBookmarkDialog; import org.zmlx.hg4idea.util.HgErrorUtil; -import org.zmlx.hg4idea.util.HgUtil; import java.util.*; +import static org.zmlx.hg4idea.util.HgUtil.*; + /** * @author Nadya Zabrodina */ @@ -77,7 +78,7 @@ public class HgBranchPopupActions { } popupGroup.addSeparator("Bookmarks"); - List bookmarkNames = HgUtil.getNamesWithoutHashes(myRepository.getBookmarks()); + List bookmarkNames = getNamesWithoutHashes(myRepository.getBookmarks()); String currentBookmark = myRepository.getCurrentBookmark(); Collections.sort(bookmarkNames); for (String bookmark : bookmarkNames) { @@ -109,7 +110,7 @@ public class HgBranchPopupActions { @Override public void actionPerformed(AnActionEvent e) { - final String name = HgUtil.getNewBranchNameFromUser(myProject, "Create New Branch"); + final String name = getNewBranchNameFromUser(myProject, "Create New Branch"); if (name == null) { return; } @@ -117,7 +118,7 @@ public class HgBranchPopupActions { new HgBranchCreateCommand(myProject, myPreselectedRepo, name).execute(new HgCommandResultHandler() { @Override public void process(@Nullable HgCommandResult result) { - myProject.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(myProject, null); + getRepositoryManager(myProject).updateRepository(myPreselectedRepo); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(myProject) .notifyError(result, "Creation failed", "Branch creation [" + name + "] failed"); @@ -163,7 +164,7 @@ public class HgBranchPopupActions { bookmarkDialog.isActive()).execute(new HgCommandResultHandler() { @Override public void process(@Nullable HgCommandResult result) { - myProject.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(myProject, null); + getRepositoryManager(myProject).updateRepository(myPreselectedRepo); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(myProject) .notifyError(result, "Creation failed", "Bookmark creation [" + name + "] failed");