have cherry pick but forgot highlight

This commit is contained in:
Peter Cottle 2013-06-04 14:58:49 -10:00
parent 733ad7d648
commit f400ac238e
2 changed files with 48 additions and 69 deletions

View file

@ -700,33 +700,26 @@ GitEngine.prototype.cherrypickStarter = function() {
}, this);
// error checks are all good, lets go!
// hack up the rebase response to animate this better
var animationResponse = {};
animationResponse.destinationBranch = this.resolveID('HEAD');
animationResponse.toRebaseArray = [];
animationResponse.rebaseSteps = [];
var destinationBranch = this.resolveID('HEAD');
var deferred = Q.defer();
var chain = deferred.promise;
// now lets start going through
var beforeSnapshot = this.gitVisuals.genSnapshot();
var afterSnapshot;
var newCommit;
_.each(this.generalArgs, function(arg) {
var chainStep = _.bind(function(arg) {
var oldCommit = this.getCommitFromRef(arg);
animationResponse.toRebaseArray.push(oldCommit);
newCommit = this.cherrypick(arg);
afterSnapshot = this.gitVisuals.genSnapshot();
animationResponse.rebaseSteps.push({
oldCommit: oldCommit,
newCommit: newCommit,
beforeSnapshot: beforeSnapshot,
afterSnapshot: this.gitVisuals.genSnapshot()
});
beforeSnapshot = afterSnapshot;
var newCommit = this.cherrypick(arg);
return this.animationFactory.playCommitBirthPromiseAnimation(
newCommit,
this.gitVisuals
);
}, this);
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
_.each(this.generalArgs, function(arg) {
chain = chain.then(function() {
return chainStep(arg);
});
}, this);
this.animationQueue.thenFinish(chain, deferred);
};
/*************************************