[PATCH 02 of 13 V3] scmutil: define a list of configs overriding system rc, but not users

Jun Wu quark at fb.com
Wed Mar 22 13:23:34 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1489450537 25200
#      Mon Mar 13 17:15:37 2017 -0700
# Node ID 61757ff29df4a35351fd31568a14e0880dd5c2d4
# Parent  04259bd73d263306f16e25bd4e6bc53faf80911c
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 61757ff29df4
scmutil: define a list of configs overriding system rc, but not users

It's mainly about pager and editor for now. That's the problem the series is
trying to solve. We may move other things here later.

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -405,4 +405,11 @@ def osrcpath():
     return path
 
+# environments overriding system configs but not user configs
+_sysenvlist = [
+    ('EDITOR', 'ui', 'editor'),
+    ('VISUAL', 'ui', 'editor'),
+    ('PAGER', 'pager', 'pager'),
+]
+
 def envconfig(envlist, env=None):
     '''[(section, name, value, source)] extracted from environment variables


More information about the Mercurial-devel mailing list