changeset 26553:89b806a09a66

extract: move 'date' assignment where it is parsed There is one setter and no consumer, we can move it there directly.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 06 Oct 2015 02:08:32 -0700
parents 4caf143313a8
children a6d51dcb1823
files mercurial/patch.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Tue Oct 06 02:07:33 2015 -0700
+++ b/mercurial/patch.py	Tue Oct 06 02:08:32 2015 -0700
@@ -188,7 +188,6 @@
             subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n'
 
         # should try to parse msg['Date']
-        date = None
         nodeid = None
         parents = []
 
@@ -233,7 +232,7 @@
                             user = line[7:]
                             ui.debug('From: %s\n' % user)
                         elif line.startswith("# Date "):
-                            date = line[7:]
+                            data['date'] = line[7:]
                         elif line.startswith("# Branch "):
                             data['branch'] = line[9:]
                         elif line.startswith("# Node ID "):
@@ -266,7 +265,6 @@
     tmpfp.close()
     if not diffs_seen:
         os.unlink(tmpname)
-        data['date'] = date
         return data
 
     if parents:
@@ -275,7 +273,6 @@
             data['p2'] = parents.pop(0)
 
     data['filename'] = tmpname
-    data['date'] = date
     data['nodeid'] = nodeid
     return data