Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHGdc4750b2a04e: absorb: use set literal to avoid intermediate list
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/absorb.py (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Augie Fackler | Aug 1 2018, 6:23 PM |
not continuous as seen from the linelog. | not continuous as seen from the linelog. | ||||
""" | """ | ||||
a1, a2, b1, b2 = chunk | a1, a2, b1, b2 = chunk | ||||
# find involved indexes from annotate result | # find involved indexes from annotate result | ||||
involved = annotated[a1:a2] | involved = annotated[a1:a2] | ||||
if not involved and annotated: # a1 == a2 and a is not empty | if not involved and annotated: # a1 == a2 and a is not empty | ||||
# pure insertion, check nearby lines. ignore lines belong | # pure insertion, check nearby lines. ignore lines belong | ||||
# to the public (first) changeset (i.e. annotated[i][0] == 1) | # 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] | involved = [annotated[i] | ||||
for i in nearbylinenums if annotated[i][0] != 1] | for i in nearbylinenums if annotated[i][0] != 1] | ||||
involvedrevs = list(set(r for r, l in involved)) | involvedrevs = list(set(r for r, l in involved)) | ||||
newfixups = [] | newfixups = [] | ||||
if len(involvedrevs) == 1 and self._iscontinuous(a1, a2 - 1, True): | if len(involvedrevs) == 1 and self._iscontinuous(a1, a2 - 1, True): | ||||
# chunk belongs to a single revision | # chunk belongs to a single revision | ||||
rev = involvedrevs[0] | rev = involvedrevs[0] | ||||
if rev > 1: | if rev > 1: |