# HG changeset patch # User Thomas Arendsen Hein # Date 1156234122 -7200 # Node ID 61fcd9fac43481c09ae08e2b5cf710d920194c3e # Parent 3091b1153e2c0f7b9f142f6955c22c280144f28d Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc and add documentation for this. diff --git a/tests/README b/tests/README --- a/tests/README +++ b/tests/README @@ -31,3 +31,6 @@ writing tests: use hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" to strip dates + +- You can append your own hgrc settings to the file that the environment + variable HGRCPATH points to. This file is cleared before running a test. diff --git a/tests/test-abort-checkin b/tests/test-abort-checkin --- a/tests/test-abort-checkin +++ b/tests/test-abort-checkin @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH cat > $HGTMP/false <> $HGTMP/.hgrc -echo "hbisect=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "hbisect=" >> $HGRCPATH echo % init hg init diff --git a/tests/test-extdiff b/tests/test-extdiff --- a/tests/test-extdiff +++ b/tests/test-extdiff @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "extdiff=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "extdiff=" >> $HGRCPATH hg init a cd a @@ -14,9 +13,9 @@ if [ $? -ne 0 ]; then fi hg extdiff -o -Nr $opt -echo "[extdiff]" >> $HGTMP/.hgrc -echo "cmd.falabala=echo" >> $HGTMP/.hgrc -echo "opts.falabala=diffing" >> $HGTMP/.hgrc +echo "[extdiff]" >> $HGRCPATH +echo "cmd.falabala=echo" >> $HGRCPATH +echo "opts.falabala=diffing" >> $HGRCPATH hg falabala diff --git a/tests/test-fetch b/tests/test-fetch --- a/tests/test-fetch +++ b/tests/test-fetch @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "fetch=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "fetch=" >> $HGRCPATH hg init a echo a > a/a diff --git a/tests/test-mq b/tests/test-mq --- a/tests/test-mq +++ b/tests/test-mq @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH echo % help hg help mq @@ -127,7 +126,7 @@ hg ci -Ama hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/' hg unbundle .hg/strip-backup/* -cat >>$HGTMP/.hgrc <>$HGRCPATH <> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH hg init hg qinit diff --git a/tests/test-mq-qdiff b/tests/test-mq-qdiff --- a/tests/test-mq-qdiff +++ b/tests/test-mq-qdiff @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH echo % init hg init a diff --git a/tests/test-mq-qnew-twice b/tests/test-mq-qnew-twice --- a/tests/test-mq-qnew-twice +++ b/tests/test-mq-qnew-twice @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH hg init a cd a diff --git a/tests/test-mq-qrefresh-replace-log-message b/tests/test-mq-qrefresh-replace-log-message --- a/tests/test-mq-qrefresh-replace-log-message +++ b/tests/test-mq-qrefresh-replace-log-message @@ -1,9 +1,8 @@ #!/bin/sh # Environement setup for MQ -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH #Repo init hg init diff --git a/tests/test-mq-qsave b/tests/test-mq-qsave --- a/tests/test-mq-qsave +++ b/tests/test-mq-qsave @@ -1,8 +1,7 @@ #!/bin/sh -HGRCPATH=$HGTMP/.hgrc; export HGRCPATH -echo "[extensions]" >> $HGTMP/.hgrc -echo "mq=" >> $HGTMP/.hgrc +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH hg init a cd a