mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-08 21:54:26 +02:00
WIP
This commit is contained in:
parent
e2cd621c96
commit
bd95734751
2 changed files with 106 additions and 39 deletions
104
build/bundle.js
104
build/bundle.js
|
@ -3398,7 +3398,7 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
'hg-a-option': {
|
'hg-a-option': {
|
||||||
'__desc__': 'warning for when using -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': {
|
'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!'
|
'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': {
|
'git-status-detached': {
|
||||||
'__desc__': 'One of the lines for git status output',
|
'__desc__': 'One of the lines for git status output',
|
||||||
'en_US': 'Detached head!',
|
'en_US': 'Detached head!',
|
||||||
|
@ -8380,6 +8385,25 @@ GitEngine.prototype.setTargetLocation = function(ref, target) {
|
||||||
ref.set('target', 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() {
|
GitEngine.prototype.pruneTree = function() {
|
||||||
var set = this.getUpstreamBranchSet();
|
var set = this.getUpstreamBranchSet();
|
||||||
// dont prune commits that HEAD depends on
|
// dont prune commits that HEAD depends on
|
||||||
|
@ -10760,9 +10784,20 @@ var commandConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
log: {
|
log: {
|
||||||
regex: /^hg +log *$/,
|
regex: /^hg +log($|\s)/,
|
||||||
|
options: [
|
||||||
|
'-f'
|
||||||
|
],
|
||||||
dontCountForGolf: true,
|
dontCountForGolf: true,
|
||||||
delegate: function(engine, command) {
|
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();
|
command.mapDotToHead();
|
||||||
return {
|
return {
|
||||||
vcs: 'git',
|
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: {
|
summary: {
|
||||||
regex: /^hg +(summary|sum) *$/,
|
regex: /^hg +(summary|sum) *$/,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
|
@ -26353,6 +26375,25 @@ GitEngine.prototype.setTargetLocation = function(ref, target) {
|
||||||
ref.set('target', 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() {
|
GitEngine.prototype.pruneTree = function() {
|
||||||
var set = this.getUpstreamBranchSet();
|
var set = this.getUpstreamBranchSet();
|
||||||
// dont prune commits that HEAD depends on
|
// 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': {
|
'hg-a-option': {
|
||||||
'__desc__': 'warning for when using -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': {
|
'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!'
|
'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': {
|
'git-status-detached': {
|
||||||
'__desc__': 'One of the lines for git status output',
|
'__desc__': 'One of the lines for git status output',
|
||||||
'en_US': 'Detached head!',
|
'en_US': 'Detached head!',
|
||||||
|
@ -30305,9 +30351,20 @@ var commandConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
log: {
|
log: {
|
||||||
regex: /^hg +log *$/,
|
regex: /^hg +log($|\s)/,
|
||||||
|
options: [
|
||||||
|
'-f'
|
||||||
|
],
|
||||||
dontCountForGolf: true,
|
dontCountForGolf: true,
|
||||||
delegate: function(engine, command) {
|
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();
|
command.mapDotToHead();
|
||||||
return {
|
return {
|
||||||
vcs: 'git',
|
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: {
|
summary: {
|
||||||
regex: /^hg +(summary|sum) *$/,
|
regex: /^hg +(summary|sum) *$/,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
|
|
|
@ -1137,13 +1137,10 @@ GitEngine.prototype.resolveRelativeRef = function(commit, relative) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!next) {
|
if (!next) {
|
||||||
var msg = intl.str(
|
var msg = intl.str('git-error-relative-ref', {
|
||||||
'git-error-relative-ref',
|
|
||||||
{
|
|
||||||
commit: commit.id,
|
commit: commit.id,
|
||||||
match: matches[0]
|
match: matches[0]
|
||||||
}
|
});
|
||||||
);
|
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: msg
|
msg: msg
|
||||||
});
|
});
|
||||||
|
@ -1216,6 +1213,32 @@ GitEngine.prototype.setTargetLocation = function(ref, target) {
|
||||||
ref.set('target', 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() {
|
GitEngine.prototype.pruneTree = function() {
|
||||||
var set = this.getUpstreamBranchSet();
|
var set = this.getUpstreamBranchSet();
|
||||||
// dont prune commits that HEAD depends on
|
// dont prune commits that HEAD depends on
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue