changeset 22955:fab9dda0f2a3

obsolete: update tests to use obsolete options The obsolete._enabled flag has become a config option. This updates all but one of the tests to use the minimal number of flags necessary for them to pass. For most tests this is just 'createmarkers', for a couple tests it's 'allowunstable', and for even fewer it's 'exchange'.
author Durham Goode <durham@fb.com>
date Tue, 14 Oct 2014 13:34:25 -0700
parents 32f15b361f36
children a0f89c852a0c
files tests/test-bisect.t tests/test-bookmarks-pushpull.t tests/test-bundle2-exchange.t tests/test-bundle2-format.t tests/test-check-commit-hg.t tests/test-commandserver.t tests/test-glog.t tests/test-histedit-obsolete.t tests/test-log.t tests/test-obsolete-changeset-exchange.t tests/test-obsolete-checkheads.t tests/test-obsolete-divergent.t tests/test-obsolete.t tests/test-phases.t tests/test-rebase-obsolete.t tests/test-shelve.t tests/test-subrepo-missing.t tests/test-update-branches.t
diffstat 18 files changed, 47 insertions(+), 102 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-bisect.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-bisect.t	Tue Oct 14 13:34:25 2014 -0700
@@ -555,12 +555,10 @@
 Check that bisect does not break on obsolete changesets
 =========================================================
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 tip is obsolete
 ---------------------
--- a/tests/test-bookmarks-pushpull.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-bookmarks-pushpull.t	Tue Oct 14 13:34:25 2014 -0700
@@ -5,13 +5,9 @@
   > logtemplate={rev}:{node|short} {desc|firstline}
   > [phases]
   > publish=False
-  > [extensions]
+  > [experimental]
+  > evolution=createmarkers,exchange
   > EOF
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 initialize
 
--- a/tests/test-bundle2-exchange.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-bundle2-exchange.t	Tue Oct 14 13:34:25 2014 -0700
@@ -7,15 +7,9 @@
 
 enable obsolescence
 
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
-
   $ cat >> $HGRCPATH << EOF
-  > [extensions]
-  > obsolete=$TESTTMP/obs.py
   > [experimental]
+  > evolution=createmarkers,exchange
   > bundle2-exp=True
   > [ui]
   > ssh=python "$TESTDIR/dummyssh"
--- a/tests/test-bundle2-format.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-bundle2-format.t	Tue Oct 14 13:34:25 2014 -0700
@@ -23,7 +23,6 @@
   > from mercurial import error
   > from mercurial import obsolete
   > 
-  > obsolete._enabled = True
   > 
   > try:
   >     import msvcrt
@@ -197,6 +196,7 @@
   > bundle2=$TESTTMP/bundle2.py
   > [experimental]
   > bundle2-exp=True
+  > evolution=createmarkers
   > [ui]
   > ssh=python "$TESTDIR/dummyssh"
   > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
--- a/tests/test-check-commit-hg.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-check-commit-hg.t	Tue Oct 14 13:34:25 2014 -0700
@@ -2,12 +2,10 @@
 
 Enable obsolescence to avoid the warning issue when obsmarker are found
 
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 Go back in the hg repo
 
--- a/tests/test-commandserver.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-commandserver.t	Tue Oct 14 13:34:25 2014 -0700
@@ -408,13 +408,9 @@
   *** runcommand branches
   default                        1:731265503d86
 
-  $ cat <<EOF > obs.py
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
-  $ cat <<EOF >> .hg/hgrc
-  > [extensions]
-  > obs = obs.py
+  $ cat >> .hg/hgrc << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
 
   >>> import os
--- a/tests/test-glog.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-glog.t	Tue Oct 14 13:34:25 2014 -0700
@@ -2251,12 +2251,10 @@
 Test --hidden
  (enable obsolete)
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
   $ hg debugobsolete `hg id --debug -i -r 8`
   $ testlog
--- a/tests/test-histedit-obsolete.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-histedit-obsolete.t	Tue Oct 14 13:34:25 2014 -0700
@@ -2,21 +2,16 @@
 
 Enable obsolete
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
-
   $ cat >> $HGRCPATH << EOF
   > [ui]
   > logtemplate= {rev}:{node|short} {desc|firstline}
   > [phases]
   > publish=False
+  > [experimental]
+  > evolution=createmarkers,allowunstable
   > [extensions]
   > histedit=
   > rebase=
-  > 
-  > obs=${TESTTMP}/obs.py
   > EOF
 
   $ hg init base
--- a/tests/test-log.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-log.t	Tue Oct 14 13:34:25 2014 -0700
@@ -1377,12 +1377,10 @@
   
 enable obsolete to test hidden feature
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
   $ hg log --template='{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
--- a/tests/test-obsolete-changeset-exchange.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-obsolete-changeset-exchange.t	Tue Oct 14 13:34:25 2014 -0700
@@ -1,12 +1,10 @@
 Test changesets filtering during exchanges (some tests are still in
 test-obsolete.t)
 
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 Push does not corrupt remote
 ----------------------------
--- a/tests/test-obsolete-checkheads.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-obsolete-checkheads.t	Tue Oct 14 13:34:25 2014 -0700
@@ -1,16 +1,12 @@
 Check that obsolete properly strip heads
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ cat >> $HGRCPATH << EOF
   > [phases]
   > # public changeset are not obsolete
   > publish=false
   > [ui]
   > logtemplate='{node|short} ({phase}) {desc|firstline}\n'
-  > [extensions]
-  > obs=${TESTTMP}/obs.py
+  > [experimental]
+  > evolution=createmarkers
   > EOF
   $ mkcommit() {
   >    echo "$1" > "$1"
--- a/tests/test-obsolete-divergent.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-obsolete-divergent.t	Tue Oct 14 13:34:25 2014 -0700
@@ -5,15 +5,11 @@
 
 Enable obsolete
 
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ cat >> $HGRCPATH << EOF
   > [ui]
   > logtemplate = {rev}:{node|short} {desc}\n
-  > [extensions]
-  > obs=${TESTTMP}/obs.py
+  > [experimental]
+  > evolution=createmarkers
   > [alias]
   > debugobsolete = debugobsolete -d '0 0'
   > [phases]
--- a/tests/test-obsolete.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-obsolete.t	Tue Oct 14 13:34:25 2014 -0700
@@ -37,12 +37,10 @@
 
 Enabling it
 
-  $ cat > ../obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers,exchange
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 Killing a single changeset without replacement
 
@@ -644,16 +642,16 @@
 
 Checking _enable=False warning if obsolete marker exists
 
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=!" >> $HGRCPATH
+  $ echo '[experimental]' >> $HGRCPATH
+  $ echo "evolution=" >> $HGRCPATH
   $ hg log -r tip
   obsolete feature not enabled but 68 markers found!
   68:c15e9edfca13 (draft) [tip ] add celestine
 
 reenable for later test
 
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+  $ echo '[experimental]' >> $HGRCPATH
+  $ echo "evolution=createmarkers,exchange" >> $HGRCPATH
 
 #endif
 
--- a/tests/test-phases.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-phases.t	Tue Oct 14 13:34:25 2014 -0700
@@ -515,12 +515,10 @@
   $ cd initialrepo
 
 (enabling evolution)
-  $ cat > ../obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 (making a changeset hidden; H in that case)
   $ hg debugobsolete `hg id --debug -r 5`
--- a/tests/test-rebase-obsolete.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-rebase-obsolete.t	Tue Oct 14 13:34:25 2014 -0700
@@ -4,19 +4,15 @@
 
 Enable obsolete
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ cat >> $HGRCPATH << EOF
   > [ui]
   > logtemplate= {rev}:{node|short} {desc|firstline}
+  > [experimental]
+  > evolution=createmarkers,allowunstable
   > [phases]
   > publish=False
   > [extensions]'
   > rebase=
-  > 
-  > obs=${TESTTMP}/obs.py
   > EOF
 
 Setup rebase canonical repo
--- a/tests/test-shelve.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-shelve.t	Tue Oct 14 13:34:25 2014 -0700
@@ -508,12 +508,10 @@
 
 test bug 4073 we need to enable obsolete markers for it
 
-  $ cat > ../obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution=createmarkers
   > EOF
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
   $ hg shelve
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
--- a/tests/test-subrepo-missing.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-subrepo-missing.t	Tue Oct 14 13:34:25 2014 -0700
@@ -70,17 +70,13 @@
 
 Enable obsolete
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ cat >> $HGRCPATH << EOF
   > [ui]
   > logtemplate= {rev}:{node|short} {desc|firstline}
   > [phases]
   > publish=False
-  > [extensions]'
-  > obs=${TESTTMP}/obs.py
+  > [experimental]
+  > evolution=createmarkers
   > EOF
 
 check that we can update parent repo with missing (amended) subrepo revision
--- a/tests/test-update-branches.t	Tue Oct 14 13:27:00 2014 -0700
+++ b/tests/test-update-branches.t	Tue Oct 14 13:34:25 2014 -0700
@@ -180,14 +180,10 @@
 successors should be taken in account when checking head destination
 
   $ cat << EOF >> $HGRCPATH
-  > [extensions]
-  > obs=$TESTTMP/obs.py
   > [ui]
   > logtemplate={rev}:{node|short} {desc|firstline}
-  > EOF
-  $ cat > $TESTTMP/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
+  > [experimental]
+  > evolution=createmarkers
   > EOF
 
 Test no-argument update to a successor of an obsoleted changeset