Patchwork [1,of,4] phases: simplify revset in updatephases

login
register
mail settings
Submitter Boris Feld
Date Aug. 27, 2018, 10:39 a.m.
Message ID <1a32c924756abb3794e8.1535366393@FB-lair>
Download mbox | patch
Permalink /patch/34076/
State Accepted
Headers show

Comments

Boris Feld - Aug. 27, 2018, 10:39 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1535188813 -7200
#      Sat Aug 25 11:20:13 2018 +0200
# Node ID 1a32c924756abb3794e81d3fa19136939d83d5e5
# Parent  b17d27ea61fb0105abb53e74ff0973ba93574bd6
# EXP-Topic internal-phase.new-phase
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1a32c924756a
phases: simplify revset in updatephases

(Pointed by Yuya Nishihara)
Yuya Nishihara - Aug. 28, 2018, 11:58 a.m.
On Mon, 27 Aug 2018 12:39:53 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1535188813 -7200
> #      Sat Aug 25 11:20:13 2018 +0200
> # Node ID 1a32c924756abb3794e81d3fa19136939d83d5e5
> # Parent  b17d27ea61fb0105abb53e74ff0973ba93574bd6
> # EXP-Topic internal-phase.new-phase
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1a32c924756a
> phases: simplify revset in updatephases

Queued this, thanks.

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -599,8 +599,8 @@  def updatephases(repo, trgetter, headsby
     # to update. This avoid creating empty transaction during no-op operation.
 
     for phase in allphases[:-1]:
-        revset = '%%ln - _phase(%d)' % phase
-        heads = [c.node() for c in repo.set(revset, headsbyphase[phase])]
+        revset = '%ln - _phase(%s)'
+        heads = [c.node() for c in repo.set(revset, headsbyphase[phase], phase)]
         if heads:
             advanceboundary(repo, trgetter(), phase, heads)