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

Matt Mackall mpm at selenic.com
Wed Jul 22 19:03:59 CDT 2009


On Fri, 2009-07-10 at 14:30 -0300, Alejandro Santos wrote:
> # HG changeset patch
> # User Alejandro Santos <alejolp at alejolp.com>
> # Date 1247246428 10800
> # Node ID 63c55c8908a5760ab229536a8ace8bbc3ea9aad8
> # Parent  bbc78cb1bf150d8497a6057d3b1c5d75e4003d11
> Fix issue 1625: On Windows, the locate command ignores the 'ui.slash' setting.

Alright, I finally got around to looking at this and have come to the
conclusion that it's too ad-hoc. We'd need fixups like this in lots of
places to actually have this work consistently, and that'd mean lots of
extra ugliness.

The existing support for ui.slash (as implemented in dirstate.pathto) is
both naive and wrong. Naive: it only comes into play for relative paths.
Wrong: it breaks various assumptions about how path conversion is done
in other places.

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




More information about the Mercurial-devel mailing list