[PATCH] tests: unify test-pull

Adrian Buehlmann adrian at cadifra.com
Sun Sep 12 13:11:45 CDT 2010


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1284315058 -7200
# Node ID e537facd26f6b173b745de40f5aa459924da7844
# Parent  c26c8f8c118bc0c9f5febda48d028de15be81381
tests: unify test-pull

diff --git a/tests/test-pull.out b/tests/test-pull.out
deleted file mode 100644
--- a/tests/test-pull.out
+++ /dev/null
@@ -1,35 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
-pulling from http://foo:***@localhost:$HGPORT/
-searching for changes
-no changes found
-rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
-% issue 622
-pulling from ../test
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test file: uri handling
-abort: repository /test-doesnt-exist not found!
diff --git a/tests/test-pull b/tests/test-pull.t
old mode 100755
new mode 100644
rename from tests/test-pull
rename to tests/test-pull.t
--- a/tests/test-pull
+++ b/tests/test-pull.t
@@ -1,36 +1,80 @@
-#!/bin/sh
+  $ mkdir test
+  $ cd test
 
-mkdir test
-cd test
-echo foo>foo
-hg init
-hg addremove
-hg commit -m 1
-hg verify
-hg serve -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-cd ..
+  $ echo foo>foo
+  $ hg init
+  $ hg addremove
+  adding foo
+  $ hg commit -m 1
 
-hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-cd copy
-hg verify
-hg co
-cat foo
-hg manifest --debug
-hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
 
-echo % issue 622
-cd ..
-hg init empty
-cd empty
-hg pull -u ../test
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ cd ..
 
-echo % test file: uri handling
-hg pull -q file://../test-doesnt-exist 2>&1 \
-    | sed 's%abort: repository.*/test-doesnt-exist%abort: repository /test-doesnt-exist%'
-hg pull -q file:../test
+  $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd copy
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg co
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat foo
+  foo
+
+  $ hg manifest --debug
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
+
+  $ hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  pulling from http://foo:***@localhost:$HGPORT/
+  searching for changes
+  no changes found
+
+  $ hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
+
+Issue 622:
+
+  $ cd ..
+  $ hg init empty
+  $ cd empty
+  $ hg pull -u ../test
+  pulling from ../test
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Test 'file:' uri handling:
+
+  $ hg pull -q file://../test-doesnt-exist
+  abort: repository /test-doesnt-exist not found!
+
+  $ hg pull -q file:../test
+
 # It's tricky to make file:// URLs working on every platforms
 # with regular shell commands.
-URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
-hg pull -q "$URL"
+
+  $ URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
+  $ hg pull -q "$URL"
+


More information about the Mercurial-devel mailing list