]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-mtn-after-dir-status, vc-mtn-dir-status): New functions.
authorDan Nicolaescu <dann@ics.uci.edu>
Tue, 23 Jun 2009 05:48:18 +0000 (05:48 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Tue, 23 Jun 2009 05:48:18 +0000 (05:48 +0000)
lisp/ChangeLog
lisp/vc-mtn.el

index b0e637002196bd12d1ce5319192fd09e6a1597b0..363964439fd671484c17dfcf57cc019a4a4fdc3d 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-mtn.el (vc-mtn-after-dir-status, vc-mtn-dir-status): New functions.
+
 2009-06-23  Kenichi Handa  <handa@m17n.org>
 
        * language/korea-util.el (korean-key-bindings): Change the binding
index 6e9237ec38e49da9869c80b9d990ebacd47d914e..a6d1d99de81e2837b945ef99f8796e3ebd423f54 100644 (file)
@@ -106,6 +106,21 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
             ((match-end 2) 'added)
             (t 'up-to-date)))))
 
+(defun vc-mtn-after-dir-status (update-function)
+  (let (result)
+    (goto-char (point-min))
+    (re-search-forward "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)" nil t)
+    (while (re-search-forward
+           "^  \\(?:\\(patched  \\)\\|\\(added    \\)\\)\\(.*\\)$" nil t)
+      (cond  ((match-end 1) (push (list (match-string 3) 'edited) result))
+            ((match-end 2) (push (list (match-string 3) 'added) result))))
+    (funcall update-function result)))
+
+(defun vc-mtn-dir-status (dir update-function)
+  (vc-mtn-command (current-buffer) 'async dir "status")
+  (vc-exec-after
+   `(vc-mtn-after-dir-status (quote ,update-function))))
+
 (defun vc-mtn-working-revision (file)
   ;; If `mtn' fails or returns status>0, or if the search fails, just
   ;; return nil.