# HG changeset patch # User Pierre-Yves David # Date 2013-01-07 18:24:06 # Node ID e4687edec014cbc0cff47c178bb41560886f70b0 # Parent f5ed27c51995c2f145b1a1f3226fc2a13ef559b5 clfilter: introduces a hidden filter This filter exclude all hidden revision. We plan to use this filter to hide revision instead of manually checking contents of the hidden revisions set. diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -9,6 +9,16 @@ import copy import phases + +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 @@ -20,14 +30,16 @@ def computeunserved(repo): return frozenset() # function to compute filtered set -filtertable = {'unserved': computeunserved} +filtertable = {'hidden': computehidden, + 'unserved': computeunserved} ### 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'} def filteredrevs(repo, filtername): """returns set of filtered revision for this filter name""" diff --git a/tests/test-phases.t b/tests/test-phases.t --- a/tests/test-phases.t +++ b/tests/test-phases.t @@ -176,9 +176,9 @@ visible shared between the initial repo 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