extract: directly assign parent to data dictionary
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 06 Oct 2015 02:05:56 -0700
changeset 26550 72782f60dbc9
parent 26549 1a680ccdb09a
child 26551 5b8faea8b509
extract: directly assign parent to data dictionary The temporary variables are not adding anything.
mercurial/patch.py
--- a/mercurial/patch.py	Tue Oct 06 02:04:46 2015 -0700
+++ b/mercurial/patch.py	Tue Oct 06 02:05:56 2015 -0700
@@ -271,19 +271,16 @@
         data['branch'] = branch
         return data
 
-    p1 = p2 = None
     if parents:
-        p1 = parents.pop(0)
+        data['p1'] = parents.pop(0)
         if parents:
-            p2 = parents.pop(0)
+            data['p2'] = parents.pop(0)
 
     data['filename'] = tmpname
     data['user'] = user
     data['date'] = date
     data['branch'] = branch
     data['nodeid'] = nodeid
-    data['p1'] = p1
-    data['p2'] = p2
     return data
 
 class patchmeta(object):