[PATCH 0 of 2 WIP] generic facility to filter revisions from a revlog

Idan Kamara idankk86 at gmail.com
Fri Jun 29 17:07:33 UTC 2012


This series is an attempt to add a generic facility to hide revisions from
a revlog. It will be used to expose a filtered changelog.

The approach I've taken is to add two classes:

1) filteredrevlog - this class accepts an existing revlog and two sets of
filtered revs/nodes. Some function results can be filtered simply by removing
elements from the result. Others (like heads()) are a bit more complicated.

2) filteredchangelog - this class inherits from filteredrevlog, accepts an
existing changelog and two sets as above.

In localrepo we keep these two sets and instantiate a filteredchangelog
via filter/unfilter functions. I haven't completely figured out how and when
other parts of the code (non extensions) are going to add things to filter
(ideally these shouldn't be centered in one big function).

The end result is that revisions aren't visible to the outside world unless
explicitly specified.

Some things that still need checking/fixing:
- eliminate '[x]range(len(repo))' in favor of 'list/iter(repo)'
- check interaction with various caches
- fix revsets


More information about the Mercurial-devel mailing list