use of org.zmlx.hg4idea.HgProjectSettings in project intellij-community by JetBrains.
the class HgBranchPopup method getInstance.
/**
* @param currentRepository Current repository, which means the repository of the currently open or selected file.
*/
public static HgBranchPopup getInstance(@NotNull Project project, @NotNull HgRepository currentRepository) {
HgRepositoryManager manager = HgUtil.getRepositoryManager(project);
HgProjectSettings hgProjectSettings = ServiceManager.getService(project, HgProjectSettings.class);
HgMultiRootBranchConfig hgMultiRootBranchConfig = new HgMultiRootBranchConfig(manager.getRepositories());
Condition<AnAction> preselectActionCondition = new Condition<AnAction>() {
@Override
public boolean value(AnAction action) {
return false;
}
};
return new HgBranchPopup(currentRepository, manager, hgMultiRootBranchConfig, hgProjectSettings, preselectActionCondition);
}
use of org.zmlx.hg4idea.HgProjectSettings in project intellij-community by JetBrains.
the class HgRemoteChangesetsCommand method executeCommandInCurrentThread.
@Override
protected HgCommandResult executeCommandInCurrentThread(VirtualFile repo, List<String> args) {
String repositoryURL = getRepositoryUrl(repo);
if (repositoryURL == null) {
LOG.info("executeCommand no default path configured");
return null;
}
HgRemoteCommandExecutor executor = new HgRemoteCommandExecutor(project, repositoryURL);
HgCommandResult result = executor.executeInCurrentThread(repo, command, args);
if (result == HgCommandResult.CANCELLED || HgErrorUtil.isAuthorizationError(result)) {
final HgVcs vcs = HgVcs.getInstance(project);
if (vcs == null) {
return result;
}
new HgCommandResultNotifier(project).notifyError(result, "Checking for incoming/outgoing changes disabled", "Authentication is required to check incoming/outgoing changes in " + repositoryURL + "<br/>You may enable checking for changes <a href='#'>in the Settings</a>.", new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
ShowSettingsUtil.getInstance().showSettingsDialog(project, vcs.getConfigurable().getDisplayName());
}
});
final HgProjectSettings projectSettings = vcs.getProjectSettings();
projectSettings.setCheckIncomingOutgoing(false);
project.getMessageBus().syncPublisher(HgVcs.INCOMING_OUTGOING_CHECK_TOPIC).hide();
}
return result;
}
Aggregations