}
return string.joinv("\n",ret);
}
-
+ public static string queueArrayToString(Array<GitMonitorQueue> list) {
+ var ret = "";
+ for(var i =0; i < list.length; i++) {
+
+ ret += (ret.length > 0 ? ", " : "") + list.index(i).vname;
+ }
+ return ret;
+
+ }
+
+ public static bool queueHas(Array<GitMonitorQueue> list , GitMonitorQueue cmd_s, string action) {
+ for(var i =0; i < list.length; i++) {
+ var test = list.index(i);
+ if (list.index(i).gitpath != cmd_s.gitpath) {
+ continue;
+ }
+ if (list.index(i).vname != cmd_s.vname) {
+ continue;
+ }
+ if (list.index(i).action != action) {
+ continue;
+ }
+ return true;
+ }
+ return false;
+ }
+
}
break;
case "rm":
- if (GitMonitorQueue.indexOfAdd(add_files, cmd.vname) > -1 ) {
+ if (GitMonitorQueue.indexOfAdd(remove_files, cmd.vname) > -1 ) {
break;
}
break;
}
}
-
+ print( "ADD : %s\n", GitMonitorQueue.queueArrayToString(add_files));
+ print( "REMOVE FILES: %s\n", GitMonitorQueue.queueArrayToString(remove_files));
//repo.debug = 1;
// these can fail... at present... as we wildcard stuff.
add_files_f.append_val(add_files.index(ii));
};
- print("ADD : %u files\n" , add_files_f.length);
- print("REMOVE: %u files\n" , remove_files_f.length);
+ print( "ADD : %s\n", GitMonitorQueue.queueArrayToString(add_files_f));
+ print( "REMOVE FILES: %s\n", GitMonitorQueue.queueArrayToString(remove_files_f));
// make sure monitoring is paused so it does not recursively pick up
// -- DO STUFF..
try {
- repo.add(add_files);
+ repo.add(add_files_f);
} catch(Error e) {
failure += e.message;
}
return;
}
-
+
+
+ print("RM: %s\n", cmd_s.vname);
cmd_s.action = "rm";
this.queue.append_val(cmd_s);
-
-
+
+
+ print("ADD: %s\n", cmd_d.vname);
cmd_d.action = "add";
this.queue.append_val(cmd_d);
var cmd = new GitMonitorQueue(dest);
cmd.action = "commit";
cmd.message = "MOVED " + cmd_s.vname + " to " + cmd_d.vname;
+ if (GitMonitorQueue.queueHas(this.queue, cmd_s, "add")) {
+ cmd.message = cmd_d.vname;
+ }
+
this.queue.append_val(cmd);