diff --git a/build/bundle.js b/build/bundle.js index 14f0adfd..bc5c4fbd 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -3398,7 +3398,7 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna /////////////////////////////////////////////////////////////////////////// 'hg-a-option': { '__desc__': 'warning for when using -A option', - 'en_US': 'The -A option is not needed for this app, since there is no staging of files. just commit away!' + 'en_US': 'The -A option is not needed for this app, just commit away!' }, /////////////////////////////////////////////////////////////////////////// 'hg-error-no-status': { @@ -3411,6 +3411,11 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna 'en_US': 'I need the option {option} for that command!' }, /////////////////////////////////////////////////////////////////////////// + 'hg-error-log-no-follow': { + '__desc__': 'hg log without -f (--follow)', + 'en_US': 'hg log without -f is currently not supported, use -f' + }, + /////////////////////////////////////////////////////////////////////////// 'git-status-detached': { '__desc__': 'One of the lines for git status output', 'en_US': 'Detached head!', @@ -8380,6 +8385,25 @@ GitEngine.prototype.setTargetLocation = function(ref, target) { ref.set('target', target); }; +GitEngine.prototype.updateBranchesFromSet = function(commitSet) { + // commitSet is the set of commits that are stale or moved or whatever. + // any branches POINTING to these commits need to be moved! + + // first get a list of what branches influence what commits + var upstreamSet = this.getUpstreamBranchSet(); + + var branchesToUpdate = {}; + // now loop over the set we got passed in and find which branches + // that means (aka intersection) + _.each(commitSet, function(val, id) { + _.each(upstreamSet[id], function(branchJSON) { + branchesToUpdate[branchJSON.id] = true; + }); + }, this); + + console.log(branchesToUpdate); +}; + GitEngine.prototype.pruneTree = function() { var set = this.getUpstreamBranchSet(); // dont prune commits that HEAD depends on @@ -10760,9 +10784,20 @@ var commandConfig = { }, log: { - regex: /^hg +log *$/, + regex: /^hg +log($|\s)/, + options: [ + '-f' + ], dontCountForGolf: true, delegate: function(engine, command) { + var options = command.getSupportedMap(); + command.acceptNoGeneralArgs(); + + if (!options['-f']) { + throw new GitError({ + msg: intl.str('hg-error-log-no-follow') + }); + } command.mapDotToHead(); return { vcs: 'git', @@ -10890,19 +10925,6 @@ var commandConfig = { } }, - ammend: { - regex: /^hg +ammend *$/, - delegate: function(engine, command) { - command.setOptionMap({ - '--amend': true - }); - return { - vcs: 'hg', - name: 'commit' - }; - } - }, - summary: { regex: /^hg +(summary|sum) *$/, delegate: function(engine, command) { @@ -17725,7 +17747,7 @@ var VisBranch = VisBase.extend({ var isHg = this.gitEngine.getIsHg(); if (name === 'HEAD' && isHg) { - name = ' . '; + name = '.'; } var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : ''; @@ -26353,6 +26375,25 @@ GitEngine.prototype.setTargetLocation = function(ref, target) { ref.set('target', target); }; +GitEngine.prototype.updateBranchesFromSet = function(commitSet) { + // commitSet is the set of commits that are stale or moved or whatever. + // any branches POINTING to these commits need to be moved! + + // first get a list of what branches influence what commits + var upstreamSet = this.getUpstreamBranchSet(); + + var branchesToUpdate = {}; + // now loop over the set we got passed in and find which branches + // that means (aka intersection) + _.each(commitSet, function(val, id) { + _.each(upstreamSet[id], function(branchJSON) { + branchesToUpdate[branchJSON.id] = true; + }); + }, this); + + console.log(branchesToUpdate); +}; + GitEngine.prototype.pruneTree = function() { var set = this.getUpstreamBranchSet(); // dont prune commits that HEAD depends on @@ -27883,7 +27924,7 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna /////////////////////////////////////////////////////////////////////////// 'hg-a-option': { '__desc__': 'warning for when using -A option', - 'en_US': 'The -A option is not needed for this app, since there is no staging of files. just commit away!' + 'en_US': 'The -A option is not needed for this app, just commit away!' }, /////////////////////////////////////////////////////////////////////////// 'hg-error-no-status': { @@ -27896,6 +27937,11 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna 'en_US': 'I need the option {option} for that command!' }, /////////////////////////////////////////////////////////////////////////// + 'hg-error-log-no-follow': { + '__desc__': 'hg log without -f (--follow)', + 'en_US': 'hg log without -f is currently not supported, use -f' + }, + /////////////////////////////////////////////////////////////////////////// 'git-status-detached': { '__desc__': 'One of the lines for git status output', 'en_US': 'Detached head!', @@ -30305,9 +30351,20 @@ var commandConfig = { }, log: { - regex: /^hg +log *$/, + regex: /^hg +log($|\s)/, + options: [ + '-f' + ], dontCountForGolf: true, delegate: function(engine, command) { + var options = command.getSupportedMap(); + command.acceptNoGeneralArgs(); + + if (!options['-f']) { + throw new GitError({ + msg: intl.str('hg-error-log-no-follow') + }); + } command.mapDotToHead(); return { vcs: 'git', @@ -30435,19 +30492,6 @@ var commandConfig = { } }, - ammend: { - regex: /^hg +ammend *$/, - delegate: function(engine, command) { - command.setOptionMap({ - '--amend': true - }); - return { - vcs: 'hg', - name: 'commit' - }; - } - }, - summary: { regex: /^hg +(summary|sum) *$/, delegate: function(engine, command) { @@ -35704,7 +35748,7 @@ var VisBranch = VisBase.extend({ var isHg = this.gitEngine.getIsHg(); if (name === 'HEAD' && isHg) { - name = ' . '; + name = '.'; } var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : ''; diff --git a/src/js/git/index.js b/src/js/git/index.js index c41b3bc4..efd93903 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -1137,13 +1137,10 @@ GitEngine.prototype.resolveRelativeRef = function(commit, relative) { } if (!next) { - var msg = intl.str( - 'git-error-relative-ref', - { - commit: commit.id, - match: matches[0] - } - ); + var msg = intl.str('git-error-relative-ref', { + commit: commit.id, + match: matches[0] + }); throw new GitError({ msg: msg }); @@ -1216,6 +1213,32 @@ GitEngine.prototype.setTargetLocation = function(ref, target) { ref.set('target', target); }; +GitEngine.prototype.updateBranchesFromSet = function(commitSet) { + // commitSet is the set of commits that are stale or moved or whatever. + // any branches POINTING to these commits need to be moved! + + // first get a list of what branches influence what commits + var upstreamSet = this.getUpstreamBranchSet(); + + var branchesToUpdate = {}; + // now loop over the set we got passed in and find which branches + // that means (aka intersection) + _.each(commitSet, function(val, id) { + _.each(upstreamSet[id], function(branchJSON) { + branchesToUpdate[branchJSON.id] = true; + }); + }, this); + + _.each(branchesToUpdate, function(val, id) { + // ok now just check if this branch has a more recent commit available. + // that mapping is easy because we always do rebase alt id -- + // theres no way to have C3' and C3''' but no C3''. so just + // bump the ID once -- if thats not filled in we are updated, + // otherwise loop until you find undefined + var commit = this.getCommitFromRef(id); + }); +}; + GitEngine.prototype.pruneTree = function() { var set = this.getUpstreamBranchSet(); // dont prune commits that HEAD depends on