# HG changeset patch # User Mads Kiilerich # Date 1409859395 -7200 # Node ID 23c995ed466b5a5a8b486c3abdf523891ff42fbe # Parent c5ece02fb2113ac7b461448661e7dea25a36c8b1 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. diff -r c5ece02fb211 -r 23c995ed466b mercurial/scmposix.py --- a/mercurial/scmposix.py Mon Sep 29 23:23:44 2014 -0700 +++ b/mercurial/scmposix.py Thu Sep 04 21:36:35 2014 +0200 @@ -21,7 +21,8 @@ # old mod_python does not set sys.argv if len(getattr(sys, 'argv', [])) > 0: p = os.path.dirname(os.path.dirname(sys.argv[0])) - path.extend(_rcfiles(os.path.join(p, root))) + if p != '/': + path.extend(_rcfiles(os.path.join(p, root))) path.extend(_rcfiles('/' + root)) return path diff -r c5ece02fb211 -r 23c995ed466b mercurial/scmwindows.py --- a/mercurial/scmwindows.py Mon Sep 29 23:23:44 2014 -0700 +++ b/mercurial/scmwindows.py Thu Sep 04 21:36:35 2014 +0200 @@ -40,7 +40,7 @@ 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