Mercurial > hg
comparison mercurial/cmdutil.py @ 18648:76b69cccb07a
export: show 'Date' header in a format that also is readable for humans
'export' is the official export format and used by patchbomb, but it would only
show date as a timestamp that most humans might find it hard to relate to. It
would be very convenient when reviewing a patch to be able to see what
timestamp the patch will end up with.
Mercurial has always used util.parsedate for parsing these headers. It can
handle 'all' date formats, so we could just as well use a readable one.
'export' will now use the format used by 'log' - which is the format described
as 'Unix date format' in the templating help. We assume that all parsers of '#
HG changeset patch'es can handle that.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Fri, 08 Feb 2013 22:54:17 +0100 |
parents | 1a2f4c633410 |
children | 79107fad06aa |
comparison
equal
deleted
inserted
replaced
18647:c1d23b4a66d5 | 18648:76b69cccb07a |
---|---|
573 | 573 |
574 | 574 |
575 write("# HG changeset patch\n") | 575 write("# HG changeset patch\n") |
576 write("# User %s\n" % ctx.user()) | 576 write("# User %s\n" % ctx.user()) |
577 write("# Date %d %d\n" % ctx.date()) | 577 write("# Date %d %d\n" % ctx.date()) |
578 write("# %s\n" % util.datestr(ctx.date())) | |
578 if branch and branch != 'default': | 579 if branch and branch != 'default': |
579 write("# Branch %s\n" % branch) | 580 write("# Branch %s\n" % branch) |
580 write("# Node ID %s\n" % hex(node)) | 581 write("# Node ID %s\n" % hex(node)) |
581 write("# Parent %s\n" % hex(prev)) | 582 write("# Parent %s\n" % hex(prev)) |
582 if len(parents) > 1: | 583 if len(parents) > 1: |