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

Jun Wu quark at fb.com
Wed Mar 22 03:50:51 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 5de0f85888f87c705bcbc38d3e92e97b7e23d1d9
# Parent  fa1618118c0603dafd8b7afbeab0e95f3e4307b0
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 5de0f85888f8
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