Uncommited changes synced
authorAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 03:58:37 +0000 (11:58 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 03:58:37 +0000 (11:58 +0800)
Clones.bjs
Clones.vala
GitBranch.vala

index 75f1f87..9cebc87 100644 (file)
@@ -13,7 +13,7 @@
     "response" : "(self, response_id) =>  { \n \n        this.el.hide();\n  \n}"
    },
    "boolean deletable" : true,
-   "| void loadAndShow" : "() {\n\tthis.el.set_deletable(true);\n    this.el.set_gravity(Gdk.Gravity.NORTH);\n    this.el.move((Gdk.Screen.width() / 2 ) - (int.min(1280,Gdk.Screen.width()) / 2) ,0);\n     this.el.set_keep_above(true);\n    this.el.set_default_size(\n\t\t\tint.min(1280,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.height() - 200)\n\t);\n\tthis.el.show_all();\n\t\n\tthis.toolbar.el.hide();\n\tthis.scrolled.el.hide();\n\tthis.spinner.el.show();\n\tthis.spinner.el.start();\t\n\t\n\tGitRepo.updateAll(\"show_clones\");\n\t\n     \n \n\t\n\t\n}\n\n",
+   "| void loadAndShow" : "() {\n\tthis.el.set_deletable(true);\n    this.el.set_gravity(Gdk.Gravity.NORTH);\n    this.el.move((Gdk.Screen.width() / 2 ) - (int.min(1280,Gdk.Screen.width()) / 2) ,0);\n     this.el.set_keep_above(true);\n    this.el.set_default_size(\n\t\t\tint.min(1280,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.height() - 200)\n\t);\n\tthis.el.show_all();\n\t\n\tthis.toolbar.el.hide();\n\tthis.scrolled.el.hide();\n\tthis.spinner.el.show();\n\tthis.spinner.el.start();\t\n\t\n\tGitRepo.updateAllAsync(\"show_clones\");\n\t\n     \n \n\t\n\t\n}\n\n",
    "default_width" : 1024,
    "| void show" : "()    {\nthis.el.set_deletable(true);\n    this.el.set_gravity(Gdk.Gravity.NORTH);\n    this.el.move((Gdk.Screen.width() / 2 ) - (int.max(1280,Gdk.Screen.width()) / 2) ,0);\n     this.el.set_keep_above(true);\n   this.el.set_default_size(\n\t\t\tint.max(1280,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.height() - 100)\n\t);\n    this.el.show_all();\n\tthis.spinner.el.stop();\n\tthis.spinner.el.hide();\t\n\tthis.toolbar.el.show();\n\tthis.scrolled.el.show();\t\n \n    \n     \n\n    this.reposStore.load();\n   \n    GLib.debug(\"show clones = run?\");\n    this.el.run();\n    // load clones..\n//     this.get('/reposStore').load();\n    \n    //this.get('/ok_button').el.set_sensitive(false);\n    \n    // block until we return.\n//    var run_ret = this.el.run();\n//    if (run_ret < 1 ) {\n//        return  \"DONE\";\n//    }\n//    print(\"RUN RETURN : \" + run_ret);\n//    return \"DONE\";\n    //print(JSON.stringify(this.get('bug').getValue()));\n   // return this.get('bug').getValue();\n    //this.success = c.success;\n}\n",
    "title" : "Manage Clones",
index 8e066fb..fba05f5 100644 (file)
@@ -85,7 +85,7 @@ public class Clones : Object
        this.spinner.el.show();
        this.spinner.el.start();        
        
-       GitRepo.updateAll("show_clones");
+       GitRepo.updateAllAsync("show_clones");
        
          
      
index e092430..e996492 100644 (file)
@@ -90,9 +90,15 @@ public class GitBranch : Object
                 
                var r = repo.repo.enumerate_branches(Ggit.BranchType.LOCAL);
                while (r.next()) {
+               
+
+               
                        var br = new GitBranch(repo);
                        var gbr = r.get() as Ggit.Branch;
-
+                       if (!gbr.is_branch()) {
+                               continue;
+                       }
+                       
                        br.active = gbr.is_head();
                        br.name = gbr.get_name();
                        br.lastrev = gbr.get_target().to_string();
@@ -143,7 +149,11 @@ public class GitBranch : Object
                                continue;
                        }
                        // not clear how to do this yet...
-                       repo.git(  { "branch" ,"--track" , rn,  "origin/" + rn} ); 
+                       try {
+                               repo.git(  { "branch" ,"--track" , rn,  "origin/" + rn} ); 
+                       } catch (Error e) {
+                               continue; // allow failure?
+                       }
                        var br = new GitBranch(repo);
                        br.name = rn;
                        br.lastrev = ""; // it's behind