Patchwork [2,of,5] phase: explicitly exclude secret phase and above

login
register
mail settings
Submitter Boris Feld
Date Aug. 24, 2018, 10:35 p.m.
Message ID <5ec0b78876f2fc334c57.1535150138@FB-lair>
Download mbox | patch
Permalink /patch/34037/
State Accepted
Headers show

Comments

Boris Feld - Aug. 24, 2018, 10:35 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1528224472 -7200
#      Tue Jun 05 20:47:52 2018 +0200
# Node ID 5ec0b78876f2fc334c57d664a67d342859fc2b47
# Parent  79b9bd9659a2b3f9815491a371b988eb7c458726
# EXP-Topic internal-phase.prepare
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5ec0b78876f2
phase: explicitly exclude secret phase and above

The comment explicitly mention the secret phase so we should as well use that in
the code.

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -586,7 +586,7 @@  def subsetphaseheads(repo, subset):
     headsbyphase = [[] for i in allphases]
     # No need to keep track of secret phase; any heads in the subset that
     # are not mentioned are implicitly secret.
-    for phase in allphases[:-1]:
+    for phase in allphases[:secret]:
         revset = "heads(%%ln & %s())" % phasenames[phase]
         headsbyphase[phase] = [cl.node(r) for r in repo.revs(revset, subset)]
     return headsbyphase