comparison tests/test-export.t @ 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 1a9ad84583ee
comparison
equal deleted inserted replaced
18647:c1d23b4a66d5 18648:76b69cccb07a
121 121
122 $ hg export -- -2 122 $ hg export -- -2
123 # HG changeset patch 123 # HG changeset patch
124 # User test 124 # User test
125 # Date 0 0 125 # Date 0 0
126 # Thu Jan 01 00:00:00 1970 +0000
126 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd 127 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
127 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f 128 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
128 foo-10 129 foo-10
129 130
130 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo 131 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
167 168
168 $ hg export --color always --nodates tip 169 $ hg export --color always --nodates tip
169 # HG changeset patch 170 # HG changeset patch
170 # User test 171 # User test
171 # Date 0 0 172 # Date 0 0
173 # Thu Jan 01 00:00:00 1970 +0000
172 # Node ID * (glob) 174 # Node ID * (glob)
173 # Parent * (glob) 175 # Parent * (glob)
174 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 176 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
175 177
176 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc) 178 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc)