comparison hgext/absorb.py @ 38958:dc4750b2a04e

absorb: use set literal to avoid intermediate list Differential Revision: https://phab.mercurial-scm.org/D4044
author Augie Fackler <augie@google.com>
date Wed, 01 Aug 2018 18:23:42 -0400
parents 2ac40e86f604
children a5c8c5476339
comparison
equal deleted inserted replaced
38957:2ac40e86f604 38958:dc4750b2a04e
375 # find involved indexes from annotate result 375 # find involved indexes from annotate result
376 involved = annotated[a1:a2] 376 involved = annotated[a1:a2]
377 if not involved and annotated: # a1 == a2 and a is not empty 377 if not involved and annotated: # a1 == a2 and a is not empty
378 # pure insertion, check nearby lines. ignore lines belong 378 # pure insertion, check nearby lines. ignore lines belong
379 # to the public (first) changeset (i.e. annotated[i][0] == 1) 379 # to the public (first) changeset (i.e. annotated[i][0] == 1)
380 nearbylinenums = set([a2, max(0, a1 - 1)]) 380 nearbylinenums = {a2, max(0, a1 - 1)}
381 involved = [annotated[i] 381 involved = [annotated[i]
382 for i in nearbylinenums if annotated[i][0] != 1] 382 for i in nearbylinenums if annotated[i][0] != 1]
383 involvedrevs = list(set(r for r, l in involved)) 383 involvedrevs = list(set(r for r, l in involved))
384 newfixups = [] 384 newfixups = []
385 if len(involvedrevs) == 1 and self._iscontinuous(a1, a2 - 1, True): 385 if len(involvedrevs) == 1 and self._iscontinuous(a1, a2 - 1, True):