[PATCH 2 of 2] keyword: add: SVN-like keywords and config section to select their use

Kevin Grover kevin at kevingrover.net
Sun Jan 31 21:50:13 CST 2010


On Sun, Jan 31, 2010 at 9:08 PM, Kevin Grover <kevin at kevingrover.net> wrote:

> On Sun, Jan 31, 2010 at 6:26 AM, David Soria Parra <sn_ at gmx.net> wrote:
>
>> On 2010-01-30, Kevin Grover <kevin at kevingrover.net> wrote:
>> > -An additional date template filter {date|utcdate} is provided. It
>> > -returns a date like "2006/09/18 15:13:13".
>> > +Additional date template filters are provided:
>> > +
>> > +Filter                 For  Sample of Return
>> > +---------------------  ---
>>  --------------------------------------------
>> > +{date|utcdate}         CVS  "2006/09/18 15:13:13"
>> > +{date|utcisodate}      SVN  "2006-09-18 15:13:13Z"
>> > +{date|utcisodatelong}  SVN  "2006-09-18 15:13:13 PST (Mon, 18 Sep
>> 2006)"
>> Maybe I'm wrong but according to
>>
>> http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html
>>
>> the format is
>> 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006)
>>
>> which means
>> %Y-%m-%d %H:%M:%S %z (%a, %d %b %Y)
>>
>> but I like the general idea of the patch.
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel
>>
>
> True, when I went looking, I don't know how I missed %z.  Thanks for the
> catch.
>
> Here's a minor patch to the original P2 that fixes it.
>
>
> # HG changeset patch
> # User Kevin O. Grover <kevin at kevingrover.net>
> # Date 1264993145 21600
> # Node ID 620ad01c7643d5657d72706ae8ba8e84e221d117
> # Parent  7acd0d5a639634d651f94a9e6ada5b136af430ad
> Make Timezone for SVN Long date match actual SVN keywords.
>
> diff -r 7acd0d5a6396 -r 620ad01c7643 hgext/keyword.py
> --- a/hgext/keyword.py    Fri Jan 22 09:05:49 2010 -0800
> +++ b/hgext/keyword.py    Sun Jan 31 20:59:05 2010 -0600
> @@ -110,7 +110,7 @@
>
>
>  # provide svn-like dates
>  utcisodate = lambda d: util.datestr(d, '%Y-%m-%d %H:%M:%SZ')
> -utcisodatelong = lambda d: util.datestr(d, '%Y-%m-%d %H:%M:%S %Z (%a, %d
> %b %Y)')
> +utcisodatelong = lambda d: util.datestr(d, '%Y-%m-%d %H:%M:%S %z (%a, %d
> %b %Y)')
>
>  # make keyword tools accessible
>
>  kwtools = {'templater': None, 'hgcmd': '', 'style': 'cvs', 'inc': [],
> 'exc': ['.hg*']}
>
>
>
Another problem I noticed (and I think this applies to the CVS Date/time
also).  It says it's adjusted to UTC, but it does not appear to be so.

Does anyone know how to adjust the date/time to UTC for output?  I just
spent a while looking.  I'll try more later.

- Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100131/5ee077c5/attachment.htm>


More information about the Mercurial-devel mailing list