revert partway

This commit is contained in:
Peter Cottle 2013-06-04 10:38:26 -10:00
parent 880e1ca630
commit ec1bab114f
3 changed files with 93 additions and 44 deletions

View file

@ -602,10 +602,23 @@ GitEngine.prototype.revertStarter = function() {
};
GitEngine.prototype.revert = function(whichCommits) {
// for each commit, we want to revert it
var toRebase = [];
_.each(whichCommits, function(stringRef) {
toRebase.push(this.getCommitFromRef(stringRef));
// resolve the commits we will rebase
var toRebase = _.map(whichCommits, function(stringRef) {
return this.getCommitFromRef(stringRef);
}, this);
var deferred = Q.defer();
var chain = deferred.promise;
// go highlight all the ones we will rebase first, in order
var destBranch = this.resolveID(toRebase[0]);
_.each(whichCommits, function(commit) {
chain = chain.then(_.bind(function() {
return this.animationFactory.playHighlightPromiseAnimation(
commit,
destBranch
);
}, this));
}, this);
// we animate reverts now!! we use the rebase animation though so that's