+ // in theory we should check to see if other repo's have got the same branch and merge all them at the same time.
+ // also need to decide which branch we will merge into?
+ var ret = "";
+ if (action == "CLOSE" || action == "LEAVE") {
+
+ try {
+ var oldbranch = this.currentBranch.name;
+ this.setActiveTicket(null, "master");
+ string [] cmd = { "merge", "--squash", oldbranch };
+ this.git( cmd );
+ cmd = { "commit", "-a" , "-m", commit_message };
+ this.git( cmd );
+ this.push();
+ this.loadBranches(); // updates lastrev..
+
+ var notification = new Notify.Notification(
+ "Merged branch %s to master".printf(oldbranch),
+ "",
+ "dialog-information"
+
+ );
+
+ notification.set_timeout(5);
+ notification.show();
+
+ // close ticket..
+ return true;
+
+ } catch (Error e) {
+
+ GitMonitor.gitmonitor.pauseError(e.message);
+ return false;
+ }
+ // error~?? -- show the error dialog...
+ return false;
+ }
+ if (action == "MASTER") {
+ // merge master into ours..
+ try {
+ string[] cmd = { "merge", "master" };
+ this.git( cmd );
+ var notification = new Notify.Notification(
+ "Merged code from master to %s".printf(this.currentBranch.name),
+ "",
+ "dialog-information"
+
+ );
+ notification.set_timeout(5);
+ notification.show();
+
+ return true;
+ } catch (Error e) {
+ GitMonitor.gitmonitor.pauseError(e.message);
+ return false;
+ }
+ }
+ if (action == "EXIT") {
+ try {
+ var oldbranch = this.currentBranch.name;
+ this.setActiveTicket(null, "master");
+ this.loadBranches();
+ var notification = new Notify.Notification(
+ "Left branch %s".printf(oldbranch),
+ "",
+ "dialog-information"
+
+ );
+ notification.set_timeout(5);
+ notification.show();
+
+ return true;
+ } catch (Error e) {
+ GitMonitor.gitmonitor.pauseError(e.message);
+
+ return false;
+ }
+ // error~?? -- show the error dialog...
+
+ }
+ return false;
+ }
+
+ public void loadActiveTicket()
+ {
+ this.activeTicket = null;
+ if (!FileUtils.test(this.gitdir + "/.gitlive-active-ticket" , FileTest.EXISTS)) {
+ return;
+ }
+ string ticket_id;
+ FileUtils.get_contents(this.gitdir + "/.gitlive-active-ticket" , out ticket_id);
+ if (ticket_id.length < 1) {
+ return;
+ }
+ this.activeTicket = RooTicket.singleton().getById(ticket_id.strip());