# HG changeset patch # User Jun Wu # Date 1490712932 25200 # Node ID 67f0377bd24bca396473e60743eb80e765f98b8a # Parent cf052cc5c2c26133aaa6ea8536a4919a89ab008e rcutil: unindent a block Since global _rccomponents is gone, the code could be simplified. diff -r cf052cc5c2c2 -r 67f0377bd24b mercurial/rcutil.py --- a/mercurial/rcutil.py Tue Mar 28 07:54:00 2017 -0700 +++ b/mercurial/rcutil.py Tue Mar 28 07:55:32 2017 -0700 @@ -76,20 +76,18 @@ ''' envrc = ('items', envrcitems()) - _rccomponents = None - if _rccomponents is None: - if 'HGRCPATH' in encoding.environ: - # assume HGRCPATH is all about user configs so environments can be - # overridden. - _rccomponents = [envrc] - for p in encoding.environ['HGRCPATH'].split(pycompat.ospathsep): - if not p: - continue - _rccomponents.extend(('path', p) for p in _expandrcpath(p)) - else: - paths = defaultrcpath() + systemrcpath() - _rccomponents = [('path', os.path.normpath(p)) for p in paths] - _rccomponents.append(envrc) - paths = userrcpath() - _rccomponents.extend(('path', os.path.normpath(p)) for p in paths) + if 'HGRCPATH' in encoding.environ: + # assume HGRCPATH is all about user configs so environments can be + # overridden. + _rccomponents = [envrc] + for p in encoding.environ['HGRCPATH'].split(pycompat.ospathsep): + if not p: + continue + _rccomponents.extend(('path', p) for p in _expandrcpath(p)) + else: + paths = defaultrcpath() + systemrcpath() + _rccomponents = [('path', os.path.normpath(p)) for p in paths] + _rccomponents.append(envrc) + paths = userrcpath() + _rccomponents.extend(('path', os.path.normpath(p)) for p in paths) return _rccomponents