Mercurial > hg-stable
changeset 31698:67f0377bd24b
rcutil: unindent a block
Since global _rccomponents is gone, the code could be simplified.
author | Jun Wu <quark@fb.com> |
---|---|
date | Tue, 28 Mar 2017 07:55:32 -0700 |
parents | cf052cc5c2c2 |
children | 10d88dc7c010 |
files | mercurial/rcutil.py |
diffstat | 1 files changed, 14 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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