mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 15:38:33 +02:00
sandbox command reset
This commit is contained in:
parent
d6e9b6a962
commit
f4179e9723
9 changed files with 203 additions and 18 deletions
|
@ -31,7 +31,10 @@ function GitEngine(options) {
|
|||
this.commandOptions = {};
|
||||
this.generalArgs = [];
|
||||
|
||||
this.initUniqueID();
|
||||
}
|
||||
|
||||
GitEngine.prototype.initUniqueID = function() {
|
||||
// backbone or something uses _.uniqueId, so we make our own here
|
||||
this.uniqueId = (function() {
|
||||
var n = 0;
|
||||
|
@ -39,7 +42,7 @@ function GitEngine(options) {
|
|||
return prepend? prepend + n++ : n++;
|
||||
};
|
||||
})();
|
||||
}
|
||||
};
|
||||
|
||||
GitEngine.prototype.defaultInit = function() {
|
||||
var defaultTree = JSON.parse(unescape("%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22master%22%2C%22type%22%3A%22branch%22%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22type%22%3A%22commit%22%2C%22parents%22%3A%5B%5D%2C%22author%22%3A%22Peter%20Cottle%22%2C%22createTime%22%3A%22Mon%20Nov%2005%202012%2000%3A56%3A47%20GMT-0800%20%28PST%29%22%2C%22commitMessage%22%3A%22Quick%20Commit.%20Go%20Bears%21%22%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22type%22%3A%22commit%22%2C%22parents%22%3A%5B%22C0%22%5D%2C%22author%22%3A%22Peter%20Cottle%22%2C%22createTime%22%3A%22Mon%20Nov%2005%202012%2000%3A56%3A47%20GMT-0800%20%28PST%29%22%2C%22commitMessage%22%3A%22Quick%20Commit.%20Go%20Bears%21%22%2C%22id%22%3A%22C1%22%7D%7D%2C%22HEAD%22%3A%7B%22id%22%3A%22HEAD%22%2C%22target%22%3A%22master%22%2C%22type%22%3A%22general%20ref%22%7D%7D"));
|
||||
|
@ -130,6 +133,7 @@ GitEngine.prototype.loadTree = function(tree) {
|
|||
this.instantiateFromTree(tree);
|
||||
|
||||
this.reloadGraphics();
|
||||
this.initUniqueID();
|
||||
};
|
||||
|
||||
GitEngine.prototype.loadTreeFromString = function(treeString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue