1. mirror
  2. mercurial

Commits

Pierre-Yves David  committed f0059ba

test: use obsolescence marker to test hidden

Instead of using a custom dedicated extension.

  • Participants
  • Parent commits 2c12768
  • Branches default

Comments (0)

Files changed (2)

File tests/test-glog.t

View file
  • Ignore whitespace
   $ cd ..
 
 Test --hidden
+ (enable obsolete)
 
-  $ 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!')
+  $ cat > ${TESTTMP}/obs.py << EOF
+  > import mercurial.obsolete
+  > mercurial.obsolete._enabled = True
   > EOF
-  $ echo '[extensions]' >> .hg/hgrc
-  $ echo "hidden=$HGTMP/testhidden.py" >> .hg/hgrc
-  $ hg id --debug -i -r 8 > .hg/hidden
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+
+  $ hg debugobsolete `hg id --debug -i -r 8`
   $ testlog
   []
   []

File tests/test-log.t

View file
  • Ignore whitespace
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     a
   
-  $ cat > $HGTMP/testhidden.py << EOF
-  > def reposetup(ui, repo):
-  >     for line in repo.opener('hidden'):
-  >         ctx = repo[line.strip()]
-  >         repo.hiddenrevs.add(ctx.rev())
+enable obsolete to test hidden feature
+
+  $ cat > ${TESTTMP}/obs.py << EOF
+  > import mercurial.obsolete
+  > mercurial.obsolete._enabled = True
   > EOF
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "hidden=$HGTMP/testhidden.py" >> $HGRCPATH
-  $ touch .hg/hidden
+  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+
   $ hg log --template='{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
-  $ echo a765632148dc55d38c35c4f247c618701886cb2f > .hg/hidden
+  $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
+  $ hg up null -q
   $ hg log --template='{rev}:{node}\n'
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
   $ hg log --template='{rev}:{node}\n' --hidden
 
 clear extensions configuration
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "hidden=!" >> $HGRCPATH
+  $ echo "obs=!" >> $HGRCPATH
   $ cd ..
 
 test -u/-k for problematic encoding