[PATCH 3 of 6] tests: remove the last traces of $HGTMP

Mads Kiilerich mads at kiilerich.com
Wed Oct 6 04:01:50 CDT 2010


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1286355447 -7200
# Node ID 47d4f3af9307a4d6fbe61e331f88d41e68400c9c
# Parent  7c320ad1a7b032aeff2ad065c3b1bf222f7d761c
tests: remove the last traces of $HGTMP

$HGTMP isn't needed - and if we need something like that then $TESTTMP is more
appropriate.

diff --git a/tests/printenv.py b/tests/printenv.py
--- a/tests/printenv.py
+++ b/tests/printenv.py
@@ -48,8 +48,7 @@
 
 out.write("%s hook: " % name)
 for v in env:
-    out.write("%s=%s " %
-              (v, os.environ[v].replace(os.environ["HGTMP"], '$HGTMP')))
+    out.write("%s=%s " % (v, os.environ[v]))
 out.write("\n")
 out.close()
 
diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t
--- a/tests/test-mq-qimport.t
+++ b/tests/test-mq-qimport.t
@@ -85,17 +85,18 @@
 
   $ echo foo >> foo
   $ hg add foo
-  $ hg diff > $HGTMP/url.diff
+  $ hg diff > url.diff
   $ hg revert --no-backup foo
   $ rm foo
 
 Under unix: file:///foobar/blah
 Under windows: file:///c:/foobar/blah
 
-  $ patchurl=`echo "$HGTMP"/url.diff | tr '\\\\' /`
+  $ patchurl=`pwd | tr '\\\\' /`/url.diff
   $ expr "$patchurl" : "\/" > /dev/null || patchurl="/$patchurl"
   $ hg qimport file://"$patchurl"
   adding url.diff to series file
+  $ rm url.diff
   $ hg qun
   url.diff
 
diff --git a/tests/test-notify.t b/tests/test-notify.t
--- a/tests/test-notify.t
+++ b/tests/test-notify.t
@@ -141,7 +141,7 @@
   (run 'hg update' to get a working copy)
   $ cat <<EOF >> $HGRCPATH
   > [notify]
-  > config = $HGTMP/.notify.conf
+  > config = `pwd`/.notify.conf
   > domain = test.com
   > strip = 3
   > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
@@ -156,7 +156,7 @@
   rolling back to revision 0 (undo pull)
   $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
   pull failed
-  $ touch "$HGTMP/.notify.conf"
+  $ touch ".notify.conf"
 
 pull
 
diff --git a/tests/test-rollback.t b/tests/test-rollback.t
--- a/tests/test-rollback.t
+++ b/tests/test-rollback.t
@@ -74,17 +74,18 @@
   precious commit message
   $ echo '% same thing, but run $EDITOR'
   % same thing, but run $EDITOR
-  $ cat > $HGTMP/editor <<'__EOF__'
+  $ cat > editor << '__EOF__'
   > #!/bin/sh
   > echo "another precious commit message" > "$1"
   > __EOF__
-  > chmod +x "$HGTMP"/editor
-  > HGEDITOR="'$HGTMP'"/editor hg --config hooks.pretxncommit=false commit 2>&1
-  > cat .hg/last-message.txt
+  $ chmod +x editor
+  $ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1
   transaction abort!
   rollback completed
   note: commit message saved in .hg/last-message.txt
   abort: pretxncommit hook exited with status * (glob)
+  [255]
+  $ cat .hg/last-message.txt
   another precious commit message
 
 .hg/last-message.txt:
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -52,7 +52,7 @@
 
 non-existent absolute path
 
-  $ hg clone -e "python ./dummyssh" ssh://user@dummy//$HGTMP/nonexistent local
+  $ hg clone -e "python ./dummyssh" ssh://user@dummy//`pwd`/nonexistent local
   remote: abort: There is no Mercurial repository here (.hg not found)!
   abort: no suitable response from remote hg!
   [255]
diff --git a/tests/test-tag.t b/tests/test-tag.t
--- a/tests/test-tag.t
+++ b/tests/test-tag.t
@@ -186,13 +186,13 @@
 
 test custom commit messages
 
-  $ cat > $HGTMP/editor <<'__EOF__'
+  $ cat > editor << '__EOF__'
   > #!/bin/sh
   > echo "custom tag message" > "$1"
   > echo "second line" >> "$1"
   > __EOF__
-  $ chmod +x "$HGTMP"/editor
-  $ HGEDITOR="'$HGTMP'"/editor hg tag custom-tag -e
+  $ chmod +x editor
+  $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
   $ hg log -l1 --template "{desc}\n"
   custom tag message
   second line


More information about the Mercurial-devel mailing list