# HG changeset patch # User Kevin Bullock # Date 2013-11-24 23:29:10 # Node ID 1648e44edd8dd5376cbe545b29db77839f4ef8db # Parent 6ed9141151bfd462b1737dacdcdd5b8cf93fbd88 mq: prefer a loop to a double-for list comprehension The [x for y in l for x in y] syntax is nigh-incomprehensible, and this is a particularly easy case to expand into a loop since there's no 'if' condition in the list comprehension. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1204,7 +1204,9 @@ class queue(object): diffopts = self.diffopts() wlock = repo.wlock() try: - heads = [h for hs in repo.branchmap().itervalues() for h in hs] + heads = [] + for hs in repo.branchmap().itervalues(): + heads.extend(hs) if not heads: heads = [nullid] if repo.dirstate.p1() not in heads and not exact: