summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMaciej Bendkowski2012-08-08 10:12:39 (EDT)
committer Malgorzata Janczarska2012-08-09 05:59:51 (EDT)
commitaf588f5663da0b4a642b96f0f9da053deaa41450 (patch)
treea8544dd4f747087623f95044b4b83cfcec6c6757
parentf4cad5bc503fe2cfa51eb6ff0731b2b13316f244 (diff)
downloadorg.eclipse.orion.client-af588f5663da0b4a642b96f0f9da053deaa41450.zip
org.eclipse.orion.client-af588f5663da0b4a642b96f0f9da053deaa41450.tar.gz
org.eclipse.orion.client-af588f5663da0b4a642b96f0f9da053deaa41450.tar.bz2
Bug 379181 - Have to choose a remote branch twice when pushing
Bug 379181 - Have to choose a remote branch twice when pushing (fix)
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
index e29d868..4841e9f 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
@@ -1210,6 +1210,9 @@ var exports = {};
spriteClass: "gitCommandSprite", //$NON-NLS-0$
id : "eclipse.orion.git.push", //$NON-NLS-0$
callback: function(data) {
+ //previously saved target branch
+ var itemTargetBranch = data.targetBranch;
+
var target;
var item = data.items;
var path = dojo.hash();
@@ -1297,6 +1300,11 @@ var exports = {};
result.then(
function(remotes){
+ if(itemTargetBranch){
+ handlePush(options, itemTargetBranch.Location, "HEAD", itemTargetBranch.Name, false);
+ return;
+ }
+
var dialog = new orion.git.widgets.RemotePrompterDialog({
title: messages["Choose Branch"],
serviceRegistry: serviceRegistry,
@@ -1316,11 +1324,13 @@ var exports = {};
var locationToUpdate = "/gitapi/config/" + "branch." + item.Name + ".remote" + "/clone/file/" + parts[4];
gitService.addCloneConfigurationProperty(locationToChange,"branch." + item.Name + ".remote" ,target.parent.Name).then(
function(){
+ commandInvocation.targetBranch = target;
handlePush(options, target.Location, "HEAD",target.Name, false);
}, function(err){
if(err.status == 409){ //when confing entry is already defined we have to edit it
gitService.editCloneConfigurationProperty(locationToUpdate,target.parent.Name).then(
function(){
+ commandInvocation.targetBranch = target;
handlePush(options, target.Location, "HEAD",target.Name, false);
}
);
@@ -1340,7 +1350,10 @@ var exports = {};
gitClient: gitService,
dialog: dialog2,
location: item.RemoteLocation[0].Children[0].Name,
- func: dojo.hitch(this, function(){handlePush(options,item.RemoteLocation[0].Children[0].Location, "HEAD", path, false);})
+ func: dojo.hitch(this, function(){
+ commandInvocation.targetBranch = item.RemoteLocation[0].Children[0];
+ handlePush(options,item.RemoteLocation[0].Children[0].Location, "HEAD", path, false);
+ })
});
}