changeset 31692:cf052cc5c2c2

rcutil: do not cache rccomponents The function is only called once except for "hg debugconfig", where it is called twice. So there is no need to cache it. Caching it will cause issues with chgserver. Instead of dropping the cache in chgserver, it seems cleaner to just avoid the cache.
author Jun Wu <quark@fb.com>
date Tue, 28 Mar 2017 07:54:00 -0700
parents c3ca0ad8ab9c
children 67f0377bd24b
files mercurial/rcutil.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/rcutil.py	Sat Mar 25 19:17:11 2017 -0400
+++ b/mercurial/rcutil.py	Tue Mar 28 07:54:00 2017 -0700
@@ -62,8 +62,6 @@
         path = _expandrcpath(defaultpath)
     return path
 
-_rccomponents = None
-
 def rccomponents():
     '''return an ordered [(type, obj)] about where to load configs.
 
@@ -78,7 +76,7 @@
     '''
     envrc = ('items', envrcitems())
 
-    global _rccomponents
+    _rccomponents = None
     if _rccomponents is None:
         if 'HGRCPATH' in encoding.environ:
             # assume HGRCPATH is all about user configs so environments can be