diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2009-06-23 05:48:18 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2009-06-23 05:48:18 +0000 |
commit | f5a0b281610959910f8df75ae57b23d374f3730f (patch) | |
tree | 75363010d62c5ace503eddb22b2c6c48c947ea99 /lisp/vc-mtn.el | |
parent | b23bf85abc498269dd30ac0ecc305ed836c59c74 (diff) | |
download | emacs-f5a0b281610959910f8df75ae57b23d374f3730f.tar.gz |
(vc-mtn-after-dir-status, vc-mtn-dir-status): New functions.
Diffstat (limited to 'lisp/vc-mtn.el')
-rw-r--r-- | lisp/vc-mtn.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/vc-mtn.el b/lisp/vc-mtn.el index 6e9237ec38e..a6d1d99de81 100644 --- a/lisp/vc-mtn.el +++ b/lisp/vc-mtn.el @@ -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. |