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

Kevin Grover kevin at kevingrover.net
Wed Feb 3 17:32:49 CST 2010


On Wed, Feb 3, 2010 at 3:05 AM, Christian Ebert <blacktrash at gmx.net> wrote:

> * 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.
> >
> > 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, ),
> >     }
> >
> >     def __init__(self, ui, repo):
>
> ugh, yes, thank you.
>
> But I think
>
>        'Source': '{root}%s{file},v' % os.sep,
>
> is safe enough and simpler.
>
> (I know why didn't want default [keywordmaps] ;-) )
>
> c
>
> P.S. Could you send your patches inline? Easier to review.
>

My original message (and your quoted reply) have the patch in the text.  I
also attached it to make it easier to extract (for those using webmail).
What did I do wrong.  E.g. how should I have included it?


> --
> die Postleitzahl 29 is unteilbar ich bin 29 des kgV von 29 und 87
> is 29 ich bin 29 ich bin eine Null eine Null is eine runde Sache ich
> möcht heim ich möcht      black/trash/productions: DIE TEXTE
>                          http://www.blacktrash.org/texte/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100203/167d0d95/attachment.htm>


More information about the Mercurial-devel mailing list