Comments
Patch
@@ -8,10 +8,20 @@
import copy
import phases
import util
+
+def computehidden(repo):
+ """compute the set of hidden revision to filter
+
+ During most operation hidden should be filtered."""
+ assert not repo.changelog.filteredrevs
+ if repo.obsstore:
+ return frozenset(repo.revs('hidden()'))
+ return frozenset()
+
def computeunserved(repo):
"""compute the set of revision that should be filtered when used a server
Secret and hidden changeset should not pretend to be here."""
assert not repo.changelog.filteredrevs
@@ -52,20 +62,22 @@ def computeimpactable(repo):
if roots:
firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
return frozenset(xrange(firstmutable, len(cl)))
# function to compute filtered set
-filtertable = {'unserved': computeunserved,
+filtertable = {'hidden': computehidden,
+ 'unserved': computeunserved,
'mutable': computemutable,
'impactable': computeimpactable}
### Nearest subset relation
# Nearest subset of filter X is a filter Y so that:
# * Y is included in X,
# * X - Y is as small as possible.
# This create and ordering used for branchmap purpose.
# the ordering may be partial
-subsettable = {None: 'unserved',
+subsettable = {None: 'hidden',
+ 'hidden': 'unserved',
'unserved': 'mutable',
'mutable': 'impactable'}
def filteredrevs(repo, filtername):
"""returns set of filtered revision for this filter name"""
@@ -174,13 +174,13 @@ visible shared between the initial repo
:note: The "(+1 heads)" is wrong as we do not had any visible head
check that branch cache with "unserved" filter are properly computed and stored
$ ls ../push-dest/.hg/cache/branchheads*
- ../push-dest/.hg/cache/branchheads
+ ../push-dest/.hg/cache/branchheads-hidden
../push-dest/.hg/cache/branchheads-unserved
- $ cat ../push-dest/.hg/cache/branchheads
+ $ cat ../push-dest/.hg/cache/branchheads-hidden
6d6770faffce199f1fddd1cf87f6f026138cf061 6
b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
2713879da13d6eea1ff22b442a5a87cb31a7ce6a default
6d6770faffce199f1fddd1cf87f6f026138cf061 default
$ cat ../push-dest/.hg/cache/branchheads-unserved