mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-16 01:24:25 +02:00
Cleanup + fixed a typo
A typo (TagsCollection vs. TagCollection) made levels crash when loading. There where still lot of stuff left for handling master branch in the visTag code, because visTag is a modified version of the visBranch-object. Therefore, clean up asome unused code Signed-off-by: Max Sikström <msikstrom@op5.com>
This commit is contained in:
parent
74342e2028
commit
7a06cfd0c7
7 changed files with 12 additions and 75 deletions
|
@ -16954,7 +16954,7 @@ GitVisuals.prototype.resetAll = function() {
|
|||
|
||||
this.visEdgeCollection.reset();
|
||||
this.visBranchCollection.reset();
|
||||
this.visTagsCollection.reset();
|
||||
this.visTagCollection.reset();
|
||||
|
||||
this.visNodeMap = {};
|
||||
this.rootCommit = null;
|
||||
|
@ -19029,22 +19029,11 @@ var VisTag = VisBase.extend({
|
|||
* compared in the goal (used in a goal visualization context
|
||||
*/
|
||||
getIsLevelTagCompared: function() {
|
||||
if (this.getIsMaster()) {
|
||||
return true; // master always compared
|
||||
}
|
||||
// we are not master, so return true if its not just master being compared
|
||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||
},
|
||||
|
||||
getIsMaster: function() {
|
||||
return this.get('tag').get('id') == 'master';
|
||||
},
|
||||
|
||||
getArrowTransform: function() {
|
||||
return 't2,20R-35';
|
||||
},
|
||||
|
||||
getTagStackIndex: function() {
|
||||
if (this.get('isHead')) {
|
||||
// head is never stacked with other Tages
|
||||
|
@ -19080,10 +19069,6 @@ var VisTag = VisBase.extend({
|
|||
|
||||
getCommitID: function() {
|
||||
var target = this.get('tag').get('target');
|
||||
if (target.get('type') === 'tag') {
|
||||
// for HEAD
|
||||
target = target.get('target');
|
||||
}
|
||||
return target.get('id');
|
||||
},
|
||||
|
||||
|
@ -19179,16 +19164,10 @@ var VisTag = VisBase.extend({
|
|||
|
||||
getName: function() {
|
||||
var name = this.get('tag').getName();
|
||||
var selected = this.get('tag') === this.gitEngine.HEAD.get('target');
|
||||
var isRemote = this.getIsRemote();
|
||||
var isHg = this.gitEngine.getIsHg();
|
||||
|
||||
if (name === 'HEAD' && isHg) {
|
||||
name = '.';
|
||||
}
|
||||
|
||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
||||
return name + after;
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
nonTextToFront: function() {
|
||||
|
@ -37343,7 +37322,7 @@ GitVisuals.prototype.resetAll = function() {
|
|||
|
||||
this.visEdgeCollection.reset();
|
||||
this.visBranchCollection.reset();
|
||||
this.visTagsCollection.reset();
|
||||
this.visTagCollection.reset();
|
||||
|
||||
this.visNodeMap = {};
|
||||
this.rootCommit = null;
|
||||
|
@ -39660,22 +39639,11 @@ var VisTag = VisBase.extend({
|
|||
* compared in the goal (used in a goal visualization context
|
||||
*/
|
||||
getIsLevelTagCompared: function() {
|
||||
if (this.getIsMaster()) {
|
||||
return true; // master always compared
|
||||
}
|
||||
// we are not master, so return true if its not just master being compared
|
||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||
},
|
||||
|
||||
getIsMaster: function() {
|
||||
return this.get('tag').get('id') == 'master';
|
||||
},
|
||||
|
||||
getArrowTransform: function() {
|
||||
return 't2,20R-35';
|
||||
},
|
||||
|
||||
getTagStackIndex: function() {
|
||||
if (this.get('isHead')) {
|
||||
// head is never stacked with other Tages
|
||||
|
@ -39711,10 +39679,6 @@ var VisTag = VisBase.extend({
|
|||
|
||||
getCommitID: function() {
|
||||
var target = this.get('tag').get('target');
|
||||
if (target.get('type') === 'tag') {
|
||||
// for HEAD
|
||||
target = target.get('target');
|
||||
}
|
||||
return target.get('id');
|
||||
},
|
||||
|
||||
|
@ -39810,16 +39774,10 @@ var VisTag = VisBase.extend({
|
|||
|
||||
getName: function() {
|
||||
var name = this.get('tag').getName();
|
||||
var selected = this.get('tag') === this.gitEngine.HEAD.get('target');
|
||||
var isRemote = this.getIsRemote();
|
||||
var isHg = this.gitEngine.getIsHg();
|
||||
|
||||
if (name === 'HEAD' && isHg) {
|
||||
name = '.';
|
||||
}
|
||||
|
||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
||||
return name + after;
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
nonTextToFront: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue