emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] vc-hg keep working when hg emits warnings


From: Sascha Wilde
Subject: [PATCH] vc-hg keep working when hg emits warnings
Date: Sun, 01 Aug 2010 18:35:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi *,

related to my latest post (regarding hgrc handling):

When one works on an hg repository with an .hg/hgrc owned by someone
else, hg emits a warning like:

Not trusting file /home/foo/argh/.hg/hgrc from untrusted user foo, group foo

on stderr.[1]

Despite the warning hg still works as expected (ignoring the
repositories hgrc).  So ignoring the warning is TRTTD for Emacs.
Currently the warning text confuses vc, so that certain commands and the
revision display in the status bare don't work correctly.

The following patch achieves this by simply ignoring all output on
stderr for vc-hg-state and vc-hg-working-revision.

This might seem a little brute force, but its the most simple solution
and I believe it should be free of unwanted side effects:

changeset:   109608:f8818ac3a2df
branch:      wilde
tag:         tip
user:        Sascha Wilde <address@hidden>
date:        Sun Aug 01 18:18:35 2010 +0200
files:       lisp/ChangeLog lisp/vc/vc-hg.el
description:
Ignore warnings by hg.


diff -r 955b39955186 -r f8818ac3a2df lisp/ChangeLog
--- a/lisp/ChangeLog    Sun Aug 01 17:27:24 2010 +0200
+++ b/lisp/ChangeLog    Sun Aug 01 18:18:35 2010 +0200
@@ -3,6 +3,10 @@
        * vc/vc-hg.el (vc-hg-state,vc-hg-working-revision): Replaced
        setting HGRCPATH to "" by some less invasive --config options.
 
+       * vc/vc-hg.el (vc-hg-state,vc-hg-working-revision): Ignore output
+       on stderr to work even when hg emits any warnings.
+
+
 2010-08-01  Chong Yidong  <address@hidden>
 
        * emacs-lisp/package.el (package--list-packages): Fix column
diff -r 955b39955186 -r f8818ac3a2df lisp/vc/vc-hg.el
--- a/lisp/vc/vc-hg.el  Sun Aug 01 17:27:24 2010 +0200
+++ b/lisp/vc/vc-hg.el  Sun Aug 01 18:18:35 2010 +0200
@@ -173,7 +173,7 @@
                             (append (list "TERM=dumb" "LANGUAGE=C")
                                     process-environment)))
                        (process-file
-                        "hg" nil t nil
+                        "hg" nil '(t nil) nil
                         "--config" "alias.status=status"
                         "--config" "defaults.status="
                         "status" "-A" (file-relative-name file)))
@@ -211,7 +211,7 @@
                      (let ((process-environment avoid-local-env))
                        ;; Ignore all errors.
                        (process-file
-                        "hg" nil t nil
+                        "hg" nil '(t nil) nil
                         "--config" "alias.parents=parents"
                         "--config" "defaults.parents="
                         "parents" "--template" "{rev}" (file-relative-name 
file)))

cheers
sascha

[1]  This is true, unless the user of hg "trusts" the owner of the hgrc
     file -- which is the case handled by the patch in my other post...
-- 
Sascha Wilde
Hauptfunktion einer GUI ist es IMHO, die dadurch verlorene Zeit durch
einen höheren Spaß-Faktor zu kompensieren. Essentiell ein
Computerspiel.  --  Rainer Weikusat in d.c.o.u.d

reply via email to

[Prev in Thread] Current Thread [Next in Thread]