aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Janik2011-07-26 12:29:22 (EDT)
committerTomasz Zarna2011-07-26 12:29:22 (EDT)
commit959b51f632dfae1ed6be82990d7411556a9ad952 (patch)
tree3202bc3f2df0673050a2d15655c49cc1f9986683
parent50736124ee1e3c01b8f4e359951088702367f5a6 (diff)
downloadorg.eclipse.orion.client-959b51f632dfae1ed6be82990d7411556a9ad952.zip
org.eclipse.orion.client-959b51f632dfae1ed6be82990d7411556a9ad952.tar.gz
org.eclipse.orion.client-959b51f632dfae1ed6be82990d7411556a9ad952.tar.bz2
bug 349375 - [server] Ability to delete remote branches
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349375
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/git-clone.js1
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitClient.js4
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js34
3 files changed, 34 insertions, 5 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-clone.js b/bundles/org.eclipse.orion.client.git/web/git/git-clone.js
index 1f6778e..ce64226 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/git-clone.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/git-clone.js
@@ -50,6 +50,7 @@ dojo.addOnLoad(function() {
commandService.registerCommandContribution("eclipse.checkoutBranch", 2);
commandService.registerCommandContribution("eclipse.addBranch", 2);
commandService.registerCommandContribution("eclipse.removeBranch", 2);
+ commandService.registerCommandContribution("eclipse.removeRemoteBranch", 2);
commandService.registerCommandContribution("eclipse.addRemote", 2);
commandService.registerCommandContribution("eclipse.removeRemote", 2);
commandService.registerCommandContribution("eclipse.openGitLog", 2);
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitClient.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitClient.js
index c87b6b9..2e7579d 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitClient.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitClient.js
@@ -677,7 +677,7 @@ eclipse.GitService = (function() {
}
});
},
- doPush : function(gitBranchURI, srcRef, force, onLoad, gitSshUsername, gitSshPassword, gitSshKnownHost, gitPrivateKey, gitPassphrase) {
+ doPush : function(gitBranchURI, srcRef, tags, force, onLoad, gitSshUsername, gitSshPassword, gitSshKnownHost, gitPrivateKey, gitPassphrase) {
var service = this;
return dojo.xhrPost({
@@ -687,7 +687,7 @@ eclipse.GitService = (function() {
},
postData : dojo.toJson({
"PushSrcRef" : srcRef,
- "PushTags" : true,
+ "PushTags" : tags,
"Force" : force,
"GitSshUsername" : gitSshUsername,
"GitSshPassword" : gitSshPassword,
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 9086369..51c6321 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
@@ -299,6 +299,34 @@ var exports = {};
);
commandService.addCommand(removeBranchCommand, "object");
+ var removeRemoteBranchCommand = new mCommands.Command({
+ name: "Remove Remote Branch",
+ image: "/images/delete.gif",
+ id: "eclipse.removeRemoteBranch",
+ callback: function(item) {
+ if(confirm("You're going to remove remote branch " + item.Name+" and push the change.\n\nAre you sure?"))
+ exports.getDefaultSshOptions(serviceRegistry).then(function(options){
+ var func = arguments.callee;
+ serviceRegistry.getService("orion.git.provider").then(function(gitService) {
+ serviceRegistry.getService("orion.page.message").then(function(progressService) {
+ var deferred = gitService.doPush(item.Location, "", false, false, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
+ progressService.showWhile(deferred, "Removing remote branch: " + item.Name).then(function(remoteJsonData){
+ exports.handleProgressServiceResponse(remoteJsonData, options, serviceRegistry,
+ function(jsonData){
+ if (jsonData.Result.Severity == "Ok")
+ dojo.hitch(explorer, explorer.changedItem)(item.parent);
+ }, func, "Remove Remote Branch");
+ });
+ });
+ });
+ });
+ },
+ visibleWhen: function(item) {
+ return item.Type === "RemoteTrackingBranch";
+ }}
+ );
+ commandService.addCommand(removeRemoteBranchCommand, "object");
+
var addRemoteCommand = new mCommands.Command({
name: "Add Remote",
image: "/images/add.gif",
@@ -710,7 +738,7 @@ var exports = {};
var func = arguments.callee;
serviceRegistry.getService("orion.git.provider").then(function(gitService) {
serviceRegistry.getService("orion.page.message").then(function(progressService) {
- var deferred = gitService.doPush(item.RemoteLocation, "HEAD", false, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
+ var deferred = gitService.doPush(item.RemoteLocation, "HEAD", true, false, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
progressService.showWhile(deferred, "Pushing remote: " + path).then(function(remoteJsonData){
exports.handleProgressServiceResponse(remoteJsonData, options, serviceRegistry,
function(jsonData){
@@ -747,7 +775,7 @@ var exports = {};
var func = arguments.callee;
serviceRegistry.getService("orion.git.provider").then(function(gitService) {
serviceRegistry.getService("orion.page.message").then(function(progressService) {
- var deferred = gitService.doPush(item.RemoteLocation, "HEAD", true, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
+ var deferred = gitService.doPush(item.RemoteLocation, "HEAD", true, true, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
progressService.showWhile(deferred, "Pushing remote: " + path).then(function(remoteJsonData){
exports.handleProgressServiceResponse(remoteJsonData, options, serviceRegistry,
function(jsonData){
@@ -1086,7 +1114,7 @@ var exports = {};
var func = arguments.callee;
serviceRegistry.getService("orion.git.provider").then(function(gitService) {
serviceRegistry.getService("orion.page.message").then(function(progressService) {
- var deferred = gitService.doPush(item.RemoteLocation, "HEAD", false, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
+ var deferred = gitService.doPush(item.RemoteLocation, "HEAD", true, false, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
progressService.showWhile(deferred, "Pushing remote: " + path).then(function(remoteJsonData){
exports.handleProgressServiceResponse(remoteJsonData, options, serviceRegistry,
function(jsonData){