extract: move 'nodeid' assignment where it is parsed
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 07 Oct 2015 00:50:53 -0700
changeset 26554 a6d51dcb1823
parent 26553 89b806a09a66
child 26555 1e33384ff2ed
extract: move 'nodeid' assignment where it is parsed The is one setter and no consumer, we can move it there directly.
mercurial/patch.py
--- 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):