mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
basic visuals working also
This commit is contained in:
parent
2f49d2d191
commit
908b403c4b
3 changed files with 9 additions and 6 deletions
|
@ -122,7 +122,6 @@ function OptionParser(method, options) {
|
|||
this.options = options;
|
||||
|
||||
this.supportedMap = this.getMasterOptionMap()[method];
|
||||
this.unsupportedOptions = [];
|
||||
|
||||
if (this.supportedMap === undefined) {
|
||||
throw new Error('No option map for ' + method);
|
||||
|
@ -167,7 +166,8 @@ OptionParser.prototype.explodeAndSet = function() {
|
|||
if (this.supportedMap[option] !== undefined) {
|
||||
this.supportedMap[option] = true;
|
||||
} else {
|
||||
this.unsupportedOptions.push(option);
|
||||
// this option is not supported
|
||||
throw new CommandProcessError('The option "' + option + '" is not supported');
|
||||
}
|
||||
}, this);
|
||||
// done!
|
||||
|
|
|
@ -206,8 +206,11 @@ GitEngine.prototype.numBackFrom = function(commit, numBack) {
|
|||
};
|
||||
|
||||
GitEngine.prototype.checkout = function(idOrTarget) {
|
||||
console.log('the target', idOrTarget);
|
||||
var target = this.resolveId(idOrTarget);
|
||||
console.log(target);
|
||||
if (target.get('id') === 'HEAD') {
|
||||
// git checkout HEAD is a
|
||||
// meaningless command but i used to do this back in the day
|
||||
return;
|
||||
}
|
||||
|
@ -253,6 +256,7 @@ GitEngine.prototype.deleteBranch = function(name) {
|
|||
|
||||
GitEngine.prototype.dispatch = function(commandObj) {
|
||||
// TODO: parse arguments as well
|
||||
console.log(commandObj);
|
||||
this[commandObj.method]();
|
||||
};
|
||||
|
||||
|
@ -333,12 +337,11 @@ var Commit = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
addNodeToVisuals: function() {
|
||||
// TODO: arbor stuff
|
||||
// this.set('node', sys.addNode(this.get('id')));
|
||||
this.set('arborNode', sys.addNode(this.get('id')));
|
||||
},
|
||||
|
||||
addEdgeToVisuals: function(parent) {
|
||||
|
||||
sys.addEdge(this.get('arborNode'), parent.get('arborNode'));
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -39,7 +39,7 @@ p.commandResult {
|
|||
color: blue;
|
||||
}
|
||||
|
||||
p.commandError {
|
||||
p.commandError, p.errorResult {
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue