changeset 814:0902ffece4b4

Merge with BOS
author mpm@selenic.com
date Sat, 30 Jul 2005 09:00:14 -0800
parents 8f5637f0a0c0 (diff) 80fd2958235a (current diff)
children 5a55e3011772
files .hgignore MANIFEST.in doc/hg.1.txt hgeditor hgmerge mercurial/commands.py mercurial/hg.py mercurial/transaction.py mercurial/util.py templates/changelogentry-rss.tmpl templates/filelogentry-rss.tmpl tests/README tests/fish-merge tests/run-tests tests/test-backwards-remove tests/test-backwards-remove.out tests/test-bad-pull tests/test-bad-pull.out tests/test-basic tests/test-basic.out tests/test-bdiff tests/test-clone tests/test-clone-failure tests/test-clone-failure.out tests/test-clone.out tests/test-conflict tests/test-conflict.out tests/test-copy tests/test-copy.out tests/test-diffdir tests/test-diffdir.out tests/test-empty-dir tests/test-empty-dir.out tests/test-flags tests/test-flags.out tests/test-help tests/test-help.out tests/test-hook tests/test-hook.out tests/test-hup tests/test-hup.out tests/test-merge1 tests/test-merge1.out tests/test-merge2 tests/test-merge2.out tests/test-merge3 tests/test-merge3.out tests/test-merge4 tests/test-merge4.out tests/test-merge5 tests/test-merge5.out tests/test-merge6 tests/test-merge6.out tests/test-pull tests/test-pull.out tests/test-rawcommit1 tests/test-rawcommit1.out tests/test-simple-update tests/test-simple-update.out tests/test-tag tests/test-tag.out tests/test-tags tests/test-tags.out tests/test-undo tests/test-undo.out tests/test-unrelated-pull tests/test-unrelated-pull.out tests/test-up-local-change tests/test-up-local-change.out
diffstat 63 files changed, 521 insertions(+), 446 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Fri Jul 29 15:02:27 2005 -0800
+++ b/.hgignore	Sat Jul 30 09:00:14 2005 -0800
@@ -4,10 +4,11 @@
 \.so$
 \.pyc$
 \.swp$
+^tests/.*\.err$
 ^build/
 ^dist/
 ^doc/.*\.[0-9]$
 ^MANIFEST$
-^.pc/
+^\.pc/
 ^patches/
 ^mercurial/__version__.py$
--- a/MANIFEST.in	Fri Jul 29 15:02:27 2005 -0800
+++ b/MANIFEST.in	Sat Jul 30 09:00:14 2005 -0800
@@ -2,11 +2,12 @@
 recursive-include mercurial *.py
 include hgweb.cgi
 include hgeditor rewrite-log
-include tests/README tests/run-tests tests/test-*[a-z] tests/*.out
+include tests/README tests/run-tests tests/test-*[a-z0-9] tests/*.out
+prune tests/*.err
 include *.txt
-include templates/map templates/map-*[a-z]
+include templates/map templates/map-*[a-z0-9]
 include templates/*.tmpl
-include doc/README doc/*.txt Makefile
+include doc/README doc/*.txt doc/Makefile
 recursive-include contrib *
 include README
 include CONTRIBUTORS
--- a/hgeditor	Fri Jul 29 15:02:27 2005 -0800
+++ b/hgeditor	Sat Jul 30 09:00:14 2005 -0800
@@ -6,15 +6,12 @@
 # change this to one to turn on GPG support
 SIGN=0
 
-T1=""; T2=""
-cleanup_exit() {
-    rm -f "$T1" "$T2"
-    exit $1
-}
-
 # If you want to pass your favourite editor some other parameters
 # only for Mercurial, modify this:
-case "${EDITOR:=vi}" in
+case "${EDITOR}" in
+    "")
+        EDITOR="vi"
+        ;;
     emacs)
         EDITOR="$EDITOR -nw"
         ;;
@@ -23,35 +20,48 @@
         ;;
 esac
 
+
+HGTMP=""
+cleanup_exit() {
+    rm -rf "$HGTMP"
+    exit $1
+}
+
 # Remove temporary files even if we get interrupted
 trap "cleanup_exit 255" TERM KILL INT QUIT ABRT
-T1=`mktemp`; T2=`mktemp`
+
+HGTMP="${TMPDIR-/tmp}/hgeditor.$RANDOM.$RANDOM.$RANDOM.$$"
+(umask 077 && mkdir "$HGTMP") || {
+    echo "Could not create temporary directory! Exiting." 1>&2
+    exit 1
+}
+
 (
     cd "`hg root`"
     grep '^HG: changed' "$1" | cut -b 13- | while read changed; do
-        hg diff "$changed" >> "$T2"
+        hg diff "$changed" >> "$HGTMP/diff"
     done
 )
 
-echo > "$T1"
+echo > "$HGTMP/msg"
 if [ "$SIGN" == "1" ]; then
     MANIFEST=`grep '^HG: manifest hash' "$1" | cut -b 19-`
-    echo -e "\nmanifest hash: $MANIFEST" >> "$T1"
+    echo -e "\nmanifest hash: $MANIFEST" >> "$HGTMP/msg"
 fi
-grep -vE '^(HG: manifest hash .*)?$' "$1" >> "$T1"
+grep -vE '^(HG: manifest hash .*)?$' "$1" >> "$HGTMP/msg"
 
-CHECKSUM=`md5sum "$T1"`
-$EDITOR "$T1" "$T2" || cleanup_exit $?
+CHECKSUM=`md5sum "$HGTMP/msg"`
+$EDITOR "$HGTMP/msg" "$HGTMP/diff" || cleanup_exit $?
 echo "$CHECKSUM" | md5sum -c >/dev/null 2>&1 && cleanup_exit 13
 
 if [ "$SIGN" == "1" ]; then
     {
-        head -n 1 "$T1"
+        head -n 1 "$HGTMP/msg"
         echo
-        grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER}" --clearsign
-    } > "$T2" && mv "$T2" "$1"
+        grep -v "^HG:" "$HGTMP/msg" | gpg -t -a -u "${HGUSER}" --clearsign
+    } > "$HGTMP/msg.gpg" && mv "$HGTMP/msg.gpg" "$1"
 else
-    mv "$T1" "$1"
+    mv "$HGTMP/msg" "$1"
 fi
 
 cleanup_exit $?
--- a/hgmerge	Fri Jul 29 15:02:27 2005 -0800
+++ b/hgmerge	Sat Jul 30 09:00:14 2005 -0800
@@ -7,34 +7,36 @@
 
 set -e # bail out quickly on failure
 
-LOCAL=$1
-BASE=$2
-OTHER=$3
+LOCAL="$1"
+BASE="$2"
+OTHER="$3"
 
-EDITOR="${EDITOR:-vi}"
+if [ -z "$EDITOR" ]; then
+    EDITOR="vi"
+fi
 
 # Back up our file
-cp $LOCAL $LOCAL.orig
+cp "$LOCAL" "$LOCAL.orig"
 
 # Attempt to do a non-interactive merge
-if which merge > /dev/null ; then
-    if merge $LOCAL $BASE $OTHER 2> /dev/null; then
+if type merge > /dev/null ; then
+    if merge "$LOCAL" "$BASE" "$OTHER" 2> /dev/null; then
 	# success!
 	exit 0
     fi
-    cp $LOCAL.orig $LOCAL
-elif which diff3 > /dev/null ; then
-    if diff3 -m $LOCAL.orig $BASE $OTHER > $LOCAL ; then
+    cp "$LOCAL.orig" "$LOCAL"
+elif type diff3 > /dev/null ; then
+    if diff3 -m "$LOCAL.orig" "$BASE" "$OTHER" > "$LOCAL" ; then
 	# success
 	exit 0
     fi
-    cp $LOCAL.orig $LOCAL
+    cp "$LOCAL.orig" "$LOCAL"
 fi
 
 if [ -n "$DISPLAY" ]; then
     # try using kdiff3, which is fairly nice
-    if which kdiff3 > /dev/null ; then
-	if kdiff3 --auto $BASE $LOCAL $OTHER -o $LOCAL ; then
+    if type kdiff3 > /dev/null ; then
+	if kdiff3 --auto "$BASE" "$LOCAL" "$OTHER" -o "$LOCAL" ; then
 	    exit 0
 	else
 	    exit 1
@@ -42,8 +44,8 @@
     fi
 
     # try using tkdiff, which is a bit less sophisticated
-    if which tkdiff > /dev/null ; then
-	if tkdiff $LOCAL $OTHER -a $BASE -o $LOCAL ; then
+    if type tkdiff > /dev/null ; then
+	if tkdiff "$LOCAL" "$OTHER" -a "$BASE" -o "$LOCAL" ; then
 	    exit 0
 	else
 	    exit 1
@@ -52,30 +54,43 @@
 fi
 
 # Attempt to do a merge with $EDITOR
-if which merge > /dev/null ; then
+if type merge > /dev/null ; then
     echo "conflicts detected in $LOCAL"
-    merge $LOCAL $BASE $OTHER 2>/dev/null || $EDITOR $LOCAL
+    merge "$LOCAL" "$BASE" "$OTHER" 2>/dev/null || $EDITOR "$LOCAL"
     exit 0
 fi
 
-if which diff3 > /dev/null ; then
+if type diff3 > /dev/null ; then
     echo "conflicts detected in $LOCAL"
-    diff3 -m $LOCAL.orig $BASE $OTHER > $LOCAL || $EDITOR $LOCAL
+    diff3 -m "$LOCAL.orig" "$BASE" "$OTHER" > "$LOCAL" || $EDITOR "$LOCAL"
     exit 0
 fi
 
+HGTMP=""
+cleanup_exit() {
+    rm -rf "$HGTMP"
+    exit $1
+}
+
 # attempt to manually merge with diff and patch
-if which diff > /dev/null ; then
-    if which patch > /dev/null ; then
-	T=`mktemp`
-	diff -u $BASE $OTHER > $T
-	if patch $LOCAL < $T ; then
-	    exit 0
+if type diff > /dev/null ; then
+    if type patch > /dev/null ; then
+	# Remove temporary files even if we get interrupted
+	trap "cleanup_exit 1" TERM KILL INT QUIT ABRT
+
+	HGTMP="${TMPDIR-/tmp}/hgmerge.$RANDOM.$RANDOM.$RANDOM.$$"
+	(umask 077 && mkdir "$HGTMP") || {
+	    echo "Could not create temporary directory! Exiting." 1>&2
+	    exit 1
+	}
+
+	diff -u "$BASE" "$OTHER" > "$HGTMP/diff"
+	if patch "$LOCAL" < "$HGTMP/diff" ; then
+	    cleanup_exit 0
 	else
-	    $EDITOR $LOCAL $LOCAL.rej
+	    $EDITOR "$LOCAL" "$LOCAL.rej"
 	fi
-	rm $T
-	exit 1
+	cleanup_exit 1
     fi
 fi
 
--- a/mercurial/commands.py	Fri Jul 29 15:02:27 2005 -0800
+++ b/mercurial/commands.py	Sat Jul 30 09:00:14 2005 -0800
@@ -538,7 +538,10 @@
     keys = dc.keys()
     keys.sort()
     for file_ in keys:
-        ui.write("%c %s\n" % (dc[file_][0], file_))
+        ui.write("%c %3o %10d %s %s\n"
+                 % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2],
+                    time.strftime("%x %X",
+                                  time.localtime(dc[file_][3])), file_))
 
 def debugindex(ui, file_):
     """dump the contents of an index file"""
--- a/mercurial/hg.py	Fri Jul 29 15:02:27 2005 -0800
+++ b/mercurial/hg.py	Sat Jul 30 09:00:14 2005 -0800
@@ -1493,7 +1493,8 @@
                     if f in merge: cf = " (resolve)"
                     self.ui.status(" %s%s\n" % (f, cf))
                 self.ui.warn("aborting update spanning branches!\n")
-                self.ui.status("(use update -m to perform a branch merge)\n")
+                self.ui.status("(use update -m to merge across branches" +
+                               " or -C to lose changes)\n")
                 return 1
             # we have to remember what files we needed to get/change
             # because any file that's different from either one of its
--- a/tests/README	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/README	Sat Jul 30 09:00:14 2005 -0800
@@ -28,10 +28,6 @@
 
 - diff will show the current time
 
-  use hg diff | sed "s/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/" to strip
+  use hg diff | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" to strip
   dates
 
-- set -x and pipelines don't generate stable output
-
-  turn off set -x or break pipelines into pieces
-
--- a/tests/fish-merge	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/fish-merge	Sat Jul 30 09:00:14 2005 -0800
@@ -4,8 +4,8 @@
 set -x
 
 # skip commit logs
-export HGMERGE=tkmerge
-export EDITOR=true
+HGMERGE=tkmerge; export HGMERGE
+EDITOR=true; export EDITOR
 
 rm -rf m m1 m2
 mkdir m
--- a/tests/run-tests	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/run-tests	Sat Jul 30 09:00:14 2005 -0800
@@ -1,28 +1,45 @@
 #!/bin/sh -e
 
-export LANG=C
-export LC_CTYPE="C"
-export LC_NUMERIC="C"
-export LC_TIME="C"
-export LC_COLLATE="C"
-export LC_MONETARY="C"
-export LC_MESSAGES="C"
-export LC_PAPER="C"
-export LC_NAME="C"
-export LC_ADDRESS="C"
-export LC_TELEPHONE="C"
-export LC_MEASUREMENT="C"
-export LC_IDENTIFICATION="C"
-export LC_ALL=""
-export HGEDITOR=true
-export HGMERGE=true
-export HGUSER=test
+LANG="C"; export LANG
+LC_CTYPE="C"; export LC_CTYPE
+LC_NUMERIC="C"; export LC_NUMERIC
+LC_TIME="C"; export LC_TIME
+LC_COLLATE="C"; export LC_COLLATE
+LC_MONETARY="C"; export LC_MONETARY
+LC_MESSAGES="C"; export LC_MESSAGES
+LC_PAPER="C"; export LC_PAPER
+LC_NAME="C"; export LC_NAME
+LC_ADDRESS="C"; export LC_ADDRESS
+LC_TELEPHONE="C"; export LC_TELEPHONE
+LC_MEASUREMENT="C"; export LC_MEASUREMENT
+LC_IDENTIFICATION="C"; export LC_IDENTIFICATION
+LC_ALL=""; export LC_ALL
+TZ=GMT; export TZ
+HGEDITOR=true; export HGEDITOR
+HGMERGE=true; export HGMERGE
+HGUSER="test"; export HGUSER
 
 umask 022
 
 tests=0
 failed=0
-H=$PWD
+
+HGTMP=""
+cleanup_exit() {
+    rm -rf "$HGTMP"
+    exit $1
+}
+
+# Remove temporary files even if we get interrupted
+trap "cleanup_exit 255" TERM KILL INT QUIT ABRT
+
+HGTMP="${TMPDIR-/tmp}/hgtests.$RANDOM.$RANDOM.$RANDOM.$$"
+(umask 077 && mkdir "$HGTMP") || {
+    echo "Could not create temporary directory! Exiting." 1>&2
+    exit 1
+}
+
+TESTDIR="$PWD"
 
 if [ -d /usr/lib64 ]; then
     lib=lib64
@@ -30,73 +47,91 @@
     lib=lib
 fi
 
-TESTPATH=$PWD/install/bin
-export PATH=$TESTPATH:$PATH
-export PYTHONPATH=$PWD/install/$lib/python
-
-rm -rf install
+INST="$HGTMP/install"
 cd ..
-${PYTHON:-python} setup.py install --home=tests/install > tests/install.err
-if [ $? != 0 ] ; then
+if ${PYTHON-python} setup.py install --home="$INST" > tests/install.err 2>&1
+then
+    rm tests/install.err
+    mv "$INST/bin/hg" "$INST/bin/hg.real"
+    (
+	echo '#!/bin/sh'
+	echo 'echo "+ hg $@"'
+	echo 'exec hg.real "$@"'
+    ) > "$INST/bin/hg"
+    chmod 755 "$INST/bin/hg"
+else
     cat tests/install.err
+    cleanup_exit 1
 fi
-cd $H
-rm install.err
+cd "$TESTDIR"
 
-function run_one
-{
-    rm -f $1.err
-    export TZ=GMT
-    D=`mktemp -d ${TMP-/tmp}/tmp.XXXXXX`
-    if [ "$D" = "" ] ; then
-	echo mktemp failed!
-    fi
+PATH="$INST/bin:$PATH"; export PATH
+PYTHONPATH="$INST/$lib/python"; export PYTHONPATH
+
+
+run_one() {
+    rm -f "$1.err"
 
-    cd $D
+    mkdir "$HGTMP/$1"
+    cd "$HGTMP/$1"
     fail=0
-    export HOME=$D
+    HOME="$HGTMP/$1"; export HOME
+    OUT="$HGTMP/$1.out"
+    OUTOK="$TESTDIR/$1.out"
+    ERR="$TESTDIR/$1.err"
 
-    if ! $H/$1 > .out 2>&1 ; then
-	echo $1 failed with error code $?
+    if "$TESTDIR/$1" > "$OUT" 2>&1; then
+	: no error
+    else
+	echo "$1 failed with error code $?"
 	fail=1
     fi
 
-    if [ -s .out -a ! -r $H/$1.out ] ; then
-	echo $1 generated unexpected output:
-	cat .out
-	cp .out $H/$1.err
+    if [ -s "$OUT" -a ! -s "$OUTOK" ] ; then
+	cp "$OUT" "$ERR"
+	echo
+	echo "$1 generated unexpected output:"
+	cat "$ERR"
 	fail=1
-    elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then
-	echo $1 output changed:
-	diff -u $H/$1.out .out && true
-	cp .out $H/$1.err
-	fail=1
+    elif [ -r "$OUTOK" ]; then
+	if diff -u "$OUTOK" "$OUT" > /dev/null; then
+	    : no differences
+	else
+	    if FIXME="`grep 'FIXME' \"$TESTDIR/$1\"`"; then
+		echo
+		echo "$1 failed, but this is ignored because of:"
+		echo "$FIXME"
+	    else
+		cp "$OUT" "$ERR"
+		echo
+		echo "$1 output changed:"
+		diff -u "$OUTOK" "$ERR" || true
+		fail=1
+	    fi
+	fi
     fi
 
-    cd $H
-    rm -r $D
+    cd "$TESTDIR"
+    rm -f "$HGTMP/$1.out"
+    rm -rf "$HGTMP/$1"
     return $fail
 }
 
-TESTS=$@
-if [ "$TESTS" = "" ] ; then
-    TESTS=`ls test-* | grep -Ev "\.|~"`
+TESTS="$*"
+if [ -z "$TESTS" ] ; then
+    TESTS=`ls test-* | grep -v "[.~]"`
 fi
 
 for f in $TESTS ; do
     echo -n "."
-    if ! run_one $f ; then
-	failed=$[$failed + 1]
-    fi
-    tests=$[$tests + 1]
+    run_one $f || failed=`expr $failed + 1`
+    tests=`expr $tests + 1`
 done
 
-rm -rf install
-
 echo
-echo Ran $tests tests, $failed failed
+echo "Ran $tests tests, $failed failed."
 
 if [ $failed -gt 0 ] ; then
-    exit 1
+    cleanup_exit 1
 fi
-
+cleanup_exit 0
--- a/tests/test-backwards-remove	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-backwards-remove	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 hg init
 echo This is file a1 > a
 hg add a
--- a/tests/test-backwards-remove.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-backwards-remove.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,12 +1,8 @@
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ ls
++ hg commit -m commit #0 -d 0 0
 a
-+ echo This is file b1
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
++ hg commit -m commit #1 -d 0 0
 + hg co 0
-+ ls
 a
--- a/tests/test-bad-pull	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-bad-pull	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 hg clone http://localhost:20059/ copy
 echo $?
@@ -17,12 +17,9 @@
 run()
 EOF
 
-set +x # backgrounding sometimes disturbs the order of command tracing
 python dumb.py 2>/dev/null &
-set -x
 
 hg clone http://localhost:20059/foo copy2
 echo $?
 
-set +x
 kill $!
--- a/tests/test-bad-pull.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-bad-pull.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,15 +1,9 @@
 + hg clone http://localhost:20059/ copy
 requesting all changes
 abort: error: Connection refused
-+ echo 255
 255
-+ ls copy
 ls: copy: No such file or directory
-+ cat
-+ set +x
 + hg clone http://localhost:20059/foo copy2
 requesting all changes
 abort: HTTP Error 404: File not found
-+ echo 255
 255
-+ set +x
--- a/tests/test-basic	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-basic	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-set -x
 mkdir t
 cd t
 hg init
--- a/tests/test-basic.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-basic.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,9 +1,6 @@
-+ mkdir t
-+ cd t
 + hg init
-+ echo a
 + hg add a
-+ hg commit -m test -d '0 0'
++ hg commit -m test -d 0 0
 + hg history
 changeset:   0:acb14030fe0a
 tag:         tip
--- a/tests/test-clone	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-clone	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,5 @@
 #!/bin/bash
 
-set -x
 mkdir a
 cd a
 hg init
--- a/tests/test-clone-failure	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-clone-failure	Sat Jul 30 09:00:14 2005 -0800
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -x
-
 # No local source
 hg clone a b
 echo $?
--- a/tests/test-clone-failure.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-clone-failure.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,39 +1,20 @@
 + hg clone a b
 abort: repository a/.hg not found!
-+ echo 255
 255
 + hg clone http://127.0.0.1:3121/a b
 requesting all changes
 abort: error: Connection refused
-+ echo 255
 255
-+ rm -rf b
-+ mkdir a
-+ chmod 000 a
 + hg clone a b
 abort: repository a/.hg not found!
-+ echo 255
 255
-+ mkdir b
-+ cd b
 + hg init
 + hg clone . ../a
 abort: destination '../a' already exists
-+ echo 1
 1
-+ cd ..
-+ chmod 700 a
-+ rm -rf a b
-+ mkfifo a
 + hg clone a b
 abort: repository a/.hg not found!
-+ echo 255
 255
-+ rm a
-+ mkdir q
-+ cd q
 + hg init
-+ cd ..
 + hg clone q
 abort: destination 'q' already exists
-+ true
--- a/tests/test-clone.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-clone.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,12 +1,7 @@
-+ mkdir a
-+ cd a
 + hg init
-+ echo a
 + hg add a
-+ hg commit -m test -d '0 0'
++ hg commit -m test -d 0 0
 + hg clone . ../b
-+ cd ../b
-+ cat a
 a
 + hg verify
 checking changesets
@@ -15,8 +10,6 @@
 checking files
 1 files, 1 changesets, 1 total revisions
 + hg clone -U . ../c
-+ cd ../c
-+ cat a
 cat: a: No such file or directory
 + hg verify
 checking changesets
@@ -24,9 +17,6 @@
 crosschecking files in changesets and manifests
 checking files
 1 files, 1 changesets, 1 total revisions
-+ mkdir ../d
-+ cd ../d
 + hg clone ../a
-+ cd a
 + hg cat a
 a
--- a/tests/test-conflict	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-conflict	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-set -x
 hg init
 echo "nothing" > a
 hg add a
@@ -10,7 +9,7 @@
 hg co 0
 echo "something else" > a
 hg commit -m branch2 -d "0 0"
-export HGMERGE=merge
+HGMERGE=merge; export HGMERGE
 hg up -m 1
 hg id
 grep -Ev ">>>|<<<" a
--- a/tests/test-conflict.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-conflict.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,24 +1,17 @@
 + hg init
-+ echo nothing
 + hg add a
-+ hg commit -m ancestor -d '0 0'
-+ echo something
-+ hg commit -m branch1 -d '0 0'
++ hg commit -m ancestor -d 0 0
++ hg commit -m branch1 -d 0 0
 + hg co 0
-+ echo 'something else'
-+ hg commit -m branch2 -d '0 0'
-+ export HGMERGE=merge
-+ HGMERGE=merge
++ hg commit -m branch2 -d 0 0
 + hg up -m 1
 merge: warning: conflicts during merge
 merging a
 merging a failed!
 + hg id
 32e80765d7fe+75234512624c+ tip
-+ grep -Ev '>>>|<<<' a
 something else
 =======
 something
 + hg status
 M a
-? .out
--- a/tests/test-copy	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-copy	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-set -x
 hg init
 echo a > a
 hg add a
@@ -12,7 +11,7 @@
 hg --debug commit -m "2" -d "0 0"
 hg history
 hg log a
-hexdump -C .hg/data/b.d
+md5sum .hg/data/b.d
 hg cat b > bsum
 md5sum bsum
 hg cat a > asum
--- a/tests/test-copy.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-copy.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,15 +1,11 @@
 + hg init
-+ echo a
 + hg add a
-+ hg commit -m 1 -d '0 0'
++ hg commit -m 1 -d 0 0
 + hg status
-? .out
-+ cp a b
 + hg copy a b
 + hg status
 A b
-? .out
-+ hg --debug commit -m 2 -d '0 0'
++ hg --debug commit -m 2 -d 0 0
 b
  b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
 + hg history
@@ -30,19 +26,9 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     1
 
-+ hexdump -C .hg/data/b.d
-00000000  75 01 0a 63 6f 70 79 72  65 76 3a 20 62 37 38 39  |u..copyrev: b789|
-00000010  66 64 64 39 36 64 63 32  66 33 62 64 32 32 39 63  |fdd96dc2f3bd229c|
-00000020  31 64 64 38 65 65 64 66  30 66 63 36 30 65 32 62  |1dd8eedf0fc60e2b|
-00000030  36 38 65 33 0a 63 6f 70  79 3a 20 61 0a 01 0a 61  |68e3.copy: a...a|
-00000040  0a                                                |.|
-00000041
-+ hg cat b
-+ md5sum bsum
-60b725f10c9c85c70d97880dfe8191b3  bsum
-+ hg cat a
-+ md5sum asum
-60b725f10c9c85c70d97880dfe8191b3  asum
+566e338d09a089ba737c21e0d3759980  .hg/data/b.d
+3268d2f51b2d2d423ff01b59eb6fbb14  bsum
+70909ca2ecf494c71e9184b445e040ee  asum
 + hg verify
 checking changesets
 checking manifests
--- a/tests/test-diffdir	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-diffdir	Sat Jul 30 09:00:14 2005 -0800
@@ -7,6 +7,6 @@
 
 echo 123 > b
 hg add b
-hg diff | sed "s/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/"
+hg diff | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
 
-hg diff -r tip | sed "s/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/"
+hg diff -r tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
--- a/tests/test-diffdir.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-diffdir.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,8 +1,14 @@
++ hg init
++ hg add a
++ hg ci -m a -d 0 0
++ hg add b
++ hg diff
 diff -r 3903775176ed b
 --- /dev/null
 +++ b/b
 @@ -0,0 +1,1 @@
 +123
++ hg diff -r tip
 diff -r 3903775176ed b
 --- /dev/null
 +++ b/b
--- a/tests/test-empty-dir.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-empty-dir.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,3 +1,9 @@
++ hg init
++ hg add a
++ hg commit -m first -d 0 0 a
++ hg add sub/b
++ hg commit -m second -d 0 0 sub/b
 321
++ hg co 0
 cat: sub/b: No such file or directory
 ls: sub: No such file or directory
--- a/tests/test-flags	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-flags	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -ex
+#!/bin/sh -e
 
 umask 027
 mkdir test1
--- a/tests/test-flags.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-flags.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,13 +1,6 @@
-+ umask 027
-+ mkdir test1
-+ cd test1
 + hg init
-+ touch a b
 + hg add a b
-+ hg ci -m 'added a b' -d '0 0'
-+ cd ..
-+ mkdir test2
-+ cd test2
++ hg ci -m added a b -d 0 0
 + hg init
 + hg pull ../test1
 pulling from ../test1
@@ -18,11 +11,8 @@
 added 1 changesets with 2 changes to 2 files
 (run 'hg update' to get a working copy)
 + hg co
-+ chmod +x a
-+ hg ci -m 'chmod +x a' -d '0 0'
-+ cd ../test1
-+ echo 123
-+ hg ci -m 'a updated' -d '0 0'
++ hg ci -m chmod +x a -d 0 0
++ hg ci -m a updated -d 0 0
 + hg pull ../test2
 pulling from ../test2
 searching for changes
@@ -66,7 +56,5 @@
 resolving manifests
 merging a
 resolving a
-+ ls -l ../test1/a ../test2/a
-+ cut -b 0-10
 -rwxr-x---
 -rwxr-x---
--- a/tests/test-help.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-help.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,3 +1,4 @@
++ hg help
 basic hg commands (use "hg help -v" for more):
 
  add        add the specified files on the next commit
@@ -15,6 +16,7 @@
  serve      export the repository via HTTP
  status     show changed files in the working directory
  update     update or merge working directory
++ hg -q help
 basic hg commands (use "hg help -v" for more):
 
  add        add the specified files on the next commit
@@ -32,6 +34,7 @@
  serve      export the repository via HTTP
  status     show changed files in the working directory
  update     update or merge working directory
++ hg add -h
 hg add: option -h not recognized
 hg add [FILE]...
 
@@ -41,6 +44,7 @@
    exclude path from search
 
 add the specified files on the next commit
++ hg add --skjdfks
 hg add: option --skjdfks not recognized
 hg add [FILE]...
 
@@ -50,6 +54,7 @@
    exclude path from search
 
 add the specified files on the next commit
++ hg help diff
 hg diff [-r REV1 [-r REV2]] [FILE]...
 
  -r --rev 
@@ -60,7 +65,9 @@
    exclude path from search
 
 diff working directory (or selected files)
++ hg help foo
 hg: unknown command foo
++ hg -q commands
 hg: unknown command 'commands'
 basic hg commands (use "hg help -v" for more):
 
--- a/tests/test-hook	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-hook	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 hg init
 echo "[hooks]" > .hg/hgrc
--- a/tests/test-hook.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-hook.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,9 +1,5 @@
 + hg init
-+ echo '[hooks]'
-+ echo 'precommit = echo precommit hook'
-+ echo 'commit = echo commit hook: $NODE'
-+ echo a
 + hg add a
-+ hg commit -m test -d '0 0'
++ hg commit -m test -d 0 0
 precommit hook
 commit hook: acb14030fe0a21b60322c440ad2d20cf7685a376
--- a/tests/test-hup.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-hup.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,3 +1,5 @@
++ hg init
++ hg serve --stdio
 0
 0
 adding changesets
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert	Sat Jul 30 09:00:14 2005 -0800
@@ -0,0 +1,46 @@
+#!/bin/sh
+# FIXME: This test may fail due to an uncritical bug in Mercurial.
+
+mkdir t
+cd t
+hg init
+echo "added file1" > file1
+echo "added file2" > file2
+hg add file1 file2
+hg commit -m "added file1 and file2" -d "0 0" -u user
+echo "changed file1" >> file1
+hg commit -m "changed file1" -d "0 0" -u user
+hg -q log
+hg id
+hg update -C 0
+hg id
+echo "changed file1" >> file1
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg update
+hg diff
+hg status
+hg id
+hg update -C 0
+echo "changed file1" >> file1
+HGMERGE=merge hg update
+hg diff
+hg status
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg revert -r tip
+hg diff
+hg status
+hg id
+hg update -C
+hg diff
+hg status
+hg id
+cd ..; /bin/rm -rf t
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert.out	Sat Jul 30 09:00:14 2005 -0800
@@ -0,0 +1,46 @@
++ hg init
++ hg add file1 file2
++ hg commit -m added file1 and file2 -d 0 0 -u user
++ hg commit -m changed file1 -d 0 0 -u user
++ hg -q log
+1:3aa14bbc23d90e3f8b5b639b4a43d76509bae76c
+0:8633637036c18f021d771208e16ae3508ab81d28
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ hg id
+8633637036c1
++ hg id
+8633637036c1+
++ hg revert
++ hg diff
++ hg status
++ hg id
+8633637036c1
++ hg update
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ hg update
+merging file1
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg revert
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg revert -r tip
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert2	Sat Jul 30 09:00:14 2005 -0800
@@ -0,0 +1,46 @@
+#!/bin/sh
+# FIXME: This test may fail due to an uncritical bug in Mercurial.
+
+mkdir t
+cd t
+hg init
+echo "added file1" > file1
+echo "added file2" > file2
+hg add file1 file2
+hg commit -m "added file1 and file2" -d "0 0" -u user
+echo "changed file1" >> file1
+hg commit -m "changed file1" -d "0 0" -u user
+hg -q log
+hg id
+hg update -C 0
+hg id
+echo "changed file1" >> file1
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg update
+hg diff
+hg status
+hg id
+hg update -C 0
+echo "changed file1 different" >> file1
+HGMERGE=merge hg update
+hg diff | sed -e "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" -e "s/\(<<<<<<<\|>>>>>>>\) .*/\1/"
+hg status
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg revert -r tip
+hg diff
+hg status
+hg id
+hg update -C
+hg diff
+hg status
+hg id
+cd ..; /bin/rm -rf t
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert2.out	Sat Jul 30 09:00:14 2005 -0800
@@ -0,0 +1,59 @@
++ hg init
++ hg add file1 file2
++ hg commit -m added file1 and file2 -d 0 0 -u user
++ hg commit -m changed file1 -d 0 0 -u user
++ hg -q log
+1:3aa14bbc23d90e3f8b5b639b4a43d76509bae76c
+0:8633637036c18f021d771208e16ae3508ab81d28
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ hg id
+8633637036c1
++ hg id
+8633637036c1+
++ hg revert
++ hg diff
++ hg status
++ hg id
+8633637036c1
++ hg update
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ hg update
+merge: warning: conflicts during merge
+merging file1
+merging file1 failed!
++ hg diff
+diff -r 3aa14bbc23d9 file1
+--- a/file1
++++ b/file1
+@@ -1,2 +1,6 @@
+ added file1
++<<<<<<<
++changed file1 different
++=======
+ changed file1
++>>>>>>>
++ hg status
+M file1
++ hg id
+3aa14bbc23d9+ tip
++ hg revert
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg revert -r tip
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
--- a/tests/test-merge1	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge1	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 cat <<'EOF' > merge
 #!/bin/sh
--- a/tests/test-merge1.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge1.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,82 +1,45 @@
-+ cat
-+ chmod +x merge
-+ mkdir t
-+ cd t
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
++ hg commit -m commit #1 -d 0 0
 + hg update 0
-+ echo This is file c1
 + hg add c
-+ hg commit -m 'commit #2' -d '0 0'
-+ echo This is file b1
-+ env HGMERGE=../merge hg update -m 1
-+ cd ..
-+ /bin/rm -rf t
-+ mkdir t
-+ cd t
++ hg commit -m commit #2 -d 0 0
++ hg update -m 1
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
++ hg commit -m commit #1 -d 0 0
 + hg update 0
-+ echo This is file c1
 + hg add c
-+ hg commit -m 'commit #2' -d '0 0'
-+ echo This is file b2
-+ env HGMERGE=../merge hg update -m 1
++ hg commit -m commit #2 -d 0 0
++ hg update -m 1
 merging for b
 merging b
-+ cd ..
-+ /bin/rm -rf t
-+ mkdir t
-+ cd t
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
-+ echo This is file b22
-+ hg commit -m 'commit #2' -d '0 0'
++ hg commit -m commit #1 -d 0 0
++ hg commit -m commit #2 -d 0 0
 + hg update 1
-+ echo This is file c1
 + hg add c
