Mercurial > emacs
diff lisp/vc-hg.el @ 87599:efe45ef69877
* vc.el (vc-status-fileinfo): New defstruct.
(vc-status): New defvar
(vc-status-insert-headers, vc-status-printer, vc-status)
(vc-status-mode-map, vc-status-mode, vc-status-mark-file)
(vc-status-unmark-file, vc-status-marked-files): New functions.
* vc-hg.el (vc-hg-dir-status): New function.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sun, 06 Jan 2008 10:20:26 +0000 |
parents | 21fcd219fd6e |
children | 26665fb0f604 |
line wrap: on
line diff
--- a/lisp/vc-hg.el Sun Jan 06 09:49:16 2008 +0000 +++ b/lisp/vc-hg.el Sun Jan 06 10:20:26 2008 +0000 @@ -477,6 +477,36 @@ (define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming") + +;; XXX Experimental function for the vc-dired replacement. +(defun vc-hg-dir-status (dir) + "Return a list of conses (file . state) for DIR." + (with-temp-buffer + (vc-hg-command (current-buffer) nil nil "status" "-A") + (goto-char (point-min)) + (let ((status-char nil) + (file nil) + (translation '((?= . up-to-date) + (?C . up-to-date) + (?A . added) + (?R . removed) + (?M . edited) + (?I . ignored) + (?! . deleted) + (?? . unregistered))) + (translated nil) + (result nil)) + (while (not (eobp)) + (setq status-char (char-after)) + (setq file + (buffer-substring-no-properties (+ (point) 2) + (line-end-position))) + (setq translated (assoc status-char translation)) + (when (and translated (not (eq (cdr translated) 'up-to-date))) + (push (cons file (cdr translated)) result)) + (forward-line)) + result))) + ;; XXX this adds another top level menu, instead figure out how to ;; replace the Log-View menu. (easy-menu-define log-view-mode-menu vc-hg-outgoing-mode-map