From 340019c59a7654f42cf23ca47d11afe2204e7c1c Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Wed, 2 Mar 2016 18:54:05 +0300 Subject: [PATCH] [hg] rename hg status command executtion to executeInCurrentThread --- plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java | 2 +- .../zmlx/hg4idea/action/HgCompareWithBranchAction.java | 2 +- .../src/org/zmlx/hg4idea/command/HgStatusCommand.java | 8 ++++---- .../src/org/zmlx/hg4idea/provider/HgChangeProvider.java | 2 +- .../hg4idea/provider/commit/HgCheckinEnvironment.java | 2 +- .../zmlx/hg4idea/provider/update/HgRegularUpdater.java | 4 ++-- plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java | 4 ++-- .../testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java b/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java index 6f9b1a31ed28..143d6d135350 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java @@ -153,7 +153,7 @@ public class HgVFSListener extends VcsVFSListener { HgStatusCommand statusCommand = new HgStatusCommand.Builder(false).unknown(true).ignored(true).build(myProject); for (Map.Entry> entry : sortedSourceFilesByRepos.entrySet()) { Set changes = - statusCommand.execute(entry.getKey(), ContainerUtil.map(entry.getValue(), new Function() { + statusCommand.executeInCurrentThread(entry.getKey(), ContainerUtil.map(entry.getValue(), new Function() { @Override public FilePath fun(VirtualFile virtualFile) { return VcsUtil.getFilePath(virtualFile); diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgCompareWithBranchAction.java b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgCompareWithBranchAction.java index 4184477fb261..bfc2809625f2 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgCompareWithBranchAction.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgCompareWithBranchAction.java @@ -151,6 +151,6 @@ public class HgCompareWithBranchAction extends DvcsCompareWithBranchAction execute(VirtualFile repo) { - return execute(repo, null); + public Set executeInCurrentThread(VirtualFile repo) { + return executeInCurrentThread(repo, null); } - public Set execute(VirtualFile repo, @Nullable Collection paths) { + public Set executeInCurrentThread(VirtualFile repo, @Nullable Collection paths) { if (repo == null) { return Collections.emptySet(); } @@ -240,7 +240,7 @@ public class HgStatusCommand { public Collection getHgUntrackedFiles(@NotNull VirtualFile repo, @NotNull List files) throws VcsException { Collection untrackedFiles = new HashSet(); List filePaths = ObjectsConvertor.vf2fp(files); - Set change = execute(repo, filePaths); + Set change = executeInCurrentThread(repo, filePaths); for (HgChange hgChange : change) { untrackedFiles.add(hgChange.afterFile().toFilePath().getVirtualFile()); } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgChangeProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgChangeProvider.java index d2b5fa63fc9a..1ea7c87898f1 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgChangeProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgChangeProvider.java @@ -89,7 +89,7 @@ public class HgChangeProvider implements ChangeProvider { final HgRevisionNumber parentRevision = new HgWorkingCopyRevisionsCommand(myProject).firstParent(repo); final Map list = new HgResolveCommand(myProject).getListSynchronously(repo); - hgChanges.addAll(new HgStatusCommand.Builder(true).build(myProject).execute(repo, entry.getValue())); + hgChanges.addAll(new HgStatusCommand.Builder(true).build(myProject).executeInCurrentThread(repo, entry.getValue())); final HgRepository hgRepo = HgUtil.getRepositoryForFile(myProject, repo); if (hgRepo != null && hgRepo.hasSubrepos()) { hgChanges.addAll(ContainerUtil.mapNotNull(hgRepo.getSubrepos(), new Function() { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java index 308610420dda..3fc5a72b000d 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java @@ -176,7 +176,7 @@ public class HgCheckinEnvironment implements CheckinEnvironment { HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).unknown(false).ignored(false).baseRevision(parents.get(0)).build(myProject); - Set allChangedFilesInRepo = statusCommand.execute(repo); + Set allChangedFilesInRepo = statusCommand.executeInCurrentThread(repo); Set filesNotIncluded = new HashSet(); diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgRegularUpdater.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgRegularUpdater.java index 48fea381d869..75efb52ca61d 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgRegularUpdater.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgRegularUpdater.java @@ -257,7 +257,7 @@ public class HgRegularUpdater implements HgUpdater { private Set getLocalChanges() { HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).unknown(false).ignored(false).build(project); - return statusCommand.execute(repoRoot); + return statusCommand.executeInCurrentThread(repoRoot); } private HgCommandExitCode pull(@NotNull VirtualFile repo, @NotNull ProgressIndicator indicator) { @@ -304,7 +304,7 @@ public class HgRegularUpdater implements HgUpdater { } HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).ignored(false).unknown(false).baseRevision(parentBeforeUpdate).targetRevision( parentAfterUpdate).build(project); - Set changes = statusCommand.execute(repo); + Set changes = statusCommand.executeInCurrentThread(repo); for (HgChange change : changes) { HgFileStatusEnum status = change.getStatus(); switch (status) { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java b/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java index 2ad3096a7326..f8d6b02c850a 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java @@ -341,7 +341,7 @@ public abstract class HgUtil { //get file name in target revision if it was moved/renamed HgStatusCommand statCommand = new HgStatusCommand.Builder(false).copySource(true).baseRevision(vcsRevisionNumber).build(project); - Set changes = statCommand.execute(localHgFile.getRepo(), Collections.singletonList(localHgFile.toFilePath())); + Set changes = statCommand.executeInCurrentThread(localHgFile.getRepo(), Collections.singletonList(localHgFile.toFilePath())); for (HgChange change : changes) { if (change.afterFile().equals(localHgFile)) { @@ -472,7 +472,7 @@ public abstract class HgUtil { .build(project); } - Collection hgChanges = statusCommand.execute(root, Collections.singleton(path)); + Collection hgChanges = statusCommand.executeInCurrentThread(root, Collections.singleton(path)); List changes = new ArrayList(); //convert output changes to standart Change class for (HgChange hgChange : hgChanges) { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java index 52d176dc1d9a..41fa9018d473 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java @@ -170,7 +170,7 @@ public class HgUpdateTest extends HgCollaborativeTest { } private void assertIsChanged(HgFileStatusEnum status, String... filepath) { - Set localChanges = new HgStatusCommand.Builder(true).build(myProject).execute(projectRepoVirtualFile); + Set localChanges = new HgStatusCommand.Builder(true).build(myProject).executeInCurrentThread(projectRepoVirtualFile); assertTrue(localChanges.contains(new HgChange(getHgFile(filepath), status))); }