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

Jun Wu quark at fb.com
Mon Mar 13 23:44:47 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 742ced65214c96869a4305e6d621a9a0d2b1282d
# Parent  0d9bf7436a14061e02ef91dc4f81bee97d638f0a
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 742ced65214c
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