From f5a0b281610959910f8df75ae57b23d374f3730f Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 23 Jun 2009 05:48:18 +0000 Subject: [PATCH] (vc-mtn-after-dir-status, vc-mtn-dir-status): New functions. --- lisp/ChangeLog | 4 ++++ lisp/vc-mtn.el | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0e63700219..363964439fd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2009-06-22 Dan Nicolaescu + + * vc-mtn.el (vc-mtn-after-dir-status, vc-mtn-dir-status): New functions. + 2009-06-23 Kenichi Handa * language/korea-util.el (korean-key-bindings): Change the binding 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. -- 2.11.4.GIT