[PATCH 1 of 1] keyword: use os.sep in default keywordmaps

Christian Ebert blacktrash at gmx.net
Mon Feb 8 17:06:56 CST 2010


* Patrick Mézard on Monday, February 08, 2010 at 23:13:21 +0100
> Le 08/02/10 23:00, Christian Ebert a écrit :
>> * Patrick Mézard on Monday, February 08, 2010 at 21:50:57 +0100
>>> Le 08/02/10 15:13, Christian Ebert a écrit :
>>>> # HG changeset patch
>>>> # User Kevin O. Grover <kevin at kevingrover.net>
>>>> # Date 1265638286 -3600
>>>> # Node ID eafc7976c686b9161e9336d5db20e61f33de47c7
>>>> # Parent  935ef1836b2f6172c1b003fa751a5b327a9bae7e
>>>> keyword: use os.sep in default keywordmaps

[...]
 
>>> Is that how it works in CVS world or how we would like it
>>> worked? I don't have the time to learn how to use CVS keywords
>>> under windows but the only web page with substitution samples
>>> shows paths with slashes in them, not backslashes:
>>> 
>>>   http://www.mobilefish.com/developer/cvsnt/cvsnt_quickguide_cvskeywords.html
>> 
>> That's the question I wanted to ask by submitting this patch ;-)
>> 
>> The next question:
>> 
>> How does the output of hg log --template='{file}\n' look on
>> windows? From Kevin's proposal I assumed it uses backslashes as
>> separator (I don't have/know windows). If not, the patch is
>> indeed superfluous, if yes, I don't know what to do yet if I want
>> to keep a flexible, template based keywordmaps configuration.
> 
> It displays normalized file names, with a slash.

Thanks, Patrick, for helping me out. Of course the patch should
not go in then.

Kevin,

I can't seem to find out how svn behaves on windows wrt to path
separator in keyword expansion either (all examples I found use
just a file at root level), but even if it (svn) does not
normalize paths when expanding keywords, hg's keyword.py should.

Any other route would be a nightmare to implement (if at all
possible) and even further rise the expectation (already
triggered by providing default keywordmaps) that the behaviour
_and_ the purpose are _exactly_ the same.

c
-- 
_B A U S T E L L E N_ lesen! --->> http://www.blacktrash.org/baustellen/


More information about the Mercurial-devel mailing list