D4044: absorb: use set literal to avoid intermediate list

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Aug 6 11:54:44 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdc4750b2a04e: absorb: use set literal to avoid intermediate list (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4044?vs=9761&id=9988

REVISION DETAIL
  https://phab.mercurial-scm.org/D4044

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS

diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -377,7 +377,7 @@
         if not involved and annotated: # a1 == a2 and a is not empty
             # pure insertion, check nearby lines. ignore lines belong
             # to the public (first) changeset (i.e. annotated[i][0] == 1)
-            nearbylinenums = set([a2, max(0, a1 - 1)])
+            nearbylinenums = {a2, max(0, a1 - 1)}
             involved = [annotated[i]
                         for i in nearbylinenums if annotated[i][0] != 1]
         involvedrevs = list(set(r for r, l in involved))



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list