# HG changeset patch # User Bryan O'Sullivan # Date 1156271838 25200 # Node ID a7c4c75379992437a02c5573e4ee9474a6668986 # Parent b6e6d2a9c5bc949fa7928805fa0f5e6347f18c69 mercurial.el: add hg-status. diff -r b6e6d2a9c5bc -r a7c4c7537999 contrib/mercurial.el --- a/contrib/mercurial.el Tue Aug 22 11:36:58 2006 -0700 +++ b/contrib/mercurial.el Tue Aug 22 11:37:18 2006 -0700 @@ -554,6 +554,23 @@ (cdr state) 'normal))))) +(defun hg-status (&rest paths) + "Return status of PATHS as an alist. +Each entry is a pair (FILE-NAME . STATUS)." + (let ((s (apply 'hg-run "status" "-marduc" paths)) + result) + (dolist (entry (split-string (hg-chomp (cdr s)) "\n") (nreverse result)) + (let ((state (cdr (assoc (substring entry 0 2) + '(("M " . modified) + ("A " . added) + ("R " . removed) + ("! " . deleted) + ("C " . normal) + ("I " . ignored) + ("? " . nil))))) + (name (substring entry 2))) + (setq result (cons (cons name state) result))))))) + (defmacro hg-view-output (args &rest body) "Execute BODY in a clean buffer, then quickly display that buffer. If the buffer contains one line, its contents are displayed in the