X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=GitBranch.vala;h=0a0a63c749f9eb531520e6493cc692c305daf259;hp=f7514e52ee42be83e1e42eca07c0a607a773a640;hb=0b86050bdbbbd2985f7078ca9036be0196455398;hpb=17864c5c2aadc4b826797a93e96ca26d5c9e1ebe diff --git a/GitBranch.vala b/GitBranch.vala index f7514e52..0a0a63c7 100644 --- a/GitBranch.vala +++ b/GitBranch.vala @@ -1,5 +1,27 @@ /** represent a git branch.. +Branching / Gitlive: + +Does repo require branching? - flag in config? +** list of repo's ?? with ability to turn on/off + +Start editing without branch? +-> show prompt to start branch +-> flag a ticket? optional ?? + +Once editing branch... +-> merge with squash / ticket... +** show list of repo's with 'working' branches? +** select some/all to merge with a issue fix.. + +?? closing ticket in system ?? +-> done by the ui? + +need to push all? / fetch all? + + +list of repo's + */ @@ -8,26 +30,46 @@ public class GitBranch : Object public GitRepo repo; public bool active = false; - public string lastrev; - public string name; - public string remote: - public string remoterev; + public string lastrev = ""; + public string name = ""; + public string remote = ""; + public string remoterev = ""; public GitBranch(GitRepo repo) { this.repo = repo; } - public bool parseBranchListItem(str) + public bool parseBranchListItem(string str) { - if (!str.length) { + if (str.length < 1) { return false; } - if ( + this.active = str[0] == '*'; - var bits = Regex.split_simple ("[ \t]+", str); - + var parts = Regex.split_simple ("[ \t]+", str.substring(2).strip()); + if (parts[1] == "->") { // it's an alias.. eg. remotes/origin/HEAD -> origin/master.. + return false; + } + this.lastrev = parts[1]; + if (parts[0].has_prefix("remotes/")) { + this.remote = parts[0]; + } else { + this.name = parts[0]; + } + return true; + } + public string realName() + { + return this.name == "" ? this.remote : this.name; + } + + public void create() + { + + } +} - } \ No newline at end of file + \ No newline at end of file