Fix accessing a repository via -R/--repository through a symlink.
authorThomas Arendsen Hein <thomas@intevation.de>
Tue, 07 Nov 2006 22:35:07 +0100
changeset 3623 44247ecc2965
parent 3622 535da78ae47b
child 3624 a90a86929d04
Fix accessing a repository via -R/--repository through a symlink. Sometimes the repository root was compared to os.getcwd(), which always uses the canonical path without symbolic links in it. This would changes self.root of the localrepo objects to always use os.sep as the directory separator, which is implicitly assumed in some places, but may not be the case if somebody uses -R foo/repo on windows.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue Nov 07 22:18:34 2006 +0100
+++ b/mercurial/localrepo.py	Tue Nov 07 22:35:07 2006 +0100
@@ -43,7 +43,7 @@
         elif create:
             raise repo.RepoError(_("repository %s already exists") % path)
 
-        self.root = os.path.abspath(path)
+        self.root = os.path.realpath(path)
         self.origroot = path
         self.ui = ui.ui(parentui=parentui)
         self.opener = util.opener(self.path)