mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
config: don't read the same config file twice
In some cases some config files would be read twice and shown twice in showconfig --debug.
This commit is contained in:
parent
ddad9ef183
commit
f7a8635451
@ -21,6 +21,7 @@ def systemrcpath():
|
||||
# old mod_python does not set sys.argv
|
||||
if len(getattr(sys, 'argv', [])) > 0:
|
||||
p = os.path.dirname(os.path.dirname(sys.argv[0]))
|
||||
if p != '/':
|
||||
path.extend(_rcfiles(os.path.join(p, root)))
|
||||
path.extend(_rcfiles('/' + root))
|
||||
return path
|
||||
|
@ -40,7 +40,7 @@ def userrcpath():
|
||||
path = [os.path.join(home, 'mercurial.ini'),
|
||||
os.path.join(home, '.hgrc')]
|
||||
userprofile = os.environ.get('USERPROFILE')
|
||||
if userprofile:
|
||||
if userprofile and userprofile != home:
|
||||
path.append(os.path.join(userprofile, 'mercurial.ini'))
|
||||
path.append(os.path.join(userprofile, '.hgrc'))
|
||||
return path
|
||||
|
Loading…
Reference in New Issue
Block a user