-+ hg commit -m 'commit #3' -d '0 0'
-+ cat b
++ hg commit -m commit #3 -d 0 0
 This is file b1
-+ echo This is file b22
-+ env HGMERGE=../merge hg update -m 2
++ hg update -m 2
 merging for b
 merging b
-+ cd ..
-+ /bin/rm -rf t
-+ mkdir t
-+ cd t
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
-+ echo This is file b22
-+ hg commit -m 'commit #2' -d '0 0'
++ hg commit -m commit #1 -d 0 0
++ hg commit -m commit #2 -d 0 0
 + hg update 1
-+ echo This is file c1
 + hg add c
-+ hg commit -m 'commit #3' -d '0 0'
-+ echo This is file b33
-+ env HGMERGE=../merge hg update -m 2
++ hg commit -m commit #3 -d 0 0
++ hg update -m 2
 merging for b
 merging b
-+ cd ..
-+ /bin/rm -rf t
--- a/tests/test-merge2	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge2	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 mkdir t
 cd t
--- a/tests/test-merge2.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge2.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,49 +1,25 @@
-+ mkdir t
-+ cd t
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
-+ rm b
++ hg commit -m commit #1 -d 0 0
 + hg update 0
-+ echo This is file b2
 + hg add b
-+ hg commit -m 'commit #2' -d '0 0'
-+ cd ..
-+ /bin/rm -rf t
-+ mkdir t
-+ cd t
++ hg commit -m commit #2 -d 0 0
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
-+ rm b
++ hg commit -m commit #1 -d 0 0
 + hg update 0
