[PATCH 1 of 2] keyword: fix: Use os.sep for Source and Header keywords

Kevin Grover kevin at kevingrover.net
Mon Feb 8 16:51:50 CST 2010


On Sun, Feb 7, 2010 at 6:11 AM, Christian Ebert <blacktrash at gmx.net> wrote:

> Hi Kevin,
>
> * Christian Ebert on Wednesday, February 03, 2010 at 09:05:13 +0000
> > * Kevin Grover on Saturday, January 30, 2010 at 14:53:38 -0600
> >> # HG changeset patch
> >> # User Kevin O. Grover <kevin at kevingrover.net>
> >> # Date 1264179036 28800
> >> # Node ID 02ffdeb799f73cc3c1a04627586cf3039dc5b058
> >> # Parent  e898bc7810ad08affd99d4420c89165252db194c
> >> Use os.sep as path separator in keywords.
>
> Usually the message for extensions is like:
>
> keyword: use os.sep as path separator in default keywordmaps
>
> >> diff -r e898bc7810ad -r 02ffdeb799f7 hgext/keyword.py
> >> --- a/hgext/keyword.py    Thu Jan 21 13:26:26 2010 +0100
> >> +++ b/hgext/keyword.py    Fri Jan 22 08:50:36 2010 -0800
> >> @@ -82,7 +82,7 @@
> >> from mercurial.lock import release
> >> from mercurial.node import nullid
> >> from mercurial.i18n import _
> >> -import re, shutil, tempfile
> >> +import re, shutil, tempfile, os
> >>
> >> commands.optionalrepo += ' kwdemo'
> >>
> >> @@ -115,9 +115,9 @@
> >>        'RCSfile': '{file|basename},v',
> >>        'RCSFile': '{file|basename},v', # kept for backwards
> compatibility
> >>                                        # with hg-keyword
> >> -        'Source': '{root}/{file},v',
> >> +        'Source': '{root}%s{file},v' % (os.sep, ),
> >>        'Id': '{file|basename},v {node|short} {date|utcdate}
> {author|user}',
> >> -        'Header': '{root}/{file},v {node|short} {date|utcdate}
> {author|user}',
> >> +        'Header': '{root}%s{file},v {node|short} {date|utcdate}
> {author|user}' % (os.sep, ),
>
> you will have to break that line.
>
> >>    }
> >>
> >>    def __init__(self, ui, repo):
> >
> > ugh, yes, thank you.
> >
> > But I think
> >
> >        'Source': '{root}%s{file},v' % os.sep,
> >
> > is safe enough and simpler.
>
> test-keyword should not really be problem (it filters the output
> of kwdemo), so why don't you go ahead and resubmit this.
> Otherwise I might do it ;-)
>
> c
> --
> \black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
>                     Ein deutscher Western/A German Western
>
>         --->> http://www.blacktrash.org/underdogma/ccc.php
>


I was traveling when I worked on the other part.  I'm now back and won't
have time to play with this again until the weekend (at the soonest).  Feel
free to make the changes and resubmit it.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100208/ba5c2409/attachment.htm>


More information about the Mercurial-devel mailing list