# HG changeset patch # User Kevin Bullock # Date 1385336019 21600 # Node ID 01bdccfeb9d98ae85388d06c9c694b946f346edf # Parent 082b2930fe2ca9a003b08439524384e097acaa0a discovery: prefer loop to double-for list comprehension in changegroupsubset The double-for form of list comprehensions gets particularly unreadable when you throw in an 'if' condition. This expands the only remaining instance of the double-for syntax in our codebase into a loop. diff -r 082b2930fe2c -r 01bdccfeb9d9 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Jan 02 16:32:51 2014 -0600 +++ b/mercurial/localrepo.py Sun Nov 24 17:33:39 2013 -0600 @@ -1993,8 +1993,10 @@ bases = [nullid] # TODO: remove call to nodesbetween. csets, bases, heads = cl.nodesbetween(bases, heads) - bases = [p for n in bases for p in cl.parents(n) if p != nullid] - outgoing = discovery.outgoing(cl, bases, heads) + discbases = [] + for n in bases: + discbases.extend([p for p in cl.parents(n) if p != nullid]) + outgoing = discovery.outgoing(cl, discbases, heads) bundler = changegroup.bundle10(self) return self._changegroupsubset(outgoing, bundler, source)