More readable date format
Bryan
germish at gmail.com
Wed Oct 7 22:06:40 CDT 2009
I like the idea. strftime would be nice.
--Bryan
Sent from my iPhone
On Oct 7, 2009, at 5:15 PM, Greg Ward <greg-hg at gerg.ca> wrote:
> I have written a custom log style that fixes the two things about the
> default style that annoy me the most: the list of files and the date.
> E.g.:
>
> changeset: 9167:49b62395e910
> user: Greg Ward <greg-hg at gerg.ca>
> date: 2009-09-30 16:08:11 -0400
> files:
> M mercurial/streamclone.py
> M tests/test-http
> M tests/test-http.out
> description:
> streamclone: partially encode filename over the wire, not for local
> read
>
> The catch: while "2009-09-30" is a great date format for many reasons,
> it's not as human-readable as (say) "Wed Sep 30 2009". Subversion
> gets it right by showing the date in two formats:
>
> r33 | jrandom | 2003-06-10 16:19:48 -0400 (Tue, 10 Jun 2003) | 2
> lines
>
> AFAICT, that's not *quite* possible with Mercurial templates. The
> closest I have come is
>
> date: {date|isodatesec} ({date|date})\n
>
> which yields
>
> date: 2009-09-30 16:08:11 -0400 (Wed Sep 30 16:08:11 2009 -0400
> )
>
> which really is overkill. One obvious possibility is to add a date
> filter for a short localized date, like "Wed 07 Oct 2009" or "mer 07
> oct 2009".
>
> One feature that would neat, though, would be the ability to use
> strftime() via the templating system. E.g.
>
> date: {date|isodatesec} ({date|strftime:%a %d %b})
>
> Opinions? Better ideas?
>
> Thanks --
>
> Greg
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
More information about the Mercurial
mailing list