Pierre-Yves David  committed 6a91cbb

phases: avoid changectx creation while checking command result

This minor changesets saves the creation of a `changectx` ctx object only used to
fetch the revision number.

  • Participants
  • Parent commits f0059ba
  • Branches default

Comments (0)

Files changed (1)

File mercurial/

         newdata = repo._phasecache.getphaserevs(repo)
+        cl = repo.changelog
         changes = sum(o != newdata[i] for i, o in enumerate(olddata))
         rejected = [n for n in nodes
-                    if newdata[repo[n].rev()] < targetphase]
+                    if newdata[cl.rev(n)] < targetphase]
         if rejected:
             ui.warn(_('cannot move %i changesets to a more permissive '
                       'phase, use --force\n') % len(rejected))