Uncommited changes synced
authorAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 06:27:43 +0000 (14:27 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 06:27:43 +0000 (14:27 +0800)
Clones.bjs
Clones.vala
Git.vala
GitBranch.vala
GitRepo.vala
NewBranch.bjs
NewBranch.vala
StatusIcon.vala

index 9cebc87..555a6b7 100644 (file)
@@ -73,8 +73,8 @@
           "cursor_changed" : "()  => {\n  // SEE SELECTION.CHANGED\n  /*\n  \n  return;\n  \n    if (this.el.get_selection().count_selected_rows() < 1) {\n        //nothing? - clea it?\n        return;\n    }\n        var ret = {};         \n    var model = this.get('/changedFilesStore');\n\n     var s = this.el.get_selection();\n     var files = [];\n    s.selected_foreach(function(model,p,iter) {\n    \n       files.push( model.get_value(iter, 0).value.get_string());\n     \n    });\n    this.get('/patchview').showDiff(files); \n    //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();\n     //print(\"OUT?\" + value);// id..\n    // load the list in the right grid..\n     \n    return true;\n*/\n}"
          },
          "id" : "reposView",
           "cursor_changed" : "()  => {\n  // SEE SELECTION.CHANGED\n  /*\n  \n  return;\n  \n    if (this.el.get_selection().count_selected_rows() < 1) {\n        //nothing? - clea it?\n        return;\n    }\n        var ret = {};         \n    var model = this.get('/changedFilesStore');\n\n     var s = this.el.get_selection();\n     var files = [];\n    s.selected_foreach(function(model,p,iter) {\n    \n       files.push( model.get_value(iter, 0).value.get_string());\n     \n    });\n    this.get('/patchview').showDiff(files); \n    //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();\n     //print(\"OUT?\" + value);// id..\n    // load the list in the right grid..\n     \n    return true;\n*/\n}"
          },
          "id" : "reposView",
-         "bool activate_on_single_click" : true,
          "* init" : " \n{\n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n    var description = new Pango.FontDescription();\n    description.set_size(10000);\n    this.el.override_font(description);\n \n}\n",
          "* init" : " \n{\n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n    var description = new Pango.FontDescription();\n    description.set_size(10000);\n    this.el.override_font(description);\n \n}\n",
+         "bool activate_on_single_click" : true,
          "xtype" : "TreeView",
          "* pack" : "add",
          "int search_column" : 0,
          "xtype" : "TreeView",
          "* pack" : "add",
          "int search_column" : 0,
@@ -88,7 +88,7 @@
            "$ pathToRepo" : "function(path) {\n\n    var tr= this.repos;\n\n    \n    for(var i =0 ; i < tr.length; i++) {\n        if (tr[i].repopath == path) {\n            return tr[i];\n        }\n    } \n    return false; \n}\n",
            "xtype" : "ListStore",
            "* pack" : "set_model",
            "$ pathToRepo" : "function(path) {\n\n    var tr= this.repos;\n\n    \n    for(var i =0 ; i < tr.length; i++) {\n        if (tr[i].repopath == path) {\n            return tr[i];\n        }\n    } \n    return false; \n}\n",
            "xtype" : "ListStore",
            "* pack" : "set_model",
