Patchwork [2,of,4] revset: ensure we have loaded phases data in '_notpublic()'

login
register
mail settings
Submitter Pierre-Yves David
Date June 17, 2015, 2:09 a.m.
Message ID <2acfb673a817808b6993.1434506959@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9687/
State Accepted
Headers show

Comments

Pierre-Yves David - June 17, 2015, 2:09 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1434410162 25200
#      Mon Jun 15 16:16:02 2015 -0700
# Node ID 2acfb673a817808b6993ae5e84466a42d4cd63b7
# Parent  377bef13cfb90601c15f19d0109449c5922a3526
revset: ensure we have loaded phases data in '_notpublic()'

If we are the very first revs access (or is the phase cache just got
invalidated) the phasesets will be None even if we supports the native
computation. So we explicitly trigger a computation if needed.

This was not an issue before because requesting any phase information would have
triggered such computation.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1511,10 +1511,11 @@  def present(repo, subset, x):
         return baseset()
 
 # for internal use
 def _notpublic(repo, subset, x):
     getargs(x, 0, 0, "_notpublic takes no arguments")
+    repo._phasecache.loadphaserevs(repo) # ensure phase's sets are loaded
     if repo._phasecache._phasesets:
         s = set()
         for u in repo._phasecache._phasesets[1:]:
             s.update(u)
         # XXX we should turn this into a baseset instead of a set, smartset may