changeset 26554:a6d51dcb1823

extract: move 'nodeid' assignment where it is parsed The is one setter and no consumer, we can move it there directly.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 07 Oct 2015 00:50:53 -0700
parents 89b806a09a66
children 1e33384ff2ed
files mercurial/patch.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Tue Oct 06 02:08:32 2015 -0700
+++ b/mercurial/patch.py	Wed Oct 07 00:50:53 2015 -0700
@@ -188,7 +188,6 @@
             subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n'
 
         # should try to parse msg['Date']
-        nodeid = None
         parents = []
 
         if subject:
@@ -236,7 +235,7 @@
                         elif line.startswith("# Branch "):
                             data['branch'] = line[9:]
                         elif line.startswith("# Node ID "):
-                            nodeid = line[10:]
+                            data['nodeid'] = line[10:]
                         elif line.startswith("# Parent "):
                             parents.append(line[9:].lstrip())
                         elif not line.startswith("# "):
@@ -273,7 +272,6 @@
             data['p2'] = parents.pop(0)
 
     data['filename'] = tmpname
-    data['nodeid'] = nodeid
     return data
 
 class patchmeta(object):