if (this.queue.size < 1 || this.queueRunning) {
return true;
}
+ var first = this.queue.get(0);
+ var delay = true;
+
+ // eg. on master.... and is_auto branch
+ if (first.repo.is_master_branch() && first.repo.is_auto_branch()) {
+ delay = false;
+ }
+
var last = -1 * this.lastAdd.difference(new DateTime.now(new TimeZone.local()));
// stdout.printf("LAST RUN: %s (expect %s) \n" ,
// last.to_string(), (5 * TimeSpan.SECOND).to_string() );
- if (last < 5 * TimeSpan.SECOND) { // wait 5 seconds before running. ????
+ if (delay && last < 5 * TimeSpan.SECOND) { // wait 5 seconds before running. ????
return true;
}
//_this.lastAdd = new Date();
}
foreach(var q in this.queue) {
- if (!q.shouldIgnore() && !q.repo.is_wip_branch()) {
+ if (!q.shouldIgnore() && q.repo.is_master_branch() && q.repo.is_auto_branch()) {
var oldq = this.queue;
this.queue = new Gee.ArrayList<GitMonitorQueue>();
NewBranch.singleton().show(q.repo, oldq);
- GLib.debug("GitMonitor.runQueue\n");
+ GLib.debug("GitMonitor.runQueue size =%d\n", this.queue.size);
this.queueRunning = true;
var gitpath = cmd.gitpath;
var repo = GitRepo.get( gitpath );
- if ( !repo.is_wip_branch()) {
+ if ( repo.is_master_branch() && repo.is_auto_branch()) {
leave_queued.add(cmd);
continue;
}
cmd.action = "commit";
cmd.message = cmd.vname;
this.queue.add(cmd);
-
-
-
+
}
public override void onDeleted(MonitorNamePathDir src)
cmd.commit_all = true;
this.queue.add(cmd);
-
-
-
}
public override void onCreated(MonitorNamePathDir src) {
cmd.action = "commit";
cmd.message = "Attribute changed " + cmd.vname;
this.queue.add(cmd);
-
-
}
public override void onMoved(MonitorNamePathDir src,MonitorNamePathDir dest)
if (cmd_d.shouldIgnore()) {
this.onDeleted(src);
-
-
return;
}
-
-
+
GLib.debug("RM: %s", cmd_s.vname);
cmd_s.action = "rm";
this.queue.add(cmd_s);
cmd.message = cmd_d.vname;
}
-
this.queue.add(cmd);
-
- // this is where it get's complicated...
- // as we might be moving across repo's...
-
-
-
+
+
}