Patchwork phases: remove useless lookup of repo[rev].rev() in _retractboundary

login
register
mail settings
Submitter Yuya Nishihara
Date June 20, 2020, 2:49 a.m.
Message ID <f1d40c573b29f4f51357.1592621399@mimosa>
Download mbox | patch
Permalink /patch/46536/
State Accepted
Headers show

Comments

Yuya Nishihara - June 20, 2020, 2:49 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1592619023 -32400
#      Sat Jun 20 11:10:23 2020 +0900
# Node ID f1d40c573b29f4f51357b504e207f2f493405774
# Parent  f46a333fefcac83d835a5a61cf164311495c9422
phases: remove useless lookup of repo[rev].rev() in _retractboundary

changectx object is no longer needed thanks to a54ee130210a.
Augie Fackler - June 22, 2020, 7:52 p.m.
On Sat, Jun 20, 2020 at 11:49:59AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1592619023 -32400
> #      Sat Jun 20 11:10:23 2020 +0900
> # Node ID f1d40c573b29f4f51357b504e207f2f493405774
> # Parent  f46a333fefcac83d835a5a61cf164311495c9422
> phases: remove useless lookup of repo[rev].rev() in _retractboundary

queued, thanks

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -601,10 +601,10 @@  class phasecache(object):
             # retracted.
             minnewroot = min(newroots)
             aboveroots = [rev for rev in currentroots if rev >= minnewroot]
-            updatedroots = repo.set(b'roots(%ld::)', aboveroots)
+            updatedroots = repo.revs(b'roots(%ld::)', aboveroots)
 
             finalroots = {rev for rev in currentroots if rev < minnewroot}
-            finalroots.update(ctx.rev() for ctx in updatedroots)
+            finalroots.update(updatedroots)
         if finalroots != oldroots:
             self._updateroots(
                 targetphase, {tonode(rev) for rev in finalroots}, tr