Bug in util.py

Thomas Arendsen Hein thomas at intevation.de
Tue Nov 7 15:37:31 CST 2006


* Alexis S. L. Carvalho <alexis at cecm.usp.br> [20061107 17:38]:
> Thus spake Thomas Arendsen Hein:
> > This should already have been catched by
> > "elif name == root:" some lines above, but there is a bug in
> > mercurial.dirstate.getcwd() which naively returns
> > cwd[len(self.root) + 1:]
> > even if self.root is the symlink-expanded version and cwd not.
> 
> FWIW, dirstate.root comes from localrepo.root, which comes from either a
> --repository option or from os.getcwd().
> 
> If it came from a --repository option, it may very well not be
> symlink-expanded, but I would hope os.getcwd() (which is also the value
> of the cwd variable above) always returns something without symlinks.
> 
> Changing the "self.root = os.path.abspath(path)" in localrepo.py to use
> os.path.realpath could help here.  This would also change self.root 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).

I pushed this change to crew (44247ecc2965).

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial-devel mailing list