mercurial.el: use parents in modeline, not tip
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 22 Aug 2006 11:36:58 -0700
changeset 3000 b6e6d2a9c5bc
parent 2999 e75fdc37100c
child 3001 a7c4c7537999
mercurial.el: use parents in modeline, not tip
contrib/mercurial.el
--- a/contrib/mercurial.el	Tue Aug 22 11:24:59 2006 -0700
+++ b/contrib/mercurial.el	Tue Aug 22 11:36:58 2006 -0700
@@ -548,14 +548,12 @@
 			    '(("M " . modified)
 			      ("A " . added)
 			      ("R " . removed)
+			      ("! " . deleted)
 			      ("? " . nil)))))
 	  (if state
 	      (cdr state)
 	    'normal)))))
 
-(defun hg-tip ()
-  (split-string (hg-chomp (hg-run0 "-q" "tip")) ":"))
-
 (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
@@ -637,10 +635,13 @@
 hg-update-modeline is non-nil, or we have not yet checked the state of
 the file."
   (when (and (hg-root) (or force hg-update-modeline (not hg-mode)))
-    (let ((status (hg-file-status buffer-file-name)))
+    (let ((status (hg-file-status buffer-file-name))
+	  (parents
+	   (split-string (hg-chomp
+			  (hg-run0 "parents" "--template" "{rev}\n")) "\n")))
       (setq hg-status status
 	    hg-mode (and status (concat " Hg:"
-					(car (hg-tip))
+					(mapconcat 'identity parents "+")
 					(cdr (assq status
 						   '((normal . "")
 						     (removed . "r")