use of org.zmlx.hg4idea.repo.HgRepository in project intellij-community by JetBrains.
the class HgShowUnAppliedPatchesAction method update.
@Override
public void update(AnActionEvent e) {
HgRepository repository = HgActionUtil.getSelectedRepositoryFromEvent(e);
e.getPresentation().setEnabledAndVisible(repository != null);
}
use of org.zmlx.hg4idea.repo.HgRepository in project intellij-community by JetBrains.
the class HgBranchPopup method createRepositoriesActions.
@NotNull
protected DefaultActionGroup createRepositoriesActions() {
DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
popupGroup.addSeparator("Repositories");
for (HgRepository repository : DvcsUtil.sortRepositories(myRepositoryManager.getRepositories())) {
popupGroup.add(new RootAction<>(repository, highlightCurrentRepo() ? myCurrentRepository : null, new HgBranchPopupActions(repository.getProject(), repository).createActions(), HgUtil.getDisplayableBranchOrBookmarkText(repository)));
}
return popupGroup;
}
use of org.zmlx.hg4idea.repo.HgRepository in project intellij-community by JetBrains.
the class HgMerge method execute.
@Override
public void execute(@NotNull final Project project, @NotNull final Collection<HgRepository> repos, @Nullable final HgRepository selectedRepo) {
final HgMergeDialog mergeDialog = new HgMergeDialog(project, repos, selectedRepo);
if (mergeDialog.showAndGet()) {
final String targetValue = StringUtil.escapeBackSlashes(mergeDialog.getTargetValue());
final HgRepository repo = mergeDialog.getRepository();
HgMergeCommand.mergeWith(repo, targetValue, UpdatedFiles.create());
}
}
use of org.zmlx.hg4idea.repo.HgRepository in project intellij-community by JetBrains.
the class HgPullAction method execute.
@Override
protected void execute(@NotNull final Project project, @NotNull Collection<HgRepository> repos, @Nullable HgRepository selectedRepo) {
final HgPullDialog dialog = new HgPullDialog(project, repos, selectedRepo);
if (dialog.showAndGet()) {
final String source = dialog.getSource();
final HgRepository hgRepository = dialog.getRepository();
new Task.Backgroundable(project, "Pulling changes from " + source, false) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
executePull(project, hgRepository, source);
HgErrorUtil.markDirtyAndHandleErrors(project, hgRepository.getRoot());
}
}.queue();
}
}
use of org.zmlx.hg4idea.repo.HgRepository in project intellij-community by JetBrains.
the class HgCommitTest method testAmendCommit.
public void testAmendCommit() throws HgCommandException, VcsException {
String changedCommit = "anotherCommit";
HgLogCommand logCommand = new HgLogCommand(myProject);
logCommand.setLogFile(false);
HgFile hgFile = new HgFile(myRepository, VfsUtilCore.virtualToIoFile(myRepository));
List<HgFileRevision> revisions = logCommand.execute(hgFile, -1, false);
HgRepository hgRepo = HgRepositoryImpl.getInstance(myRepository, myProject, myProject);
HgCommitCommand commit = new HgCommitCommand(myProject, hgRepo, changedCommit, true);
commit.executeInCurrentThread();
List<HgFileRevision> revisionsAfterAmendCommit = logCommand.execute(hgFile, -1, false);
assertTrue(revisions.size() == revisionsAfterAmendCommit.size());
assertEquals(revisionsAfterAmendCommit.get(0).getCommitMessage(), changedCommit);
}
Aggregations