diff mercurial/dagutil.py @ 24803:e89f909edffa stable 3.4-rc

merge default into stable for 3.4 freeze
author Matt Mackall <mpm@selenic.com>
date Thu, 16 Apr 2015 20:57:51 -0500
parents 6ddc86eedc3b
children 015ded095933
line wrap: on
line diff
--- a/mercurial/dagutil.py	Thu Apr 16 22:33:53 2015 +0900
+++ b/mercurial/dagutil.py	Thu Apr 16 20:57:51 2015 -0500
@@ -88,7 +88,10 @@
     '''generic implementations for DAGs'''
 
     def ancestorset(self, starts, stops=None):
-        stops = stops and set(stops) or set()
+        if stops:
+            stops = set(stops)
+        else:
+            stops = set()
         seen = set()
         pending = list(starts)
         while pending:
@@ -179,7 +182,10 @@
     def ancestorset(self, starts, stops=None):
         rlog = self._revlog
         idx = rlog.index
-        stops = stops and set(stops) or set()
+        if stops:
+            stops = set(stops)
+        else:
+            stops = set()
         seen = set()
         pending = list(starts)
         while pending: