basic visuals working also

This commit is contained in:
Peter Cottle 2012-09-10 15:50:57 -07:00
parent 2f49d2d191
commit 908b403c4b
3 changed files with 9 additions and 6 deletions

View file

@ -122,7 +122,6 @@ function OptionParser(method, options) {
this.options = options; this.options = options;
this.supportedMap = this.getMasterOptionMap()[method]; this.supportedMap = this.getMasterOptionMap()[method];
this.unsupportedOptions = [];
if (this.supportedMap === undefined) { if (this.supportedMap === undefined) {
throw new Error('No option map for ' + method); throw new Error('No option map for ' + method);
@ -167,7 +166,8 @@ OptionParser.prototype.explodeAndSet = function() {
if (this.supportedMap[option] !== undefined) { if (this.supportedMap[option] !== undefined) {
this.supportedMap[option] = true; this.supportedMap[option] = true;
} else { } else {
this.unsupportedOptions.push(option); // this option is not supported
throw new CommandProcessError('The option "' + option + '" is not supported');
} }
}, this); }, this);
// done! // done!

View file

@ -206,8 +206,11 @@ GitEngine.prototype.numBackFrom = function(commit, numBack) {
}; };
GitEngine.prototype.checkout = function(idOrTarget) { GitEngine.prototype.checkout = function(idOrTarget) {
console.log('the target', idOrTarget);
var target = this.resolveId(idOrTarget); var target = this.resolveId(idOrTarget);
console.log(target);
if (target.get('id') === 'HEAD') { if (target.get('id') === 'HEAD') {
// git checkout HEAD is a
// meaningless command but i used to do this back in the day // meaningless command but i used to do this back in the day
return; return;
} }
@ -253,6 +256,7 @@ GitEngine.prototype.deleteBranch = function(name) {
GitEngine.prototype.dispatch = function(commandObj) { GitEngine.prototype.dispatch = function(commandObj) {
// TODO: parse arguments as well // TODO: parse arguments as well
console.log(commandObj);
this[commandObj.method](); this[commandObj.method]();
}; };
@ -333,12 +337,11 @@ var Commit = Backbone.Model.extend({
}, },
addNodeToVisuals: function() { addNodeToVisuals: function() {
// TODO: arbor stuff this.set('arborNode', sys.addNode(this.get('id')));
// this.set('node', sys.addNode(this.get('id')));
}, },
addEdgeToVisuals: function(parent) { addEdgeToVisuals: function(parent) {
sys.addEdge(this.get('arborNode'), parent.get('arborNode'));
}, },
initialize: function() { initialize: function() {

View file

@ -39,7 +39,7 @@ p.commandResult {
color: blue; color: blue;
} }
p.commandError { p.commandError, p.errorResult {
color: red; color: red;
} }