Patchwork [3,of,4] test: use the extension in contrib to enable obsolete

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 21, 2013, 6:48 p.m.
Message ID <0ebc94ad72a9a7731388.1358794109@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/699/
State Rejected
Headers show

Comments

Pierre-Yves David - Jan. 21, 2013, 6:48 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1358793755 -3600
# Branch stable
# Node ID 0ebc94ad72a9a7731388ce7fe95952d4dce956a6
# Parent  dfb09c9eeea5a747c96cae4b50ac070588234314
test: use the extension in contrib to enable obsolete

Now that we have a version in contrib, we do not need to forge the same
extension over and over in the test.
Matt Mackall - Jan. 21, 2013, 7:31 p.m.
On Mon, 2013-01-21 at 19:48 +0100, pierre-yves.david@logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> # Date 1358793755 -3600
> # Branch stable
> # Node ID 0ebc94ad72a9a7731388ce7fe95952d4dce956a6
> # Parent  dfb09c9eeea5a747c96cae4b50ac070588234314
> test: use the extension in contrib to enable obsolete

The point of stable is to minimize risk by minimizing change. Thus, we
do not change things on stable just to make things tidier, even if such
changes are straightforward or boring.

I'd like to see patch 4 as an independent patch, first. Then patch 2
with an explanation of why it really wants to be in 2.5, rather than
just continuing to require the evolve extension.

Patch

diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -4,16 +4,12 @@ 
   > [ui]
   > logtemplate={rev}:{node|short} {desc|firstline}
   > [phases]
   > publish=False
   > [extensions]
+  > obs=${TESTDIR}/../contrib/obs.py
   > EOF
-  $ cat > obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
 
 initialize
 
   $ hg init a
   $ cd a
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -419,17 +419,12 @@  Preserve phase
 Test amend with obsolete
 ---------------------------
 
 Enable obsolete
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
-
+  $ echo "obs=${TESTDIR}/../contrib/obs.py" >> $HGRCPATH
 
 Amend with no files changes
 
   $ hg id -n
   13
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -2042,16 +2042,12 @@  Test subdir
   $ cd ..
 
 Test --hidden
  (enable obsolete)
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+  $ echo "obs=${TESTDIR}/../contrib/obs.py" >> $HGRCPATH
 
   $ hg debugobsolete `hg id --debug -i -r 8`
   $ testlog
   []
   []
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -1,24 +1,18 @@ 
   $ . "$TESTDIR/histedit-helpers.sh"
 
 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]'
   > histedit=
   > rebase=
-  > 
-  > obs=${TESTTMP}/obs.py
+  > obs=${TESTDIR}/../contrib/obs.py
   > EOF
 
   $ hg init base
   $ cd base
 
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1168,16 +1168,12 @@  Diff here should be the same:
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     a
   
 enable obsolete to test hidden feature
 
-  $ cat > ${TESTTMP}/obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+  $ echo "obs=${TESTDIR}/../contrib/obs.py" >> $HGRCPATH
 
   $ hg log --template='{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
   $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
diff --git a/tests/test-obsolete-changeset-exchange.t b/tests/test-obsolete-changeset-exchange.t
--- a/tests/test-obsolete-changeset-exchange.t
+++ b/tests/test-obsolete-changeset-exchange.t
@@ -1,14 +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
-  > EOF
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+  $ echo "obs=${TESTDIR}/../contrib/obs.py" >> $HGRCPATH
 
 Push does not corrupt remote
 ----------------------------
 
 Create a DAG where a changeset reuses a revision from a file first used in an
diff --git a/tests/test-obsolete-checkheads.t b/tests/test-obsolete-checkheads.t
--- a/tests/test-obsolete-checkheads.t
+++ b/tests/test-obsolete-checkheads.t
@@ -1,20 +1,16 @@ 
 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]
   > graphlog=
+  > obs=${TESTDIR}/../contrib/obs.py
   > EOF
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
   $ mkcommit() {
   >    echo "$1" > "$1"
   >    hg add "$1"
   >    hg ci -m "add $1"
   > }
diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -3,19 +3,15 @@  Test file dedicated to testing the diver
 This is the most complexe troubles from far so we isolate it in a dedicated
 file.
 
 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
+  > obs=${TESTDIR}/../contrib/obs.py
   > [alias]
   > debugobsolete = debugobsolete -d '0 0'
   > [phases]
   > publish=False
   > EOF
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -35,16 +35,12 @@  Checking that the feature is properly di
   abort: obsolete feature is not enabled on this repo
   [255]
 
 Enabling it
 
-  $ cat > ../obs.py << EOF
-  > import mercurial.obsolete
-  > mercurial.obsolete._enabled = True
-  > EOF
   $ echo '[extensions]' >> $HGRCPATH
-  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+  $ echo "obs=${TESTDIR}/../contrib/obs.py" >> $HGRCPATH
 
 Killing a single changeset without replacement
 
   $ hg debugobsolete 0
   abort: changeset references must be full hexadecimal node identifiers
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -2,23 +2,18 @@ 
 Test rebase with obsolete
 ==========================
 
 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]'
   > rebase=
-  > 
-  > obs=${TESTTMP}/obs.py
+  > obs=${TESTDIR}/../contrib/obs.py
   > EOF
 
 Setup rebase canonical repo
 
   $ hg init base