changeset 106576:ad87b48da2b0

(vc-hg-working-revision): Make sure the command is executed in a known environment so that we can parse the output. (Bug#4417)
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 14 Dec 2009 17:12:18 +0000
parents 87010af04b9a
children dc9a8e0ff6b3
files lisp/ChangeLog lisp/vc-hg.el
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Dec 14 16:55:34 2009 +0000
+++ b/lisp/ChangeLog	Mon Dec 14 17:12:18 2009 +0000
@@ -1,6 +1,8 @@
 2009-12-14  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc-hg.el (vc-hg-print-log): Fix argument order.
+	(vc-hg-working-revision): Make sure the command is executed in a
+	known environment so that we can parse the output.  (Bug#4417)
 
 2009-12-14  Chong Yidong  <cyd@stupidchicken.com>
 
--- a/lisp/vc-hg.el	Mon Dec 14 16:55:34 2009 +0000
+++ b/lisp/vc-hg.el	Mon Dec 14 17:12:18 2009 +0000
@@ -202,10 +202,14 @@
               standard-output
             (setq status
                   (condition-case nil
-                      ;; Ignore all errors.
-                      (process-file
-                       "hg" nil t nil
-                       "log" "-l1" (file-relative-name file))
+		      (let ((process-environment
+			     ;; Avoid localization of messages so we can parse the output.
+			     (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=")
+				     process-environment)))
+			;; Ignore all errors.
+			(process-file
+			 "hg" nil t nil
+			 "log" "-l1" (file-relative-name file)))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
                     (error nil)))))))