bug: repo at root of filesystem does not work correctly
Robert Shaw
rshaw at dpkg4x.org
Tue Nov 7 15:16:46 UTC 2006
Good point. I overlooked that.
-Robert
On Nov 6, 2006, at 10:01 PM, Josef Jeff Sipek wrote:
> Just a comment about the code...
>
> --- mercurial-0.9/mercurial/dirstate.py.orig 2006-07-24
> 16:08:35.000000000 -0700
> +++ mercurial-0.9/mercurial/dirstate.py 2006-11-06
> 14:55:24.000000000 -0800
> @@ -32,7 +32,10 @@
> def getcwd(self):
> cwd = os.getcwd()
> if cwd == self.root: return ''
> - return cwd[len(self.root) + 1:]
> + if self.root == '/':
> + return cwd[len(self.root):]
>
> If self.root == '/', then we know that len(self.root) == 1. Not
> sure if it
> makes sense to "optimize."
>
> @@ -352,7 +352,10 @@
> names = os.listdir(top)
> names.sort()
> # nd is the top of the repository dir tree
> - nd = util.normpath(top[len(self.root) + 1:])
> + if self.root == '/':
> + nd = util.normpath(top[len(self.root):])
>
> Ditto.
>
> Jeff.
>
> --
> Don't drink and derive. Alcohol and algebra don't mix.
More information about the Mercurial
mailing list