mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[hg] rename hg status command executtion to executeInCurrentThread
This commit is contained in:
@@ -153,7 +153,7 @@ public class HgVFSListener extends VcsVFSListener {
|
||||
HgStatusCommand statusCommand = new HgStatusCommand.Builder(false).unknown(true).ignored(true).build(myProject);
|
||||
for (Map.Entry<VirtualFile, Collection<VirtualFile>> entry : sortedSourceFilesByRepos.entrySet()) {
|
||||
Set<HgChange> changes =
|
||||
statusCommand.execute(entry.getKey(), ContainerUtil.map(entry.getValue(), new Function<VirtualFile, FilePath>() {
|
||||
statusCommand.executeInCurrentThread(entry.getKey(), ContainerUtil.map(entry.getValue(), new Function<VirtualFile, FilePath>() {
|
||||
@Override
|
||||
public FilePath fun(VirtualFile virtualFile) {
|
||||
return VcsUtil.getFilePath(virtualFile);
|
||||
|
||||
@@ -151,6 +151,6 @@ public class HgCompareWithBranchAction extends DvcsCompareWithBranchAction<HgRep
|
||||
HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).ignored(false).unknown(false).copySource(!path.isDirectory())
|
||||
.baseRevision(compareWithRevisionNumber).targetRevision(null).build(repository.getProject());
|
||||
statusCommand.cleanFilesOption(true);
|
||||
return !statusCommand.execute(repository.getRoot(), Collections.singleton(path)).isEmpty();
|
||||
return !statusCommand.executeInCurrentThread(repository.getRoot(), Collections.singleton(path)).isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +131,11 @@ public class HgStatusCommand {
|
||||
myTargetRevision = builder.targetRevision;
|
||||
}
|
||||
|
||||
public Set<HgChange> execute(VirtualFile repo) {
|
||||
return execute(repo, null);
|
||||
public Set<HgChange> executeInCurrentThread(VirtualFile repo) {
|
||||
return executeInCurrentThread(repo, null);
|
||||
}
|
||||
|
||||
public Set<HgChange> execute(VirtualFile repo, @Nullable Collection<FilePath> paths) {
|
||||
public Set<HgChange> executeInCurrentThread(VirtualFile repo, @Nullable Collection<FilePath> paths) {
|
||||
if (repo == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class HgStatusCommand {
|
||||
public Collection<VirtualFile> getHgUntrackedFiles(@NotNull VirtualFile repo, @NotNull List<VirtualFile> files) throws VcsException {
|
||||
Collection<VirtualFile> untrackedFiles = new HashSet<VirtualFile>();
|
||||
List<FilePath> filePaths = ObjectsConvertor.vf2fp(files);
|
||||
Set<HgChange> change = execute(repo, filePaths);
|
||||
Set<HgChange> change = executeInCurrentThread(repo, filePaths);
|
||||
for (HgChange hgChange : change) {
|
||||
untrackedFiles.add(hgChange.afterFile().toFilePath().getVirtualFile());
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class HgChangeProvider implements ChangeProvider {
|
||||
final HgRevisionNumber parentRevision = new HgWorkingCopyRevisionsCommand(myProject).firstParent(repo);
|
||||
final Map<HgFile, HgResolveStatusEnum> 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<HgNameWithHashInfo, HgChange>() {
|
||||
|
||||
@@ -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<HgChange> allChangedFilesInRepo = statusCommand.execute(repo);
|
||||
Set<HgChange> allChangedFilesInRepo = statusCommand.executeInCurrentThread(repo);
|
||||
|
||||
Set<HgFile> filesNotIncluded = new HashSet<HgFile>();
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ public class HgRegularUpdater implements HgUpdater {
|
||||
|
||||
private Set<HgChange> 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<HgChange> changes = statusCommand.execute(repo);
|
||||
Set<HgChange> changes = statusCommand.executeInCurrentThread(repo);
|
||||
for (HgChange change : changes) {
|
||||
HgFileStatusEnum status = change.getStatus();
|
||||
switch (status) {
|
||||
|
||||
@@ -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<HgChange> changes = statCommand.execute(localHgFile.getRepo(), Collections.singletonList(localHgFile.toFilePath()));
|
||||
Set<HgChange> 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<HgChange> hgChanges = statusCommand.execute(root, Collections.singleton(path));
|
||||
Collection<HgChange> hgChanges = statusCommand.executeInCurrentThread(root, Collections.singleton(path));
|
||||
List<Change> changes = new ArrayList<Change>();
|
||||
//convert output changes to standart Change class
|
||||
for (HgChange hgChange : hgChanges) {
|
||||
|
||||
@@ -170,7 +170,7 @@ public class HgUpdateTest extends HgCollaborativeTest {
|
||||
}
|
||||
|
||||
private void assertIsChanged(HgFileStatusEnum status, String... filepath) {
|
||||
Set<HgChange> localChanges = new HgStatusCommand.Builder(true).build(myProject).execute(projectRepoVirtualFile);
|
||||
Set<HgChange> localChanges = new HgStatusCommand.Builder(true).build(myProject).executeInCurrentThread(projectRepoVirtualFile);
|
||||
assertTrue(localChanges.contains(new HgChange(getHgFile(filepath), status)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user