rebase: explicitly tests for None
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 15 Mar 2017 15:03:43 -0700
changeset 31431 406705701c2d
parent 31430 807387581d89
child 31432 6e1c79578e5c
rebase: explicitly tests for None Changeset 361bccce566a removed the mutable default value, but did not explicitly tested for None. Such implicit checking can introduce semantic and performance issue. We move to an explicit check for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
hgext/rebase.py
--- a/hgext/rebase.py	Thu Mar 16 04:53:23 2017 +0530
+++ b/hgext/rebase.py	Wed Mar 15 15:03:43 2017 -0700
@@ -725,7 +725,8 @@
                 destspace=None):
     """use revisions argument to define destination and rebase set
     """
-    revf = revf or []
+    if revf is None:
+        revf = []
 
     # destspace is here to work around issues with `hg pull --rebase` see
     # issue5214 for details