changeset 26548:25a58881efdd

extract: simplify parents assignement We move to the more standard style of: value = default if special: value = other This is more consistent and compact.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 06 Oct 2015 02:04:06 -0700
parents b9be8ab6e628
children 1a680ccdb09a
files mercurial/patch.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Tue Oct 06 02:01:53 2015 -0700
+++ b/mercurial/patch.py	Tue Oct 06 02:04:06 2015 -0700
@@ -271,15 +271,11 @@
         data['branch'] = branch
         return data
 
+    p1 = p2 = None
     if parents:
         p1 = parents.pop(0)
-    else:
-        p1 = None
-
-    if parents:
-        p2 = parents.pop(0)
-    else:
-        p2 = None
+        if parents:
+            p2 = parents.pop(0)
 
     data['filename'] = tmpname
     data['message'] = message