OMG stupid typo

This commit is contained in:
Peter Cottle 2013-01-02 16:38:15 -08:00
parent de9d91773a
commit 2f57f4cfe3
11 changed files with 8247 additions and 7977 deletions

View file

@ -1,10 +1,12 @@
var _ = require('underscore');
var Backbone = require('backbone');
var Q = require('q');
var GitEngine = require('../git').GitEngine;
var AnimationFactory = require('../visuals/animation/animationFactory').AnimationFactory;
var GitVisuals = require('../visuals').GitVisuals;
var TreeCompare = require('../git/treeCompare').TreeCompare;
var EventBaton = require('../util/eventBaton').EventBaton;
var Collections = require('../models/collections');
var CommitCollection = Collections.CommitCollection;
@ -33,7 +35,7 @@ HeadlessGit.prototype.init = function() {
branches: this.branchCollection,
gitVisuals: gitVisuals,
animationFactory: animationFactory,
events: _.clone(Backbone.Events)
eventBaton: new EventBaton()
});
this.gitEngine.init();
};
@ -44,8 +46,7 @@ HeadlessGit.prototype.sendCommand = function(value) {
rawStr: commandStr
});
console.log('dispatching command "', commandStr, '"');
var done = function() {};
this.gitEngine.dispatch(commandObj, done);
this.gitEngine.dispatch(commandObj, Q.defer());
}, this);
};

View file

@ -19,7 +19,10 @@ function GitEngine(options) {
this.branchCollection = options.branches;
this.commitCollection = options.collection;
this.gitVisuals = options.gitVisuals;
this.events = options.events;
this.eventBaton = options.eventBaton;
this.eventBaton.stealBaton('processGitCommand', this.dispatch, this);
this.animationFactory = options.animationFactory ||
new AnimationFactoryModule.AnimationFactory();
@ -28,7 +31,6 @@ function GitEngine(options) {
this.commandOptions = {};
this.generalArgs = [];
this.events.on('processGitCommand', this.dispatch, this);
// backbone or something uses _.uniqueId, so we make our own here
this.uniqueId = (function() {
@ -1340,7 +1342,7 @@ GitEngine.prototype.filterError = function(err) {
}
};
GitEngine.prototype.dispatch = function(command, callback) {
GitEngine.prototype.dispatch = function(command, deferred) {
// current command, options, and args are stored in the gitEngine
// for easy reference during processing.
this.command = command;
@ -1349,8 +1351,7 @@ GitEngine.prototype.dispatch = function(command, callback) {
// set up the animation queue
var whenDone = _.bind(function() {
command.set('status', 'finished');
callback();
command.finishWith(deferred);
}, this);
this.animationQueue = new AnimationQueue({
callback: whenDone
@ -1363,7 +1364,7 @@ GitEngine.prototype.dispatch = function(command, callback) {
this.filterError(err);
// short circuit animation by just setting error and returning
command.set('error', err);
callback();
deferred.resolve();
return;
}