X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=GitMonitor.vala;h=052b05f4dd04b98bb8e091f949a16659b5a6195f;hb=55d94ffcc22b705da1d4149afd5d4cfb453136ba;hp=2ba96852836a6b3be4c940d1bae7294060da3adf;hpb=03a18dbe03808a85cde3936fb5b477aa17b2cb9a;p=gitlive diff --git a/GitMonitor.vala b/GitMonitor.vala index 2ba96852..052b05f4 100644 --- a/GitMonitor.vala +++ b/GitMonitor.vala @@ -1,5 +1,26 @@ +/** + +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.. + + + + +*/ + + - public class GitMonitor : Monitor { @@ -108,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; @@ -221,6 +248,20 @@ public class GitMonitor : Monitor if (this.paused || this.queue.size < 1 ) { return; } + + foreach(var q in this.queue) { + if (!q.shouldIgnore() && !q.repo.is_wip_branch()) { + var oldq = this.queue; + this.queue = new Gee.ArrayList(); + NewBranch.singleton().show(q.repo, oldq); + + return; + } + + } + + + GLib.debug("GitMonitor.runQueue\n"); this.queueRunning = true; @@ -554,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); - } } @@ -585,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) { @@ -646,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) @@ -682,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); @@ -706,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... - - - + }