[PATCH] Fix issue 1625: On Windows, the locate command ignores the 'ui.slash' setting

Alejandro Santos alejolp at alejolp.com
Fri Jul 24 14:20:56 CDT 2009

On Wed, Jul 22, 2009 at 9:03 PM, Matt Mackall<mpm at selenic.com> wrote:
> The simplest thing to do is probably to have ui.slash=True replace
> util.localpath with util.pconvert or otherwise directly affect its
> behavior, much like we do for encoding settings.
> Yes, this isn't perfect, as it's effectively a global variable. But the
> alternative is quite hairy. We can't guarantee all users of localpath()
> will have a repo or ui object handy to figure out what sort of slash to
> use.
> --
> http://selenic.com : development and support for Mercurial and Linux

After digging around [util|windows].localpath, pconvert and normpath I
realized that this problem wouldn't exist if Windows would report
paths separating directories with an '/' rather than the backslash

So I have to ask: what kind of impact do you think that a wrap to
osutil.listdir (and to os.listdir) would have, reporting paths
separated with a slash '/' on Windows?

I know that this would fix the issue only when the ui.slash setting is
True, and leave us with the mixed slashes on ui.slash = False, but it
could be easier to fix and understand. That would leave us the choice
to strip ui.slash from Hg since it's currently ignored anyway.

(There is some current discussion about filenames on case-insensitive
file systems that I've been trying to follow, and it seems that it's
related to this issue)


More information about the Mercurial-devel mailing list