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

Christian Ebert blacktrash at gmx.net
Tue Feb 9 08:13:01 CST 2010


* Patrick Mézard on Tuesday, February 09, 2010 at 08:28:47 +0100
> Le 09/02/10 00:06, Christian Ebert a écrit :
>> * 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.
> 
> Is there any equivalent to $Source or $Header in svn? The book only lists:
> 
>    http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html

Right. That's as far as I got wrt reliable references as well.

One could tweak $HeadURL$ or $URL$ to something like:

$HeadURL: file:///path/to/repo/dir/file $
          ^^^^^
(slashes again), but what for in a dvcs?

I'll look into implementing support for the other canonical svn
keywords as a configurable alternative default. $Date$ behaves
differently than in cvs, Id uses a different date format etc.

c
-- 
So dacht ich. Nächstens mehr.
_HÖLDERLIN: H Y P E R I O N_  --->> http://www.blacktrash.org/hyperion/


More information about the Mercurial-devel mailing list