-+ echo This is file b2
-+ hg commit -A -m 'commit #2' -d '0 0'
++ hg commit -A -m commit #2 -d 0 0
 adding b
-+ cd ..
-+ /bin/rm -rf t
-+ mkdir t
-+ cd t
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
-+ rm b
++ hg commit -m commit #1 -d 0 0
 + hg remove b
 + hg update 0
-+ echo This is file b2
-+ hg commit -A -m 'commit #2' -d '0 0'
++ hg commit -A -m commit #2 -d 0 0
 adding b
-+ cd ..
-+ /bin/rm -rf t
--- a/tests/test-merge3	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge3	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 hg init
 echo This is file a1 > a
--- a/tests/test-merge3.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge3.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,11 +1,8 @@
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ touch b
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ rm b
-+ hg commit -A '-mcomment #1' -d '0 0'
-adding .out
++ hg commit -A -mcomment #1 -d 0 0
 removing b
 b never committed!
+nothing changed
--- a/tests/test-merge4	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge4	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 hg init
 echo This is file a1 > a
--- a/tests/test-merge4.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge4.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,15 +1,10 @@
 + hg init
-+ echo This is file a1
 + hg add a
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b1
++ hg commit -m commit #0 -d 0 0
 + hg add b
-+ hg commit -m 'commit #1' -d '0 0'
++ hg commit -m commit #1 -d 0 0
 + hg update 0
