]> gitweb.factorcode.org Git - factor.git/commitdiff
git-tool: Preliminary support for auto-refresh via file system monitors
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Wed, 14 Jan 2009 08:20:24 +0000 (02:20 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Wed, 14 Jan 2009 08:20:24 +0000 (02:20 -0600)
extra/git-tool/git-tool.factor

index 454f63f325cb7fc0fc29e547e8840a6890b7f4b1..7fa79a5b0e1024ea0f115c2e6597cb72ecccce5f 100644 (file)
@@ -425,6 +425,21 @@ TUPLE: <git-status>
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
+! :: git-tool ( REPO -- )
+
+!   <pile> 1 >>fill
+
+!     "Repository: " REPO [ current-directory get ] with-directory append
+!     <label>
+!     add-gadget
+
+!     REPO git-status <pile> 1 >>fill tuck refresh-status-pile  add-gadget
+!     REPO            <pile> 1 >>fill tuck refresh-remotes-pile add-gadget
+
+!   "Git" open-window ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 :: git-tool ( REPO -- )
 
   <pile> 1 >>fill
@@ -433,11 +448,31 @@ TUPLE: <git-status>
     <label>
     add-gadget
 
-    REPO git-status <pile> 1 >>fill tuck refresh-status-pile  add-gadget
+    [let | STATUS [ REPO git-status ]
+           PILE   [ <pile> 1 >>fill ] |
+
+      [
+        [let | MONITOR [ REPO t <monitor> ] |
+          [
+
+            [ MONITOR next-change 2drop STATUS PILE refresh-status-pile t ]
+            loop
+          ]
+          in-thread
+        ]
+      ]
+      with-monitors
+           
+      STATUS PILE refresh-status-pile
+      
+      PILE add-gadget ]
+
+    ! REPO git-status <pile> 1 >>fill tuck refresh-status-pile  add-gadget
     REPO            <pile> 1 >>fill tuck refresh-remotes-pile add-gadget
 
   "Git" open-window ;
 
+
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 : factor-git-tool ( -- ) "resource:" git-tool ;