mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-10 06:34:26 +02:00
ALL DONE with: commit, status, export, log, bookmark, update, backout, histedit, pull, ammend, summary
This commit is contained in:
parent
a033173281
commit
8acfe45874
7 changed files with 161 additions and 51 deletions
136
build/bundle.js
136
build/bundle.js
|
@ -9902,8 +9902,6 @@ var commands = {
|
||||||
if (!commandConfigs[vcs][name]) {
|
if (!commandConfigs[vcs][name]) {
|
||||||
throw new Error('i dont have a command for ' + name);
|
throw new Error('i dont have a command for ' + name);
|
||||||
}
|
}
|
||||||
console.log(commandObj.getSupportedMap());
|
|
||||||
console.log(commandObj.getGeneralArgs());
|
|
||||||
var config = commandConfigs[vcs][name];
|
var config = commandConfigs[vcs][name];
|
||||||
if (config.delegate) {
|
if (config.delegate) {
|
||||||
return this.delegateExecute(config, engine, commandObj);
|
return this.delegateExecute(config, engine, commandObj);
|
||||||
|
@ -10611,7 +10609,7 @@ var commandConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
status: {
|
status: {
|
||||||
regex: /^hg +status *$/,
|
regex: /^hg +(status|st) *$/,
|
||||||
execute: function(engine, command) {
|
execute: function(engine, command) {
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: intl.str('hg-error-no-status')
|
msg: intl.str('hg-error-no-status')
|
||||||
|
@ -10641,20 +10639,8 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
bookmarks: {
|
|
||||||
// NO OPTIONS for this command, -r goes
|
|
||||||
// to the bookmark command instead
|
|
||||||
regex: /^hg (bookmarks|book) *$/,
|
|
||||||
delegate: function(engine, command) {
|
|
||||||
return {
|
|
||||||
vcs: 'git',
|
|
||||||
name: 'branch'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
bookmark: {
|
bookmark: {
|
||||||
regex: /^hg (bookmark|book)($|\s)/,
|
regex: /^hg (bookmarks|bookmark|book)($|\s)/,
|
||||||
options: [
|
options: [
|
||||||
'-r',
|
'-r',
|
||||||
'-m',
|
'-m',
|
||||||
|
@ -10723,6 +10709,55 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
update: {
|
||||||
|
regex: /^hg +(update|up)($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'checkout'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
backout: {
|
||||||
|
regex: /^hg +backout($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'revert'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
histedit: {
|
||||||
|
regex: /^hg +histedit($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
var args = command.getGeneralArgs();
|
||||||
|
command.validateArgBounds(args, 1, 1);
|
||||||
|
command.setSupportedMap({
|
||||||
|
'-i': args
|
||||||
|
});
|
||||||
|
command.setGeneralArgs([]);
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'rebase'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// TODO rebase :OOOO need to graft? engine work
|
||||||
|
// rebase: {
|
||||||
|
|
||||||
|
pull: {
|
||||||
|
regex: /^hg +pull($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'pull'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
ammend: {
|
ammend: {
|
||||||
regex: /^hg +ammend *$/,
|
regex: /^hg +ammend *$/,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
|
@ -23610,8 +23645,6 @@ var commands = {
|
||||||
if (!commandConfigs[vcs][name]) {
|
if (!commandConfigs[vcs][name]) {
|
||||||
throw new Error('i dont have a command for ' + name);
|
throw new Error('i dont have a command for ' + name);
|
||||||
}
|
}
|
||||||
console.log(commandObj.getSupportedMap());
|
|
||||||
console.log(commandObj.getGeneralArgs());
|
|
||||||
var config = commandConfigs[vcs][name];
|
var config = commandConfigs[vcs][name];
|
||||||
if (config.delegate) {
|
if (config.delegate) {
|
||||||
return this.delegateExecute(config, engine, commandObj);
|
return this.delegateExecute(config, engine, commandObj);
|
||||||
|
@ -29972,7 +30005,7 @@ var commandConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
status: {
|
status: {
|
||||||
regex: /^hg +status *$/,
|
regex: /^hg +(status|st) *$/,
|
||||||
execute: function(engine, command) {
|
execute: function(engine, command) {
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: intl.str('hg-error-no-status')
|
msg: intl.str('hg-error-no-status')
|
||||||
|
@ -30002,20 +30035,8 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
bookmarks: {
|
|
||||||
// NO OPTIONS for this command, -r goes
|
|
||||||
// to the bookmark command instead
|
|
||||||
regex: /^hg (bookmarks|book) *$/,
|
|
||||||
delegate: function(engine, command) {
|
|
||||||
return {
|
|
||||||
vcs: 'git',
|
|
||||||
name: 'branch'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
bookmark: {
|
bookmark: {
|
||||||
regex: /^hg (bookmark|book)($|\s)/,
|
regex: /^hg (bookmarks|bookmark|book)($|\s)/,
|
||||||
options: [
|
options: [
|
||||||
'-r',
|
'-r',
|
||||||
'-m',
|
'-m',
|
||||||
|
@ -30084,6 +30105,55 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
update: {
|
||||||
|
regex: /^hg +(update|up)($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'checkout'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
backout: {
|
||||||
|
regex: /^hg +backout($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'revert'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
histedit: {
|
||||||
|
regex: /^hg +histedit($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
var args = command.getGeneralArgs();
|
||||||
|
command.validateArgBounds(args, 1, 1);
|
||||||
|
command.setSupportedMap({
|
||||||
|
'-i': args
|
||||||
|
});
|
||||||
|
command.setGeneralArgs([]);
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'rebase'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// TODO rebase :OOOO need to graft? engine work
|
||||||
|
// rebase: {
|
||||||
|
|
||||||
|
pull: {
|
||||||
|
regex: /^hg +pull($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'pull'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
ammend: {
|
ammend: {
|
||||||
regex: /^hg +ammend *$/,
|
regex: /^hg +ammend *$/,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
|
@ -30589,6 +30659,7 @@ var toGlobalize = {
|
||||||
CommandModel: require('../models/commandModel'),
|
CommandModel: require('../models/commandModel'),
|
||||||
Levels: require('../git/treeCompare'),
|
Levels: require('../git/treeCompare'),
|
||||||
Constants: require('../util/constants'),
|
Constants: require('../util/constants'),
|
||||||
|
Commands: require('../commands'),
|
||||||
Collections: require('../models/collections'),
|
Collections: require('../models/collections'),
|
||||||
Async: require('../visuals/animation'),
|
Async: require('../visuals/animation'),
|
||||||
AnimationFactory: require('../visuals/animation/animationFactory'),
|
AnimationFactory: require('../visuals/animation/animationFactory'),
|
||||||
|
@ -30612,6 +30683,7 @@ var toGlobalize = {
|
||||||
|
|
||||||
_.each(toGlobalize, function(module) {
|
_.each(toGlobalize, function(module) {
|
||||||
for (var key in module) {
|
for (var key in module) {
|
||||||
|
console.log('assigning', key);
|
||||||
window['debug_' + key] = module[key];
|
window['debug_' + key] = module[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
1
build/bundle.min.js
vendored
1
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -439,7 +439,7 @@
|
||||||
For a much easier time perusing the source, see the individual files at:
|
For a much easier time perusing the source, see the individual files at:
|
||||||
https://github.com/pcottle/learnGitBranching
|
https://github.com/pcottle/learnGitBranching
|
||||||
-->
|
-->
|
||||||
<script src="build/bundle.min.cc817fd3.js"></script>
|
<script src="build/bundle.js"></script>
|
||||||
|
|
||||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||||
The downside? No raw logs to parse for analytics, so I have to include
|
The downside? No raw logs to parse for analytics, so I have to include
|
||||||
|
|
|
@ -18,8 +18,6 @@ var commands = {
|
||||||
if (!commandConfigs[vcs][name]) {
|
if (!commandConfigs[vcs][name]) {
|
||||||
throw new Error('i dont have a command for ' + name);
|
throw new Error('i dont have a command for ' + name);
|
||||||
}
|
}
|
||||||
console.log(commandObj.getSupportedMap());
|
|
||||||
console.log(commandObj.getGeneralArgs());
|
|
||||||
var config = commandConfigs[vcs][name];
|
var config = commandConfigs[vcs][name];
|
||||||
if (config.delegate) {
|
if (config.delegate) {
|
||||||
return this.delegateExecute(config, engine, commandObj);
|
return this.delegateExecute(config, engine, commandObj);
|
||||||
|
|
|
@ -32,7 +32,8 @@ var commandConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
status: {
|
status: {
|
||||||
regex: /^hg +status *$/,
|
regex: /^hg +(status|st) *$/,
|
||||||
|
dontCountForGolf: true,
|
||||||
execute: function(engine, command) {
|
execute: function(engine, command) {
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: intl.str('hg-error-no-status')
|
msg: intl.str('hg-error-no-status')
|
||||||
|
@ -42,6 +43,7 @@ var commandConfig = {
|
||||||
|
|
||||||
'export': {
|
'export': {
|
||||||
regex: /^hg +export($|\s)/,
|
regex: /^hg +export($|\s)/,
|
||||||
|
dontCountForGolf: true,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
command.mapDotToHead();
|
command.mapDotToHead();
|
||||||
return {
|
return {
|
||||||
|
@ -53,6 +55,7 @@ var commandConfig = {
|
||||||
|
|
||||||
log: {
|
log: {
|
||||||
regex: /^hg +log *$/,
|
regex: /^hg +log *$/,
|
||||||
|
dontCountForGolf: true,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
command.mapDotToHead();
|
command.mapDotToHead();
|
||||||
return {
|
return {
|
||||||
|
@ -62,20 +65,8 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
bookmarks: {
|
|
||||||
// NO OPTIONS for this command, -r goes
|
|
||||||
// to the bookmark command instead
|
|
||||||
regex: /^hg (bookmarks|book) *$/,
|
|
||||||
delegate: function(engine, command) {
|
|
||||||
return {
|
|
||||||
vcs: 'git',
|
|
||||||
name: 'branch'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
bookmark: {
|
bookmark: {
|
||||||
regex: /^hg (bookmark|book)($|\s)/,
|
regex: /^hg (bookmarks|bookmark|book)($|\s)/,
|
||||||
options: [
|
options: [
|
||||||
'-r',
|
'-r',
|
||||||
'-m',
|
'-m',
|
||||||
|
@ -144,6 +135,55 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
update: {
|
||||||
|
regex: /^hg +(update|up)($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'checkout'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
backout: {
|
||||||
|
regex: /^hg +backout($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'revert'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
histedit: {
|
||||||
|
regex: /^hg +histedit($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
var args = command.getGeneralArgs();
|
||||||
|
command.validateArgBounds(args, 1, 1);
|
||||||
|
command.setSupportedMap({
|
||||||
|
'-i': args
|
||||||
|
});
|
||||||
|
command.setGeneralArgs([]);
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'rebase'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// TODO rebase :OOOO need to graft? engine work
|
||||||
|
// rebase: {
|
||||||
|
|
||||||
|
pull: {
|
||||||
|
regex: /^hg +pull($|\s+)/,
|
||||||
|
delegate: function(engine, command) {
|
||||||
|
return {
|
||||||
|
vcs: 'git',
|
||||||
|
name: 'pull'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
ammend: {
|
ammend: {
|
||||||
regex: /^hg +ammend *$/,
|
regex: /^hg +ammend *$/,
|
||||||
delegate: function(engine, command) {
|
delegate: function(engine, command) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ var toGlobalize = {
|
||||||
CommandModel: require('../models/commandModel'),
|
CommandModel: require('../models/commandModel'),
|
||||||
Levels: require('../git/treeCompare'),
|
Levels: require('../git/treeCompare'),
|
||||||
Constants: require('../util/constants'),
|
Constants: require('../util/constants'),
|
||||||
|
Commands: require('../commands'),
|
||||||
Collections: require('../models/collections'),
|
Collections: require('../models/collections'),
|
||||||
Async: require('../visuals/animation'),
|
Async: require('../visuals/animation'),
|
||||||
AnimationFactory: require('../visuals/animation/animationFactory'),
|
AnimationFactory: require('../visuals/animation/animationFactory'),
|
||||||
|
@ -30,6 +31,7 @@ var toGlobalize = {
|
||||||
|
|
||||||
_.each(toGlobalize, function(module) {
|
_.each(toGlobalize, function(module) {
|
||||||
for (var key in module) {
|
for (var key in module) {
|
||||||
|
console.log('assigning', key);
|
||||||
window['debug_' + key] = module[key];
|
window['debug_' + key] = module[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue