[PATCH 6 of 8 filtering] clfilter: phases logic should be unfiltered
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Wed Nov 21 00:11:38 UTC 2012
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1353455625 -3600
# Node ID a415ae75c7a165436d99733fa42d666ffb5954c4
# Parent 44d111c70f3f909f42493f23395bd807049a6d3c
clfilter: phases logic should be unfiltered
Phases computation and boundaries movements need to be aware of all revisions that
exist in the repository to return correct results.
diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -137,10 +137,11 @@ def _readroots(repo, phasedefaults=None)
set selected changesets phase to something else than public.
Return (roots, dirty) where dirty is true if roots differ from
what is being stored.
"""
+ repo = repo.unfiltered()
dirty = False
roots = [set() for i in allphases]
try:
f = repo.sopener('phaseroots')
try:
@@ -182,10 +183,11 @@ class phasecache(object):
for a in 'phaseroots dirty opener _phaserevs'.split():
setattr(self, a, getattr(phcache, a))
def getphaserevs(self, repo, rebuild=False):
if rebuild or self._phaserevs is None:
+ repo = repo.unfiltered()
revs = [public] * len(repo.changelog)
for phase in trackedphases:
roots = map(repo.changelog.rev, self.phaseroots[phase])
if roots:
for rev in roots:
@@ -226,10 +228,11 @@ class phasecache(object):
def advanceboundary(self, repo, targetphase, nodes):
# Be careful to preserve shallow-copied values: do not update
# phaseroots values, replace them.
+ repo = repo.unfiltered()
delroots = [] # set of root deleted by this path
for phase in xrange(targetphase + 1, len(allphases)):
# filter nodes that are not in a compatible phase already
nodes = [n for n in nodes
if self.phase(repo, repo[n].rev()) >= phase]
@@ -249,10 +252,11 @@ class phasecache(object):
def retractboundary(self, repo, targetphase, nodes):
# Be careful to preserve shallow-copied values: do not update
# phaseroots values, replace them.
+ repo = repo.unfiltered()
currentroots = self.phaseroots[targetphase]
newroots = [n for n in nodes
if self.phase(repo, repo[n].rev()) < targetphase]
if newroots:
if nullid in newroots:
@@ -314,10 +318,11 @@ def listphases(repo):
keys['publishing'] = 'True'
return keys
def pushphase(repo, nhex, oldphasestr, newphasestr):
"""List phases root for serialization over pushkey"""
+ repo = repo.unfiltered()
lock = repo.lock()
try:
currentphase = repo[nhex].phase()
newphase = abs(int(newphasestr)) # let's avoid negative index surprise
oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise
@@ -338,10 +343,11 @@ def analyzeremotephases(repo, subset, ro
* subset is heads of the subset
* roots is {<nodeid> => phase} mapping. key and value are string.
Accept unknown element input
"""
+ repo = repo.unfiltered()
# build list from dictionary
draftroots = []
nodemap = repo.changelog.nodemap # to filter unknown nodes
for nhex, phase in roots.iteritems():
if nhex == 'publishing': # ignore data related to publish option
@@ -365,10 +371,11 @@ def analyzeremotephases(repo, subset, ro
def newheads(repo, heads, roots):
"""compute new head of a subset minus another
* `heads`: define the first subset
* `roots`: define the second we subtract from the first"""
+ repo = repo.unfiltered()
revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))',
heads, roots, roots, heads)
return [c.node() for c in revset]
More information about the Mercurial-devel
mailing list