joerg.sonnenberger created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches.
REVISION SUMMARY The only consumer can handle revision lists fine. Avoid materializing a range if there are no duplicates as optimization. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9884 AFFECTED FILES mercurial/changegroup.py CHANGE DETAILS diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -316,11 +316,11 @@ self.callback = progress.increment efilesset = set() - cgnodes = [] + duprevs = [] def ondupchangelog(cl, rev): if rev < clstart: - cgnodes.append(cl.node(rev)) + duprevs.append(rev) def onchangelog(cl, rev): ctx = cl.changelogrevision(rev) @@ -448,8 +448,12 @@ if added: phases.registernew(repo, tr, targetphase, added) if phaseall is not None: - phases.advanceboundary(repo, tr, phaseall, cgnodes, revs=added) - cgnodes = [] + if duprevs: + duprevs.extend(added) + else: + duprevs = added + phases.advanceboundary(repo, tr, phaseall, [], revs=duprevs) + duprevs = [] if changesets > 0: To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-patches, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel