changeset 26558:fe52cd049f01

extract: parse 'date' using the generic mechanism Parsing 'date' is very simple and a good first test.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 07 Oct 2015 01:13:36 -0700
parents 23f3f1cbd53b
children dbd4392daedf
files mercurial/patch.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Wed Oct 07 01:20:49 2015 -0700
+++ b/mercurial/patch.py	Wed Oct 07 01:13:36 2015 -0700
@@ -153,7 +153,7 @@
 
 ## Some facility for extensible patch parsing:
 # list of pairs ("header to match", "data key")
-patchheadermap = []
+patchheadermap = [('Date', 'date')]
 
 def extract(ui, fileobj):
     '''extract patch from data read from fileobj.
@@ -234,8 +234,6 @@
                         if line.startswith('# User '):
                             data['user'] = line[7:]
                             ui.debug('From: %s\n' % data['user'])
-                        elif line.startswith("# Date "):
-                            data['date'] = line[7:]
                         elif line.startswith("# Branch "):
                             data['branch'] = line[9:]
                         elif line.startswith("# Node ID "):