mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Mercurial Repository info problem fixed
*do not create new HgRepository instance, because info fields will be updated from null and HgVcs.STATUS_TOPIC will be published without necessarily
This commit is contained in:
@@ -29,7 +29,6 @@ import com.intellij.ui.popup.list.ListPopupImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.repo.HgRepository;
|
||||
import org.zmlx.hg4idea.repo.HgRepositoryImpl;
|
||||
import org.zmlx.hg4idea.util.HgUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -110,10 +109,12 @@ public class HgBranchPopup {
|
||||
popupGroup.addSeparator("Repositories");
|
||||
boolean isMultiRepoConfig = repositories.size() > 1;
|
||||
for (VirtualFile repository : repositories) {
|
||||
HgRepository repo = HgRepositoryImpl.getInstance(repository, myProject, myProject);
|
||||
popupGroup.add(new RootAction<HgRepository>(repo, isMultiRepoConfig ? myCurrentRepository : null,
|
||||
new HgBranchPopupActions(repo.getProject(), repo).createActions(null),
|
||||
HgUtil.getDisplayableBranchText(repo)));
|
||||
HgRepository repo = HgUtil.getRepositoryManager(myProject).getRepositoryForRoot(repository);
|
||||
if (repo != null) {
|
||||
popupGroup.add(new RootAction<HgRepository>(repo, isMultiRepoConfig ? myCurrentRepository : null,
|
||||
new HgBranchPopupActions(repo.getProject(), repo).createActions(null),
|
||||
HgUtil.getDisplayableBranchText(repo)));
|
||||
}
|
||||
}
|
||||
return popupGroup;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.repo.HgRepository;
|
||||
import org.zmlx.hg4idea.repo.HgRepositoryImpl;
|
||||
import org.zmlx.hg4idea.util.HgUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -35,17 +34,19 @@ public class HgBranchesAction extends HgAbstractGlobalAction {
|
||||
protected void execute(@NotNull Project project, @NotNull Collection<VirtualFile> repositories, @Nullable VirtualFile selectedRepo) {
|
||||
HgRepository repository;
|
||||
if (selectedRepo != null) {
|
||||
repository = HgRepositoryImpl.getInstance(selectedRepo, project, project);
|
||||
repository = HgUtil.getRepositoryManager(project).getRepositoryForRoot(selectedRepo);
|
||||
}
|
||||
else {
|
||||
VirtualFile selectedRoot = HgUtil.getRootForSelectedFile(project);
|
||||
if (selectedRoot != null) {
|
||||
repository = HgRepositoryImpl.getInstance(selectedRoot, project, project);
|
||||
repository = HgUtil.getRepositoryManager(project).getRepositoryForRoot(selectedRoot);
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
HgBranchPopup.getInstance(project, repository).asListPopup().showInFocusCenter();
|
||||
if (repository != null) {
|
||||
HgBranchPopup.getInstance(project, repository).asListPopup().showInFocusCenter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user