IDEA-64890 hg push to default-push, if defined, or to default otherwise.

This commit is contained in:
Kirill Likhodedov
2011-02-07 18:24:43 +03:00
parent 7040ba2d08
commit 375e7d7a24
2 changed files with 10 additions and 1 deletions
@@ -33,6 +33,15 @@ public class HgShowConfigCommand {
return execute(repo).get("paths.default");
}
public String getDefaultPushPath(VirtualFile repo) {
final Map<String, String> map = execute(repo);
String path = map.get("paths.default-push");
if (path == null) {
path = map.get("paths.default");
}
return path;
}
public Map<String, String> execute(VirtualFile repo) {
if (repo == null) {
return Collections.emptyMap();
@@ -105,7 +105,7 @@ public class HgPushDialog extends DialogWrapper {
private void updateRepository() {
final VirtualFile repo = hgRepositorySelectorComponent.getRepository();
final HgShowConfigCommand configCommand = new HgShowConfigCommand(myProject);
final String defaultPath = configCommand.getDefaultPath(repo);
final String defaultPath = configCommand.getDefaultPushPath(repo);
repositoryTxt.setText(defaultPath);
loadBranches(repo);
update();