# HG changeset patch # User Matt Mackall # Date 1307131688 18000 # Node ID 5867bd6e7cf5eaacbb224b476c1e12f2c1cc84d1 # Parent 4276e320258580718d80cea0a3bfba7681cb48d0 scmutil: improve path calculation for install-relative RC files (issue2841) This code was ugly and might do the wrong thing with symlinks. diff -r 4276e3202585 -r 5867bd6e7cf5 mercurial/scmutil.py --- a/mercurial/scmutil.py Fri Jun 03 13:10:22 2011 +0200 +++ b/mercurial/scmutil.py Fri Jun 03 15:08:08 2011 -0500 @@ -414,8 +414,8 @@ path = [] # old mod_python does not set sys.argv if len(getattr(sys, 'argv', [])) > 0: - path.extend(rcfiles(os.path.dirname(sys.argv[0]) + - '/../etc/mercurial')) + p = os.path.dirname(os.path.dirname(sys.argv[0])) + path.extend(rcfiles(os.path.join(p, 'etc/mercurial'))) path.extend(rcfiles('/etc/mercurial')) return path