mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-04 03:34:27 +02:00
slick max depth
This commit is contained in:
parent
70e2165aea
commit
1d59152931
3 changed files with 7 additions and 2 deletions
|
@ -58,7 +58,7 @@ $(document).ready(function(){
|
||||||
setTimeout(windowResize, 50);
|
setTimeout(windowResize, 50);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
events.trigger('submitCommandValueFromEvent', "gc; gc; gc; gc; gc; gc; git checkout master^^^^; git commit; git checkout -b another; gc; gc; git rebase master");
|
events.trigger('submitCommandValueFromEvent', "gc; git checkout HEAD~1; git commit; git checkout -b bugFix; gc; gc; git rebase master; git checkout master; gc; gc; git merge bugFix");
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -426,6 +426,11 @@ var VisNode = Backbone.Model.extend({
|
||||||
this.set('outgoingEdges', []);
|
this.set('outgoingEdges', []);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setDepth: function(depth) {
|
||||||
|
// for merge commits we need to max the depths across all
|
||||||
|
this.set('depth', Math.max(this.get('depth') || 0, depth));
|
||||||
|
},
|
||||||
|
|
||||||
setDepthBasedOn: function(depthIncrement) {
|
setDepthBasedOn: function(depthIncrement) {
|
||||||
if (this.get('depth') === undefined) {
|
if (this.get('depth') === undefined) {
|
||||||
throw new Error('no depth yet!');
|
throw new Error('no depth yet!');
|
||||||
|
|
|
@ -374,7 +374,7 @@ GitVisuals.prototype.getDepthIncrement = function(maxDepth) {
|
||||||
};
|
};
|
||||||
|
|
||||||
GitVisuals.prototype.calcDepthRecursive = function(commit, depth) {
|
GitVisuals.prototype.calcDepthRecursive = function(commit, depth) {
|
||||||
commit.get('visNode').set('depth', depth);
|
commit.get('visNode').setDepth(depth);
|
||||||
|
|
||||||
var children = commit.get('children');
|
var children = commit.get('children');
|
||||||
var maxDepth = depth;
|
var maxDepth = depth;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue