Mercurial > emacs
changeset 103542:01b5e53f519a
(vc-mtn-after-dir-status, vc-mtn-dir-status): New functions.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Tue, 23 Jun 2009 05:48:18 +0000 |
parents | 1a80fde577a8 |
children | 11b57e1bdb96 |
files | lisp/ChangeLog lisp/vc-mtn.el |
diffstat | 2 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue Jun 23 05:47:46 2009 +0000 +++ b/lisp/ChangeLog Tue Jun 23 05:48:18 2009 +0000 @@ -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
--- a/lisp/vc-mtn.el Tue Jun 23 05:47:46 2009 +0000 +++ b/lisp/vc-mtn.el Tue Jun 23 05:48:18 2009 +0000 @@ -106,6 +106,21 @@ ((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.