-           "| void load" : "()\n{\n    //this.insert(citer,iter,0);\n    print(\"getting list\");\n    var tr = GitRepo.list();\n    \n    this.el.clear();\n    \n    // fixme .. sort by last updated ...\n    \n    \n    for(var i =0 ; i < tr.length; i++) {\n\t    var repo = tr.index(i);\n\t    // this is done before we display stuff...\n\t    //repo.loadBranches();\n\t    //repo.loadStatus();\n\t    \n\t    Gtk.TreeIter iter;\n\t    this.el.append(out iter);\n     \n        //print(JSON.stringify(ret,null,4));\n         //tr[i].getBranches();\n         //tr[i].getStatus();\n         //var hi;\n         //try {\n             //tr[i].debug=1;\n         //     hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name );\n//             print(JSON.stringify(hi,null,4));\n        // } catch(e) { print(e);}\n          \n        this.el.set_value(iter, 0,   repo.name );\n        this.el.set_value( iter, 1, repo.currentBranch.name   );\n        this.el.set_value( iter, 2,  repo.branchesToString()   );\n//        this.el.set_value(ret.iter, 2, '' + repo.branches.map(\n//                        function(e) { return e.name; \n//                    }).join(', ') \n //        );\n//        this.el.set_value(iter, 3, '' +  (!hi  ? '??' : hi[0].changed_raw));        \n        this.el.set_value(iter, 4, repo.is_autocommit() );                \n        this.el.set_value(iter, 5, repo.is_autopush() );                        \n        this.el.set_value(iter, 6,  repo.git_working_dir );  \n        // highlight color.\n        var cb = repo.currentBranch;\n        //print(JSON.stringify(cb,null,4));\n        var col = \"#ffffff\";\n        \n        if (cb.lastrev != cb.remoterev) {\n            col =  \"#f2dede\";\n            this.el.set_value( iter, 1, repo.currentBranch.name +\"\\n\" +\n            \t(repo.ahead_or_behind == \"B\" ? \"Local is BEHIND remote\" : \"Local is AHEAD of remote\")\n            \n               );\n        }\n        if (repo.has_local_changes) {\n            col =  \"#d9edf7\";\n            this.el.set_value( iter, 1, repo.currentBranch.name +\"\\nHas uncommitted changes\"   );\n        }\n        if  ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {\n            col =  \"#fcf8e3\";\n            this.el.set_value( iter, 1, repo.currentBranch.name +\"\\n\" + \n            (repo.ahead_or_behind == \"B\" ? \"Local is BEHIND remote\" : \"Local is AHEAD of remote\") +\n            \"\\nHas uncommitted changes\"   );            \n        }\n        \n        this.el.set_value(iter, 7, col  );      \n        var ticket = repo.activeTicket;\n        \n        this.el.set_value(iter, 8, repo.is_auto_branch()  );      \n        this.el.set_value(iter, 9, ticket == null ? \"\" : ticket.id  );      \n        \n        \n    }     \n    this.el.set_sort_column_id (0, Gtk.SortType.ASCENDING);\n} ",
+           "| void load" : "()\n{\n    //this.insert(citer,iter,0);\n    print(\"getting list\");\n    var tr = GitRepo.list();\n    \n    this.el.clear();\n    \n    // fixme .. sort by last updated ...\n    \n    \n    for(var i =0 ; i < tr.length; i++) {\n\t    var repo = tr.index(i);\n\t    // this is done before we display stuff...\n\t    //repo.loadBranches();\n\t    //repo.loadStatus();\n\t    \n\t    Gtk.TreeIter iter;\n\t    this.el.append(out iter);\n     \n        //print(JSON.stringify(ret,null,4));\n         //tr[i].getBranches();\n         //tr[i].getStatus();\n         //var hi;\n         //try {\n             //tr[i].debug=1;\n         //     hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name );\n//             print(JSON.stringify(hi,null,4));\n        // } catch(e) { print(e);}\n          \n        this.el.set_value(iter, 0,   repo.name );\n        this.el.set_value( iter, 1, repo.getCurrentBranch().name   );\n        this.el.set_value( iter, 2,  repo.branchesToString()   );\n//        this.el.set_value(ret.iter, 2, '' + repo.branches.map(\n//                        function(e) { return e.name; \n//                    }).join(', ') \n //        );\n//        this.el.set_value(iter, 3, '' +  (!hi  ? '??' : hi[0].changed_raw));        \n        this.el.set_value(iter, 4, repo.is_autocommit() );                \n        this.el.set_value(iter, 5, repo.is_autopush() );                        \n        this.el.set_value(iter, 6,  repo.git_working_dir );  \n        // highlight color.\n        var cb = repo.getCurrentBranch();\n        //print(JSON.stringify(cb,null,4));\n        var col = \"#ffffff\";\n        \n        if (cb.lastrev != cb.remoterev) {\n            col =  \"#f2dede\";\n            this.el.set_value( iter, 1, repo.getCurrentBranch().name +\"\\n\" +\n            \t(repo.ahead_or_behind == \"B\" ? \"Local is BEHIND remote\" : \"Local is AHEAD of remote\")\n            \n               );\n        }\n        if (repo.has_local_changes) {\n            col =  \"#d9edf7\";\n            this.el.set_value( iter, 1, repo.getCurrentBranch().name +\"\\nHas uncommitted changes\"   );\n        }\n        if  ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {\n            col =  \"#fcf8e3\";\n            this.el.set_value( iter, 1, repo.getCurrentBranch().name +\"\\n\" + \n            (repo.ahead_or_behind == \"B\" ? \"Local is BEHIND remote\" : \"Local is AHEAD of remote\") +\n            \"\\nHas uncommitted changes\"   );            \n        }\n        \n        this.el.set_value(iter, 7, col  );      \n        var ticket = repo.activeTicket;\n        \n        this.el.set_value(iter, 8, repo.is_auto_branch()  );      \n        this.el.set_value(iter, 9, ticket == null ? \"\" : ticket.id  );      \n        \n        \n    }     \n    this.el.set_sort_column_id (0, Gtk.SortType.ASCENDING);\n} ",
            "$ xns" : "Gtk"
           },
           {
            "$ xns" : "Gtk"
           },
           {
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 4, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 4, !bval);\n  \tGLib.debug(\"got repopath? %s\", repopath);\n  \t\n  \tvar repo = GitRepo.get_sync(repopath);\n  \trepo.set_autocommit(!bval);\n  \t \n  \n}"
              },
              "id" : "cr_autocommit",
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 4, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 4, !bval);\n  \tGLib.debug(\"got repopath? %s\", repopath);\n  \t\n  \tvar repo = GitRepo.get_sync(repopath);\n  \trepo.set_autocommit(!bval);\n  \t \n  \n}"
              },
              "id" : "cr_autocommit",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererToggle",
              "xtype" : "CellRendererToggle",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 5, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 5, !bval);\n  \tvar repo = GitRepo.get_sync(repopath);\n  \trepo.set_autopush(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autopush",
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 5, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 5, !bval);\n  \tvar repo = GitRepo.get_sync(repopath);\n  \trepo.set_autopush(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autopush",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererToggle",
              "xtype" : "CellRendererToggle",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 8, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 8, !bval);\n  \tvar repo = GitRepo.get_sync(repopath);\n  \trepo.set_auto_branch(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autobranch",
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 8, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 8, !bval);\n  \tvar repo = GitRepo.get_sync(repopath);\n  \trepo.set_auto_branch(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autobranch",
-             "xtype" : "CellRendererToggle",
              "* pack" : "pack_start,false",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererToggle",
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
           },
           {
            "id" : "tv_repo",
           },
           {
            "id" : "tv_repo",
-           "* init" : "\n    this.el.add_attribute(_this.cr_repo.el , \"markup\", 0 );\n",
            "Gtk.SortType sort_order" : "Gtk.SortType.ASCENDING",
            "Gtk.SortType sort_order" : "Gtk.SortType.ASCENDING",
+           "* init" : "\n    this.el.add_attribute(_this.cr_repo.el , \"markup\", 0 );\n",
            "title" : "Repo",
            "* pack" : "append_column",
            "xtype" : "TreeViewColumn",
            "title" : "Repo",
            "* pack" : "append_column",
            "xtype" : "TreeViewColumn",
            "items" : [
             {
              "id" : "cr_repo",
            "items" : [
             {
              "id" : "cr_repo",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererText",
              "xtype" : "CellRendererText",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk"
             }
            ]
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_active_ticket",
            "items" : [
             {
              "id" : "cr_active_ticket",
-             "xtype" : "CellRendererText",
              "* pack" : "pack_start,false",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererText",
              "$ xns" : "Gtk"
             }
            ]
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_current_branch",
            "items" : [
             {
              "id" : "cr_current_branch",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererText",
              "xtype" : "CellRendererText",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk"
             }
            ]
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_last_updated",
            "items" : [
             {
              "id" : "cr_last_updated",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererText",
              "xtype" : "CellRendererText",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk"
             }
            ]
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_all_branches",
            "items" : [
             {
              "id" : "cr_all_branches",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererText",
              "xtype" : "CellRendererText",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk"
             }
            ]
              "$ xns" : "Gtk"
             }
            ]
index fba05f5..d4c267b 100644 (file)
@@ -464,7 +464,7 @@ public class Clones : Object
                 // } catch(e) { print(e);}
                   
                 this.el.set_value(iter, 0,   repo.name );
                 // } catch(e) { print(e);}
                   
                 this.el.set_value(iter, 0,   repo.name );
-                this.el.set_value( iter, 1, repo.currentBranch.name   );
+                this.el.set_value( iter, 1, repo.getCurrentBranch().name   );
                 this.el.set_value( iter, 2,  repo.branchesToString()   );
         //        this.el.set_value(ret.iter, 2, '' + repo.branches.map(
         //                        function(e) { return e.name; 
                 this.el.set_value( iter, 2,  repo.branchesToString()   );
         //        this.el.set_value(ret.iter, 2, '' + repo.branches.map(
         //                        function(e) { return e.name; 
@@ -475,24 +475,24 @@ public class Clones : Object
                 this.el.set_value(iter, 5, repo.is_autopush() );                        
                 this.el.set_value(iter, 6,  repo.git_working_dir );  
                 // highlight color.
                 this.el.set_value(iter, 5, repo.is_autopush() );                        
                 this.el.set_value(iter, 6,  repo.git_working_dir );  
                 // highlight color.
-                var cb = repo.currentBranch;
+                var cb = repo.getCurrentBranch();
                 //print(JSON.stringify(cb,null,4));
                 var col = "#ffffff";
                 
                 if (cb.lastrev != cb.remoterev) {
                     col =  "#f2dede";
                 //print(JSON.stringify(cb,null,4));
                 var col = "#ffffff";
                 
                 if (cb.lastrev != cb.remoterev) {
                     col =  "#f2dede";
-                    this.el.set_value( iter, 1, repo.currentBranch.name +"\n" +
+                    this.el.set_value( iter, 1, repo.getCurrentBranch().name +"\n" +
                        (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote")
                     
                        );
                 }
                 if (repo.has_local_changes) {
                     col =  "#d9edf7";
                        (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote")
                     
                        );
                 }
                 if (repo.has_local_changes) {
                     col =  "#d9edf7";
-                    this.el.set_value( iter, 1, repo.currentBranch.name +"\nHas uncommitted changes"   );
+                    this.el.set_value( iter, 1, repo.getCurrentBranch().name +"\nHas uncommitted changes"   );
                 }
                 if  ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {
                     col =  "#fcf8e3";
                 }
                 if  ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {
                     col =  "#fcf8e3";
-                    this.el.set_value( iter, 1, repo.currentBranch.name +"\n" + 
+                    this.el.set_value( iter, 1, repo.getCurrentBranch().name +"\n" + 
                     (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote") +
                     "\nHas uncommitted changes"   );            
                 }
                     (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote") +
                     "\nHas uncommitted changes"   );            
                 }
index f892346..63c03c7 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -16,8 +16,9 @@ void main()
             }
          ); 
 
             }
          ); 
 
+       
        Ggit.init();
        Ggit.init();
-       var a = new GitLive.Repo("/home/alan/gitlive/web.coba");
+       var a = new GitLive.Repo("/home/alan/gitlive/web.Texon");
        a.fetchAll();
        return;
        /*
        a.fetchAll();
        return;
        /*
index e996492..c08721b 100644 (file)
@@ -117,15 +117,22 @@ public class GitBranch : Object
                                        br.remoterev = remotes.get(rname).to_string();
                                        remotes_used.set(rname,true);
                                        size_t ahead, behind;
                                        br.remoterev = remotes.get(rname).to_string();
                                        remotes_used.set(rname,true);
                                        size_t ahead, behind;
-                                       repo.repo.get_ahead_behind(
-                                               gbr.get_target(),
-                                               remotes.get(rname),
-                                               out ahead,
-                                               out behind
-                                       );
-                                       br.ahead = (int)ahead;
-                                       br.behind = (int) behind;
+                                       br.behind = 1;
+                                       
+                                       try {
+                                               repo.repo.get_ahead_behind(
+                                                       gbr.get_target(),
+                                                       remotes.get(rname),
+                                                       out ahead,
+                                                       out behind
+                                               );
+                                               br.ahead = (int)ahead;
+                                               br.behind = (int) behind;
 
 
+                                       } catch(Error e) {
+                                               GLib.debug("we probably need to fetch... %s", repo.name);
+                                       }
+                                       
                                }
                                 
                                
                                }
                                 
                                
@@ -134,7 +141,7 @@ public class GitBranch : Object
                        }
                        if (br.active) {
                                GLib.debug("repo: %s currentBranch = %s", repo.name, br.name);
                        }
                        if (br.active) {
                                GLib.debug("repo: %s currentBranch = %s", repo.name, br.name);
-                               repo.currentBranch = br;
+                               repo._currentBranch = br;
                        }
                        
                }
                        }
                        
                }
@@ -165,7 +172,8 @@ public class GitBranch : Object
                        repo.branches.set(rn, br);
                        
                }
                        repo.branches.set(rn, br);
                        
                }
-               if (repo.currentBranch == null) {
+
+               if (repo._currentBranch == null) {
                        GLib.error("could not find active Branch for %s", repo.name);
                }
                
                        GLib.error("could not find active Branch for %s", repo.name);
                }
                
index 21cf4de..73866d7 100644 (file)
@@ -26,7 +26,17 @@ public class GitRepo : Object
     
     public Gee.HashMap<string,bool> ignore_files;
      
     
     public Gee.HashMap<string,bool> ignore_files;
      
-    public GitBranch  currentBranch;
+    public GitBranch  _currentBranch;
+    public GitBranch  getCurrentBranch() {
+       if (this._currentBranch == null) {
+               this.loadBranches();
+       }
+       if (this._currentBranch == null) {      
+               GLib.error("could not work out current branch?");
+               }
+               return this._currentBranch;
+    }
+    
     
     public Gee.HashMap<string,GitBranch> branches; // accessed in GitBranch..
        public RooTicket? activeTicket;
     
     public Gee.HashMap<string,GitBranch> branches; // accessed in GitBranch..
        public RooTicket? activeTicket;
@@ -222,7 +232,7 @@ public class GitRepo : Object
     public bool is_master_branch()
     {
        // special branches that do not allow autopushing now...
     public bool is_master_branch()
     {
        // special branches that do not allow autopushing now...
-       return this.currentBranch.name == "master" || this.currentBranch.name == "roojs";
+       return this.getCurrentBranch().name == "master" || this.getCurrentBranch().name == "roojs";
                
     }
     public void init_config()
                
     }
     public void init_config()
@@ -382,7 +392,7 @@ public class GitRepo : Object
                                continue;
                        }
                        commitrevs += commitrevs.length > 0 ? " " : "";
                                continue;
                        }
                        commitrevs += commitrevs.length > 0 ? " " : "";
-                       commitrevs += repo.currentBranch.lastrev;
+                       commitrevs += repo.getCurrentBranch().lastrev;
                }
        }
        if (sucess && action == "CLOSE") {
                }
        }
        if (sucess && action == "CLOSE") {
@@ -402,7 +412,7 @@ public class GitRepo : Object
                   if (action == "CLOSE" || action == "LEAVE") {
                                   
                try {
                   if (action == "CLOSE" || action == "LEAVE") {
                                   
                try {
-                   var oldbranch = this.currentBranch.name;
+                   var oldbranch = this.getCurrentBranch().name;
                    this.setActiveTicket(null, master);
                           string [] cmd = { "merge",   "--squash",  oldbranch };
                           this.git( cmd );
                    this.setActiveTicket(null, master);
                           string [] cmd = { "merge",   "--squash",  oldbranch };
                           this.git( cmd );
@@ -438,7 +448,7 @@ public class GitRepo : Object
                        string[] cmd = { "merge", master};
                        this.git( cmd );
                        var notification = new Notify.Notification(
                        string[] cmd = { "merge", master};
                        this.git( cmd );
                        var notification = new Notify.Notification(
-                                       "Merged code from %s to %s".printf(master,this.currentBranch.name),
+                                       "Merged code from %s to %s".printf(master,this.getCurrentBranch().name),
                                        "",
                                         "dialog-information"
                                        
                                        "",
                                         "dialog-information"
                                        
@@ -454,7 +464,7 @@ public class GitRepo : Object
            }
        if (action == "EXIT") {
                        try {
            }
        if (action == "EXIT") {
                        try {
-                       var oldbranch  = this.currentBranch.name;
+                       var oldbranch  = this.getCurrentBranch().name;
                          this.setActiveTicket(null, master);
                        this.loadBranches();
                        var notification = new Notify.Notification(
                          this.setActiveTicket(null, master);
                        this.loadBranches();
                        var notification = new Notify.Notification(
index 1fc586a..57698fd 100644 (file)
@@ -28,6 +28,7 @@
      "listeners" : {
       "switch_page" : "(page, page_num) => {\n\tGLib.debug(\"Switch to page: %d\", (int)page_num);\n\tswitch(page_num) {\n\t\tcase 0: \n\t\t\tbreak; // do nothing.. it's already loaded at start.\n\t\tcase 1: \n\t\t\t_this.create_ticket_tab.load_data();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t_this.quick_commit_tab.load_data();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}\n"
      },
      "listeners" : {
       "switch_page" : "(page, page_num) => {\n\tGLib.debug(\"Switch to page: %d\", (int)page_num);\n\tswitch(page_num) {\n\t\tcase 0: \n\t\t\tbreak; // do nothing.. it's already loaded at start.\n\t\tcase 1: \n\t\t\t_this.create_ticket_tab.load_data();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t_this.quick_commit_tab.load_data();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}\n"
      },
+     "id" : "notebook",
      "* pack" : "get_content_area().add",
      "xtype" : "Notebook",
      "$ xns" : "Gtk",
      "* pack" : "get_content_area().add",
      "xtype" : "Notebook",
      "$ xns" : "Gtk",
index 9f4ac04..dd5200e 100644 (file)
@@ -12,6 +12,7 @@ public class NewBranch : Object
         }
         return _NewBranch;
     }
         }
         return _NewBranch;
     }
+    public Xcls_notebook notebook;
     public Xcls_label_select_ticket label_select_ticket;
     public Xcls_label_create_ticket label_create_ticket;
     public Xcls_label_quick_commit label_quick_commit;
     public Xcls_label_select_ticket label_select_ticket;
     public Xcls_label_create_ticket label_create_ticket;
     public Xcls_label_quick_commit label_quick_commit;
@@ -73,7 +74,7 @@ public class NewBranch : Object
         this.el.default_width = 500;
         this.el.deletable = true;
         this.el.modal = true;
         this.el.default_width = 500;
         this.el.deletable = true;
         this.el.modal = true;
-        var child_0 = new Xcls_Notebook2( _this );
+        var child_0 = new Xcls_notebook( _this );
         child_0.ref();
         this.el.get_content_area().add (  child_0.el  );
 
         child_0.ref();
         this.el.get_content_area().add (  child_0.el  );
 
@@ -172,7 +173,7 @@ public class NewBranch : Object
        this.el.run();
     
     }
        this.el.run();
     
     }
-    public class Xcls_Notebook2 : Object
+    public class Xcls_notebook : Object
     {
         public Gtk.Notebook el;
         private NewBranch  _this;
     {
         public Gtk.Notebook el;
         private NewBranch  _this;
@@ -181,9 +182,10 @@ public class NewBranch : Object
             // my vars (def)
 
         // ctor
             // my vars (def)
 
         // ctor
-        public Xcls_Notebook2(NewBranch _owner )
+        public Xcls_notebook(NewBranch _owner )
         {
             _this = _owner;
         {
             _this = _owner;
+            _this.notebook = this;
             this.el = new Gtk.Notebook();
 
             // my vars (dec)
             this.el = new Gtk.Notebook();
 
             // my vars (dec)
index 4363d8d..7a2500a 100644 (file)
@@ -195,7 +195,7 @@ public class StatusIconA : StatusIcon {
                        this.remove(m);
                }
                foreach(var r in GitRepo.singleton().cache.values ) {
                        this.remove(m);
                }
                foreach(var r in GitRepo.singleton().cache.values ) {
-                       GLib.debug("checking %s for branch = %s", r.name, r.currentBranch.name);
+                       GLib.debug("checking %s for branch = %s", r.name, r.getCurrentBranch().name);
                        if (r.is_master_branch()) {
                                continue;
                                }
                        if (r.is_master_branch()) {
                                continue;
                                }