-+ echo This is file c1
 + hg add c
-+ hg commit -m 'commit #2' -d '0 0'
++ hg commit -m commit #2 -d 0 0
 + hg update -m 1
-+ rm b
-+ echo This is file c22
-+ hg commit -m 'commit #3' -d '0 0'
++ hg commit -m commit #3 -d 0 0
--- a/tests/test-merge5	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge5	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 mkdir t
 cd t
--- a/tests/test-merge5.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge5.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,20 +1,12 @@
-+ mkdir t
-+ cd t
 + hg init
-+ echo This is file a1
-+ echo This is file b1
 + hg add a b
-+ hg commit -m 'commit #0' -d '0 0'
-+ echo This is file b22
-+ hg commit '-mcomment #1' -d '0 0'
++ hg commit -m commit #0 -d 0 0
++ hg commit -mcomment #1 -d 0 0
 + hg update 0
-+ rm b
-+ hg commit -A '-mcomment #2' -d '0 0'
++ hg commit -A -mcomment #2 -d 0 0
 removing b
-+ yes k
 + hg update 1
 this update spans a branch affecting the following files:
  b
 aborting update spanning branches!
 (use update -m to perform a branch merge)
-+ exit 0
--- a/tests/test-merge6	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge6	Sat Jul 30 09:00:14 2005 -0800
@@ -1,11 +1,11 @@
-#!/bin/sh -x
+#!/bin/sh
 
 cat <<'EOF' > merge
 #!/bin/sh
 echo merging for `basename $1`
 EOF
 chmod +x merge
