X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=GitMonitor.vala;h=052b05f4dd04b98bb8e091f949a16659b5a6195f;hb=55d94ffcc22b705da1d4149afd5d4cfb453136ba;hp=17dedfc4b088556a3a554729748265f8d7e6f8ce;hpb=2501c49cbcd0cc3205b84bc1e33b08faf0e5b8ef;p=gitlive diff --git a/GitMonitor.vala b/GitMonitor.vala index 17dedfc4..052b05f4 100644 --- a/GitMonitor.vala +++ b/GitMonitor.vala @@ -1,5 +1,23 @@ +/** +The monitor suffers from various issues - basically event flows while it's running... +normall operations + +- monitors for file changes + -- adds to QUEUE when occurs. + +- queue runs in background. + - if it's got stuff in it.. + - COMMIT (normally) + - now?? - if on master - try and branch + == do user selection, until we have branched + == then start monitoring again.. + + + + +*/ @@ -111,6 +129,12 @@ public class GitMonitor : Monitor } + public void restoreQueue( Gee.ArrayList queue) + { + //used to restore teh queue after switch branches?/ - breaks our privte queue idea.. + this.queue = queue; + } + /* public new void resume () { this.paused = false; @@ -227,7 +251,10 @@ public class GitMonitor : Monitor foreach(var q in this.queue) { if (!q.shouldIgnore() && !q.repo.is_wip_branch()) { - NewBranch.singleton().show(q.repo); + var oldq = this.queue; + this.queue = new Gee.ArrayList(); + NewBranch.singleton().show(q.repo, oldq); + return; } @@ -568,11 +595,6 @@ public class GitMonitor : Monitor cmd.action = "commit"; cmd.message = cmd.vname; this.queue.add(cmd); - - - if (!cmd.shouldIgnore() && !cmd.repo.is_wip_branch()) { - NewBranch.singleton().show(cmd.repo); - } } @@ -599,11 +621,6 @@ public class GitMonitor : Monitor cmd.commit_all = true; this.queue.add(cmd); - - if (!cmd.shouldIgnore() && !cmd.repo.is_wip_branch()) { - NewBranch.singleton().show(cmd.repo); - } - } public override void onCreated(MonitorNamePathDir src) { @@ -660,10 +677,6 @@ public class GitMonitor : Monitor cmd.action = "commit"; cmd.message = "Attribute changed " + cmd.vname; this.queue.add(cmd); - - if (!cmd.shouldIgnore() && !cmd.repo.is_wip_branch()) { - NewBranch.singleton().show(cmd.repo); - } } public override void onMoved(MonitorNamePathDir src,MonitorNamePathDir dest) @@ -696,12 +709,9 @@ public class GitMonitor : Monitor if (cmd_d.shouldIgnore()) { this.onDeleted(src); - - return; } - - + GLib.debug("RM: %s", cmd_s.vname); cmd_s.action = "rm"; this.queue.add(cmd_s); @@ -720,17 +730,9 @@ public class GitMonitor : Monitor cmd.message = cmd_d.vname; } - this.queue.add(cmd); - if (!cmd.shouldIgnore() && !cmd.repo.is_wip_branch()) { - NewBranch.singleton().show(cmd.repo); - } - // this is where it get's complicated... - // as we might be moving across repo's... - - - + }