--- a/hgext/graphlog.py Wed Mar 28 11:42:17 2012 +0200
+++ b/hgext/graphlog.py Sat Apr 14 10:30:38 2012 +0200
@@ -427,6 +427,10 @@
# filtered result.
matched = set(revset.match(repo.ui, expr)(repo, sorted(revs)))
revs = [r for r in revs if r in matched]
+ if not opts.get('hidden'):
+ # --hidden is still experimental and not worth a dedicated revset
+ # yet. Fortunately, filtering revision number is fast.
+ revs = [r for r in revs if r not in repo.changelog.hiddenrevs]
return revs, expr, filematcher
def generate(ui, dag, displayer, showparents, edgefn, getrenamed=None,
--- a/tests/test-glog.t Wed Mar 28 11:42:17 2012 +0200
+++ b/tests/test-glog.t Sat Apr 14 10:30:38 2012 +0200
@@ -2026,3 +2026,22 @@
('string', 'r:')
('string', 'd:relpath'))
('string', 'p:.'))))
+ $ cd ..
+
+Test --hidden
+
+ $ cat > $HGTMP/testhidden.py << EOF
+ > def reposetup(ui, repo):
+ > for line in repo.opener('hidden'):
+ > ctx = repo[line.strip()]
+ > repo.changelog.hiddenrevs.add(ctx.rev())
+ > EOF
+ $ echo '[extensions]' >> .hg/hgrc
+ $ echo "hidden=$HGTMP/testhidden.py" >> .hg/hgrc
+ $ hg id --debug -i -r 0 > .hg/hidden
+ $ testlog
+ []
+ []
+ $ testlog --hidden
+ []
+ []