changeset 17434:038f4f0439d7

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.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 30 Aug 2012 22:13:24 +0200
parents 1e104d8198d7
children c954447336e1
files mercurial/localrepo.py tests/test-glog.t
diffstat 2 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Aug 29 21:26:39 2012 +0200
+++ b/mercurial/localrepo.py	Thu Aug 30 22:13:24 2012 +0200
@@ -306,6 +306,8 @@
         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:
--- a/tests/test-glog.t	Wed Aug 29 21:26:39 2012 +0200
+++ b/tests/test-glog.t	Thu Aug 30 22:13:24 2012 +0200
@@ -2044,20 +2044,40 @@
 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 @@
   |
   o  1 copy a b
   |
+  o  0 add a
+  
 
 Extra newlines must be preserved
 
@@ -2076,6 +2098,9 @@
   o
   |  1 copy a b
   |
+  o
+     0 add a
+  
 
 The almost-empty template should do something sane too ...
 
@@ -2084,5 +2109,7 @@
   |
   o
   |
+  o
+  
 
   $ cd ..