-export HGMERGE=./merge
+HGMERGE=./merge; export HGMERGE
 
 mkdir A1
 cd A1
--- a/tests/test-merge6.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-merge6.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,27 +1,12 @@
-+ cat
-+ chmod +x merge
-+ export HGMERGE=./merge
-+ HGMERGE=./merge
-+ mkdir A1
-+ cd A1
 + hg init
-+ echo This is file foo1
-+ echo This is file bar1
 + hg add foo bar
-+ hg commit -m 'commit text' -d '0 0'
-+ cd ..
++ hg commit -m commit text -d 0 0
 + hg clone A1 B1
-+ cd A1
-+ rm bar
 + hg remove bar
-+ hg commit -m 'commit test' -d '0 0'
-+ cd ../B1
-+ echo This is file foo22
-+ hg commit -m 'commit test' -d '0 0'
-+ cd ..
++ hg commit -m commit test -d 0 0
++ hg commit -m commit test -d 0 0
 + hg clone A1 A2
 + hg clone B1 B2
-+ cd A1
 + hg pull ../B1
 pulling from ../B1
 searching for changes
@@ -31,12 +16,10 @@
 added 1 changesets with 1 changes to 1 files
 (run 'hg update' to get a working copy)
 + hg update -m
-+ hg commit -m 'commit test' -d '0 0'
-+ echo bar should remain deleted.
++ hg commit -m commit test -d 0 0
 bar should remain deleted.
 + hg manifest
 6b70e9e451a5a33faad7bbebe627e46b937b7364 644 foo
-+ cd ../B2
 + hg pull ../A2
 pulling from ../A2
 searching for changes
@@ -46,8 +29,7 @@
 added 1 changesets with 0 changes to 0 files
 (run 'hg update' to get a working copy)
 + hg update -m
-+ hg commit -m 'commit test' -d '0 0'
-+ echo bar should remain deleted.
++ hg commit -m commit test -d 0 0
 bar should remain deleted.
 + hg manifest
 6b70e9e451a5a33faad7bbebe627e46b937b7364 644 foo
--- a/tests/test-pull	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-pull	Sat Jul 30 09:00:14 2005 -0800
@@ -8,6 +8,7 @@
 hg commit -m 1
 hg verify
 hg serve -p 20059 > /dev/null &
+sleep 1 # wait for server to be started
 cd ..
 
 hg clone http://localhost:20059/ copy
--- a/tests/test-pull.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-pull.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,21 +1,30 @@
++ hg init
++ hg addremove
 adding foo
++ hg commit -m 1
++ hg verify
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 1 files, 1 changesets, 1 total revisions
++ hg clone http://localhost:20059/ copy
 requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
++ hg verify
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 1 files, 1 changesets, 1 total revisions
++ hg co
 foo
++ hg manifest
 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
++ hg pull
 pulling from http://localhost:20059/
 searching for changes
 no changes found
--- a/tests/test-rawcommit1	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-rawcommit1	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 hg --debug init
 echo this is a1 > a
 hg add a
--- a/tests/test-rawcommit1.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-rawcommit1.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,15 +1,12 @@
 + hg --debug init
-+ echo this is a1
 + hg add a
-+ hg commit -m0 -d '0 0'
-+ echo this is b1
++ hg commit -m0 -d 0 0
 + hg add b
-+ hg commit -m1 -d '0 0'
++ hg commit -m1 -d 0 0
 + hg manifest 1
 05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
 54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
-+ echo this is c1
-+ hg rawcommit -p 1 -d '0 0' -m2 c
++ hg rawcommit -p 1 -d 0 0 -m2 c
 + hg manifest 2
 05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
 54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
@@ -21,8 +18,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     2
 
-+ rm b
-+ hg rawcommit -p 2 -d '0 0' -m3 b
++ hg rawcommit -p 2 -d 0 0 -m3 b
 + hg manifest 3
 05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
@@ -33,8 +29,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     3
 
-+ echo this is a22
-+ hg rawcommit -p 3 -d '0 0' -m4 a
++ hg rawcommit -p 3 -d 0 0 -m4 a
 + hg manifest 4
 d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
@@ -45,8 +40,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     4
 
-+ echo this is c22
-+ hg rawcommit -p 1 -d '0 0' -m5 c
++ hg rawcommit -p 1 -d 0 0 -m5 c
 + hg manifest 5
 05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
 54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
@@ -57,7 +51,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     4
 
-+ hg rawcommit -p 4 -p 5 -d '0 0' -m6
++ hg rawcommit -p 4 -p 5 -d 0 0 -m6
 + hg manifest 6
 d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
@@ -70,7 +64,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     6
 
-+ hg rawcommit -p 6 -d '0 0' -m7
++ hg rawcommit -p 6 -d 0 0 -m7
 + hg manifest 7
 d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
