GitMonitor.js
[gitlive] / Branches.js
index baa612f..5e617c7 100644 (file)
@@ -46,7 +46,7 @@ Branches=new XObject({
             this.init();
         }
         var _this = this;
-        this.get('/branchList').load();
+        this.get('/branchStore').load();
         this.el.show_all();
         
         var run_ret = this.el.run();
@@ -73,7 +73,7 @@ Branches=new XObject({
                             listeners : {
                                 clicked : function (self) {
                                 
-                                        
+                                     return;
                                     var RemoteEdit=    imports.RemoteEdit.RemoteEdit
                                      RemoteEdit.repo = Remotes.repo;
                                     RemoteEdit.el.set_transient_for(Remotes.el);
@@ -89,7 +89,7 @@ Branches=new XObject({
                                     
                                 }
                             },
-                            label : "Add",
+                            label : "Pull",
                             pack : "add"
                         }
                     ]
@@ -132,7 +132,7 @@ Branches=new XObject({
                                 
                                 }
                             },
-                            id : "remotesView",
+                            id : "branchView",
                             pack : "add",
                             init : function() {
                                 XObject.prototype.init.call(this);
@@ -152,7 +152,7 @@ Branches=new XObject({
                             items : [
                                 {
                                     xtype: Gtk.ListStore,
-                                    id : "remotesStore",
+                                    id : "branchStore",
                                     pack : "set_model",
                                     init : function() {
                                         XObject.prototype.init.call(this);
@@ -167,7 +167,7 @@ Branches=new XObject({
                                         //this.insert(citer,iter,0);
                                         this.el.clear();
                                         
-                                        var tr = Remotes.repo.remotes();
+                                        var tr = Branches.repo.getBranches();
                                         
                                         
                                         for(var i =0 ; i < tr.length; i++) {
@@ -176,11 +176,20 @@ Branches=new XObject({
                                             this.el.append(ret);
                                             
                                             //print(JSON.stringify(ret,null,4));
-                                             
+                                            var lastrev = tr[i].lastrev;
+                                            var remoterev = tr[i].remoterev;
+                                            
+                                            var lastrev = lastrev.length ? lastrev : remoterev;
+                                            
+                                            if (lastrev != remoterev) {
+                                                lastrev = "Out of sync: remote=" + remoterev + ", local=" + lastrev;
+                                            }
+                                            
+                                     
                                               
                                             this.el.set_value(ret.iter, 0, ''  +  tr[i].name );
-                                            this.el.set_value(ret.iter, 1, '' + tr[i].url );
-                                           this.el.set_value(ret.iter, 2, '' + tr[i].type );
+                                            this.el.set_value(ret.iter, 1, '' + tr[i].remote );
+                                            this.el.set_value(ret.iter, 2, '' + lastrev );
                                      
                                             
                                         }     
@@ -191,7 +200,7 @@ Branches=new XObject({
                                     min_width : 70,
                                     pack : "append_column",
                                     resizable : true,
-                                    title : "Name",
+                                    title : "Local",
                                     init : function() {
                                         XObject.prototype.init.call(this);
                                         this.el.add_attribute(this.items[0].el , 'markup', 0 );
@@ -209,10 +218,10 @@ Branches=new XObject({
                                     min_width : 70,
                                     pack : "append_column",
                                     resizable : true,
-                                    title : "Type",
+                                    title : "Remote",
                                     init : function() {
                                         XObject.prototype.init.call(this);
-                                        this.el.add_attribute(this.items[0].el , 'markup', 2 );
+                                        this.el.add_attribute(this.items[0].el , 'markup', 1 );
                                     
                                     },
                                     items : [
@@ -226,10 +235,10 @@ Branches=new XObject({
                                     xtype: Gtk.TreeViewColumn,
                                     min_width : 200,
                                     pack : "append_column",
-                                    title : "URL",
+                                    title : "Status",
                                     init : function() {
                                         XObject.prototype.init.call(this);
-                                        this.el.add_attribute(this.items[0].el , 'markup', 1 );
+                                        this.el.add_attribute(this.items[0].el , 'markup', 2 );
                                     
                                     },
                                     items : [