diff mercurial/util.py @ 4086:cc8a52229620

Fix accessing the repo through a symlink.
author Jun Inoue <jun.lambda@gmail.com>
date Thu, 15 Feb 2007 05:18:23 -0200
parents c620376b8fd6
children 587c6c652f82
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -363,6 +363,9 @@ def canonpath(root, cwd, myname):
             except OSError:
                 break
             if samestat(name_st, root_st):
+                if not rel:
+                    # name was actually the same as root (maybe a symlink)
+                    return ''
                 rel.reverse()
                 name = os.path.join(*rel)
                 audit_path(name)