# HG changeset patch # User Pierre-Yves David # Date 2012-08-30 20:13:24 # Node ID 038f4f0439d76db5ba9c27eadaceca449453eb5d # Parent 1e104d8198d7cf8ab7151da0e764676ea01cc115 test: remove invalid hidden rev in graphlog test The hidden set of revision can not have descendant outside this set. The extension is patched to raise and exception when this happen. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -306,6 +306,8 @@ class localrepository(object): Note that the hiddenrevs will needs invalidations when - a new changesets is added (possible unstable above extinct) - a new obsolete marker is added (possible new extinct changeset) + + hidden changesets cannot have non-hidden descendants """ hidden = set() if self.obsstore: diff --git a/tests/test-glog.t b/tests/test-glog.t --- a/tests/test-glog.t +++ b/tests/test-glog.t @@ -2044,20 +2044,40 @@ Test subdir Test --hidden $ cat > $HGTMP/testhidden.py << EOF + > from mercurial import util > def reposetup(ui, repo): > for line in repo.opener('hidden'): > ctx = repo[line.strip()] > repo.hiddenrevs.add(ctx.rev()) + > if repo.revs('children(%ld) - %ld', repo.hiddenrevs, repo.hiddenrevs): + > raise util.Abort('hidden revision with children!') > EOF $ echo '[extensions]' >> .hg/hgrc $ echo "hidden=$HGTMP/testhidden.py" >> .hg/hgrc - $ hg id --debug -i -r 0 > .hg/hidden + $ hg id --debug -i -r 8 > .hg/hidden $ testlog [] [] $ testlog --hidden [] [] + $ hg glog --template '{rev} {desc}\n' + o 7 Added tag foo-bar for changeset fc281d8ff18d + | + o 6 merge 5 and 4 + |\ + | o 5 add another e + | | + o | 4 mv dir/b e + |/ + @ 3 mv a b; add d + | + o 2 mv b dir/b + | + o 1 copy a b + | + o 0 add a + A template without trailing newline should do something sane @@ -2066,6 +2086,8 @@ A template without trailing newline shou | o 1 copy a b | + o 0 add a + Extra newlines must be preserved @@ -2076,6 +2098,9 @@ Extra newlines must be preserved o | 1 copy a b | + o + 0 add a + The almost-empty template should do something sane too ... @@ -2084,5 +2109,7 @@ The almost-empty template should do some | o | + o + $ cd ..