--- a/tests/test-simple-update	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-simple-update	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-set -ex
+set -e
 
 mkdir test
 cd test
--- a/tests/test-simple-update.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-simple-update.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,3 @@
-+ mkdir test
-+ cd test
-+ echo foo
 + hg init
 + hg addremove
 adding foo
@@ -12,11 +9,8 @@
 checking files
 1 files, 1 changesets, 1 total revisions
 + hg clone . ../branch
-+ cd ../branch
 + hg co
-+ echo bar
 + hg commit -m 2
-+ cd ../test
 + hg pull ../branch
 pulling from ../branch
 searching for changes
@@ -32,7 +26,6 @@
 checking files
 1 files, 2 changesets, 2 total revisions
 + hg co
-+ cat foo
 foo
 bar
 + hg manifest
--- a/tests/test-tag	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-tag	Sat Jul 30 09:00:14 2005 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 
 hg init
 echo a > a
--- a/tests/test-tag.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-tag.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,7 +1,6 @@
 + hg init
-+ echo a
 + hg add a
-+ hg commit -m test -d '0 0'
++ hg commit -m test -d 0 0
 + hg history
 changeset:   0:acb14030fe0a
 tag:         tip
@@ -9,7 +8,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     test
 
-+ hg tag -d '0 0' bleah
++ hg tag -d 0 0 bleah
 + hg history
 changeset:   1:863197ef0378
 tag:         tip
@@ -23,9 +22,7 @@
 date:        Thu Jan  1 00:00:00 1970
 summary:     test
 
-+ echo foo
-+ hg tag -d '0 0' bleah2
++ hg tag -d 0 0 bleah2
 abort: working copy of .hgtags is changed!
 (please commit .hgtags manually)
-+ echo failed
 failed
--- a/tests/test-tags	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-tags	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-set -x
 mkdir t
 cd t
 hg init
--- a/tests/test-tags.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-tags.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,32 +1,25 @@
-+ mkdir t
-+ cd t
 + hg init
 + hg id
 unknown
-+ echo a
 + hg add a
-+ hg commit -m test -d '0 0'
++ hg commit -m test -d 0 0
 + hg co
 + hg identify
 acb14030fe0a tip
-++ hg -q tip
-++ cut -d : -f 2
-+ T=acb14030fe0a21b60322c440ad2d20cf7685a376
-+ echo 'acb14030fe0a21b60322c440ad2d20cf7685a376 first'
-+ cat .hgtags
++ hg -q tip
 acb14030fe0a21b60322c440ad2d20cf7685a376 first
 + hg add .hgtags
-+ hg commit -m 'add tags' -d '0 0'
++ hg commit -m add tags -d 0 0
 + hg tags
-tip                                1:b9154636be938d3d431e75a7c906504a079bfe07
+tip                                1:b53d0e1f3043ecbccf1b9ad2cea562c1b50462b2
 first                              0:acb14030fe0a21b60322c440ad2d20cf7685a376
+hg -q tip                          ?:?
 + hg identify
-b9154636be93 tip
-+ echo bb
+b53d0e1f3043 tip
 + hg status
 M a
 + hg identify
-b9154636be93+ tip
+b53d0e1f3043+ tip
 + hg co first
 + hg id
 acb14030fe0a+ first
@@ -34,14 +27,13 @@
 acb14030fe0a21b60322c440ad2d20cf7685a376+ first
 + hg status
 M a
-+ echo 1
 + hg add b
-+ hg commit -m branch -d '0 0'
++ hg commit -m branch -d 0 0
 + hg id
 c8edf04160c7 tip
 + hg co -m 1
 + hg id
-c8edf04160c7+b9154636be93+ tip
+c8edf04160c7+b53d0e1f3043+ tip
 + hg status
 M .hgtags
 M a
--- a/tests/test-undo	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-undo	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-set -x
 mkdir t
 cd t
 hg init
--- a/tests/test-undo.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-undo.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,9 +1,6 @@
-+ mkdir t
-+ cd t
 + hg init
-+ echo a
 + hg add a
-+ hg commit -m test -d '0 0'
++ hg commit -m test -d 0 0
 + hg verify
 checking changesets
 checking manifests
--- a/tests/test-unrelated-pull.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-unrelated-pull.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,3 +1,10 @@
++ hg init
++ hg add a
++ hg commit -m a -u a -d 0 0
++ hg init
++ hg add b
++ hg commit -m b -u b -d 0 0
++ hg pull ../a
 pulling from ../a
 searching for changes
 warning: pulling from an unrelated repository!
@@ -6,6 +13,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 (run 'hg update' to get a working copy)
++ hg heads
 changeset:   1:9a79c33a9db3
 tag:         tip
 user:        a
--- a/tests/test-up-local-change	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-up-local-change	Sat Jul 30 09:00:14 2005 -0800
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-set -ex
+set -e
 mkdir r1
 cd r1
 hg init
@@ -13,7 +13,7 @@
 hg up
 echo abc > a
 hg diff > ../d
-sed "s/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/" < ../d
+sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" < ../d
 
 cd ../r1
 echo b > b
@@ -29,5 +29,5 @@
 hg parents
 hg -v history
 hg diff > ../d
-sed "s/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/" < ../d
+sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" < ../d
 
--- a/tests/test-up-local-change.out	Fri Jul 29 15:02:27 2005 -0800
+++ b/tests/test-up-local-change.out	Sat Jul 30 09:00:14 2005 -0800
@@ -1,29 +1,19 @@
-+ mkdir r1
-+ cd r1
 + hg init
-+ echo a
 + hg addremove
 adding a
-+ hg commit -m 1 -d '0 0'
++ hg commit -m 1 -d 0 0
 + hg clone . ../r2
-+ cd ../r2
 + hg up
-+ echo abc
 + hg diff
-+ sed 's/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/'
 diff -r c19d34741b0a a
 --- a/a
 +++ b/a
 @@ -1,1 +1,1 @@
 -a
 +abc
-+ cd ../r1
-+ echo b
-+ echo a2
 + hg addremove
 adding b
-+ hg commit -m 2 -d '0 0'
-+ cd ../r2
++ hg commit -m 2 -d 0 0
 + hg -q pull ../r1
 + hg status
 M a
@@ -67,7 +57,6 @@
 
 
 + hg diff
-+ sed 's/\(\(---\|+++\) [^ \t]*\)[ \t].*/\1/'
 diff -r 1e71731e6fbb a
 --- a/a
 +++ b/a