comparison 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
comparison
equal deleted inserted replaced
87598:46e7050d6d6e 87599:efe45ef69877
475 475
476 (define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing") 476 (define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing")
477 477
478 (define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming") 478 (define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming")
479 479
480
481 ;; XXX Experimental function for the vc-dired replacement.
482 (defun vc-hg-dir-status (dir)
483 "Return a list of conses (file . state) for DIR."
484 (with-temp-buffer
485 (vc-hg-command (current-buffer) nil nil "status" "-A")
486 (goto-char (point-min))
487 (let ((status-char nil)
488 (file nil)
489 (translation '((?= . up-to-date)
490 (?C . up-to-date)
491 (?A . added)
492 (?R . removed)
493 (?M . edited)
494 (?I . ignored)
495 (?! . deleted)
496 (?? . unregistered)))
497 (translated nil)
498 (result nil))
499 (while (not (eobp))
500 (setq status-char (char-after))
501 (setq file
502 (buffer-substring-no-properties (+ (point) 2)
503 (line-end-position)))
504 (setq translated (assoc status-char translation))
505 (when (and translated (not (eq (cdr translated) 'up-to-date)))
506 (push (cons file (cdr translated)) result))
507 (forward-line))
508 result)))
509
480 ;; XXX this adds another top level menu, instead figure out how to 510 ;; XXX this adds another top level menu, instead figure out how to
481 ;; replace the Log-View menu. 511 ;; replace the Log-View menu.
482 (easy-menu-define log-view-mode-menu vc-hg-outgoing-mode-map 512 (easy-menu-define log-view-mode-menu vc-hg-outgoing-mode-map
483 "Hg-outgoing Display Menu" 513 "Hg-outgoing Display Menu"
484 `("Hg-outgoing" 514 `("Hg-outgoing"