rebase onto commits

This commit is contained in:
Peter Cottle 2012-10-21 18:24:45 -07:00
parent 93abdd9043
commit 73cf66b35e
3 changed files with 14 additions and 4 deletions

View file

@ -109,8 +109,13 @@ AnimationFactory.prototype.rebaseHighlightPart = function(animationQueue, rebase
var slowTime = fullTime * 2.0; var slowTime = fullTime * 2.0;
// we want to highlight all the old commits // we want to highlight all the old commits
var oldCommits = rebaseResponse.toRebaseArray;//.reverse(); var oldCommits = rebaseResponse.toRebaseArray;
// we are either highlighting to a visBranch or a visNode
var visBranch = rebaseResponse.destinationBranch.get('visBranch'); var visBranch = rebaseResponse.destinationBranch.get('visBranch');
if (!visBranch) {
// in the case where we rebase onto a commit
visBranch = rebaseResponse.destinationBranch.get('visNode');
}
_.each(oldCommits, function(oldCommit) { _.each(oldCommits, function(oldCommit) {
var visNode = oldCommit.get('visNode'); var visNode = oldCommit.get('visNode');

View file

@ -736,11 +736,12 @@ GitEngine.prototype.rebaseStarter = function() {
GitEngine.prototype.rebase = function(targetSource, currentLocation) { GitEngine.prototype.rebase = function(targetSource, currentLocation) {
var targetObj = this.resolveID(targetSource); var targetObj = this.resolveID(targetSource);
/*
if (targetObj.get('type') !== 'branch') { if (targetObj.get('type') !== 'branch') {
throw new GitError({ throw new GitError({
msg: 'Only rebase onto branches! Not individual commits' msg: 'Only rebase onto branches! Not individual commits'
}); });
} }*/
// first some conditions // first some conditions
if (this.isUpstreamOf(targetSource, currentLocation)) { if (this.isUpstreamOf(targetSource, currentLocation)) {

View file

@ -42,6 +42,10 @@ var VisBranch = VisBase.extend({
} }
}, },
getFill: function() {
return this.get('fill');
},
getID: function() { getID: function() {
return this.get('branch').get('id'); return this.get('branch').get('id');
}, },
@ -505,9 +509,9 @@ var VisNode = VisBase.extend({
}; };
}, },
highlightTo: function(branch, speed, easing) { highlightTo: function(visObj, speed, easing) {
// a small function to highlight the color of a node for demonstration purposes // a small function to highlight the color of a node for demonstration purposes
var color = branch.get('fill'); var color = visObj.get('fill');
var attr = { var attr = {
circle: { circle: {