summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorTomasz Zarna2011-10-14 13:23:29 (EDT)
committer sfranklin2011-10-14 15:53:51 (EDT)
commit4bf1328d8b98d0294d6927b4084506908815b3ba (patch)
tree141e1e6475c4637d082ba6752a7c9b52c7d752da
parent610ce91f4f80d44f4fcb556218ce5be0d13eb860 (diff)
downloadorg.eclipse.orion.client-4bf1328d8b98d0294d6927b4084506908815b3ba.zip
org.eclipse.orion.client-4bf1328d8b98d0294d6927b4084506908815b3ba.tar.gz
org.eclipse.orion.client-4bf1328d8b98d0294d6927b4084506908815b3ba.tar.bz2
bug 360730 - [client] Use words "fetch" and "push" in tooltips
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360730
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js117
1 files changed, 60 insertions, 57 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 eaabf41..e76b92e 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
@@ -502,7 +502,7 @@ var exports = {};
var fetchCommand = new mCommands.Command({
name : "Fetch",
- tooltip: "Update the remote tracking branch using the content from the remote",
+ tooltip : "Fetch from the remote branch into your remote tracking branch (when on a remote tracking branch) or fetch from the remote into your remote tracking branches (when on a remote)",
imageClass: "git-sprite-fetch",
spriteClass: "gitCommandSprite",
id : "eclipse.orion.git.fetch",
@@ -576,11 +576,12 @@ var exports = {};
var fetchForceCommand = new mCommands.Command({
name : "Force Fetch",
- tooltip: "Override the remote tracking branch using the content from the remote",
+ tooltip: "Fetch from the remote branch into your remote tracking branch overriding its current content",
id : "eclipse.orion.git.fetchForce",
callback: function(item) {
- var path = item.Location;
- exports.getDefaultSshOptions(serviceRegistry).then(function(options){
+ if(confirm("You're going to override content of the remote tracking branch. This can cause the branch to lose commits.\n\nAre you sure?")) {
+ var path = item.Location;
+ 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) {
@@ -638,6 +639,7 @@ var exports = {};
});
});
});
+ }
},
visibleWhen : function(item) {
return item.Type === "RemoteTrackingBranch" || item.Type === "Remote";
@@ -791,7 +793,7 @@ var exports = {};
var pushCommand = new mCommands.Command({
name : "Push All",
- tooltip: "Update the remote branch using content from your active branch",
+ tooltip: "Push commits and tags from your local branch into the remote branch",
imageClass: "git-sprite-push",
spriteClass: "gitCommandSprite",
id : "eclipse.orion.git.push",
@@ -871,66 +873,67 @@ var exports = {};
var pushForceCommand = new mCommands.Command({
name : "Force Push All",
- tooltip: "Override the remote branch using the content from your active branch. Be careful! You may lose history.",
+ tooltip: "Push commits and tags from your local branch into the remote branch overriding its current content",
imageClass: "git-sprite-push",
spriteClass: "gitCommandSprite",
id : "eclipse.orion.git.pushForce",
callback: function(item) {
- var path = dojo.hash();
- if(item.toRef){
- item = item.toRef;
- }
- if(item.RemoteLocation.length==1 && item.RemoteLocation[0].Children.length==1){
- 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.RemoteLocation[0].Children[0].Location, "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){
- if (jsonData.Result.Severity == "Ok")
- dojo.query(".treeTableRow").forEach(function(node, i) {
- dojo.toggleClass(node, "outgoingCommitsdRow", false);
- });
- }, func, "Push Git Repository");
+ if(confirm("You're going to override content of the remote branch. This can cause the remote repository to lose commits.\n\nAre you sure?")) {
+ var path = dojo.hash();
+ if(item.toRef){
+ item = item.toRef;
+ }
+ if(item.RemoteLocation.length==1 && item.RemoteLocation[0].Children.length==1){
+ 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.RemoteLocation[0].Children[0].Location, "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){
+ if (jsonData.Result.Severity == "Ok")
+ dojo.query(".treeTableRow").forEach(function(node, i) {
+ dojo.toggleClass(node, "outgoingCommitsdRow", false);
+ });
+ }, func, "Push Git Repository");
});
});
});
- });
- } else {
- var remotes = item.RemoteLocation;
-
- serviceRegistry.getService("orion.git.provider").then(function(gitService) {
- var dialog = new orion.git.widgets.RemotePrompterDialog({
- title: "Choose Branch",
- serviceRegistry: serviceRegistry,
- gitClient: gitService,
- treeRoot: {Children: remotes},
- hideNewBranch: true,
- func: dojo.hitch(this, function(targetBranch, remote) {
- 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(targetBranch.Location, "HEAD", true, true, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
- progressService.showWhile(deferred, "Pushing remote: " + remote).then(function(remoteJsonData){
- exports.handleProgressServiceResponse(remoteJsonData, options, serviceRegistry,
- function(jsonData){
- if (jsonData.Result.Severity == "Ok")
- dojo.query(".treeTableRow").forEach(function(node, i) {
- dojo.toggleClass(node, "outgoingCommitsdRow", false);
- });
- }, func, "Push Git Repository");
+ });
+ } else {
+ var remotes = item.RemoteLocation;
+ serviceRegistry.getService("orion.git.provider").then(function(gitService) {
+ var dialog = new orion.git.widgets.RemotePrompterDialog({
+ title: "Choose Branch",
+ serviceRegistry: serviceRegistry,
+ gitClient: gitService,
+ treeRoot: {Children: remotes},
+ hideNewBranch: true,
+ func: dojo.hitch(this, function(targetBranch, remote) {
+ 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(targetBranch.Location, "HEAD", true, true, null, options.gitSshUsername, options.gitSshPassword, options.knownHosts, options.gitPrivateKey, options.gitPassphrase);
+ progressService.showWhile(deferred, "Pushing remote: " + remote).then(function(remoteJsonData){
+ exports.handleProgressServiceResponse(remoteJsonData, options, serviceRegistry,
+ function(jsonData){
+ if (jsonData.Result.Severity == "Ok")
+ dojo.query(".treeTableRow").forEach(function(node, i) {
+ dojo.toggleClass(node, "outgoingCommitsdRow", false);
+ });
+ }, func, "Push Git Repository");
});
});
});
+ });
+ })
});
- })
+ dialog.startup();
+ dialog.show();
});
- dialog.startup();
- dialog.show();
- });
+ }
}
},
visibleWhen : function(item) {
@@ -1072,7 +1075,7 @@ var exports = {};
var pushToCommand = new mCommands.Command({
name : "Push to...",
- tooltip: "Update the remote branch using content from your active branch",
+ tooltip: "Push from your local branch into the selected remote branch",
imageClass: "git-sprite-push",
spriteClass: "gitCommandSprite",
id : "eclipse.orion.git.pushto",
@@ -1326,7 +1329,7 @@ var exports = {};
exports.createStatusCommands = function(serviceRegistry, commandService, refreshStatusCallBack, cmdBaseNumber, navigator) {
var fetchCommand = new mCommands.Command({
name : "Fetch",
- tooltip : "Update the remote tracking branch using the content from the remote",
+ tooltip : "Fetch from the remote branch into your remote tracking branch",
imageClass: "git-sprite-fetch",
spriteClass: "gitCommandSprite",
id : "eclipse.orion.git.fetch",
@@ -1389,7 +1392,7 @@ var exports = {};
});
},
visibleWhen : function(item) {
- return item.Type === "RemoteTrackingBranch" || item.Type === "Remote";
+ return item.Type === "RemoteTrackingBranch";
}
});
@@ -1470,7 +1473,7 @@ var exports = {};
var pushCommand = new mCommands.Command({
name : "Push",
- tooltip: "Update the remote branch using content from your active branch",
+ tooltip: "Push from your local branch into the remote branch",
imageClass: "git-sprite-push",
spriteClass: "gitCommandSprite",
id : "eclipse.orion.git.push",