# HG changeset patch # User Mads Kiilerich # Date 2011-11-16 02:45:14 # Node ID cf0f3cb8a332e7d6ea4c9f80d7a4fa33768c6b15 # Parent 117f9190c1ba3be735041707176136ad74258e63 tests: don't use stdout redirection for test data Stdout redirection is not binary safe everywhere - for example not on windows with msys. diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -10,7 +10,7 @@ Prepare repo a: Create a non-inlined filelog: - $ python -c 'for x in range(10000): print x' >> data1 + $ python -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))' $ for j in 0 1 2 3 4 5 6 7 8 9; do > cat data1 >> b > hg commit -m test diff --git a/tests/test-diff-newlines.t b/tests/test-diff-newlines.t --- a/tests/test-diff-newlines.t +++ b/tests/test-diff-newlines.t @@ -1,6 +1,6 @@ $ hg init - $ python -c 'print "confuse str.splitlines\nembedded\rnewline"' > a + $ python -c 'file("a", "wb").write("confuse str.splitlines\nembedded\rnewline\n")' $ hg ci -Ama -d '1 0' adding a diff --git a/tests/test-import.t b/tests/test-import.t --- a/tests/test-import.t +++ b/tests/test-import.t @@ -233,7 +233,7 @@ override commit message > msg.set_payload('email commit message\n' + patch) > msg['Subject'] = 'email patch' > msg['From'] = 'email patcher' - > sys.stdout.write(msg.as_string()) + > file(sys.argv[2], 'wb').write(msg.as_string()) > EOF @@ -246,7 +246,7 @@ plain diff in email, subject, message bo added 1 changesets with 2 changes to 2 files updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ python mkmsg.py diffed-tip.patch > msg.patch + $ python mkmsg.py diffed-tip.patch msg.patch $ hg --cwd b import ../msg.patch applying ../msg.patch $ hg --cwd b tip | grep email @@ -308,7 +308,8 @@ hg export in email, should use patch hea added 1 changesets with 2 changes to 2 files updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ python mkmsg.py exported-tip.patch | hg --cwd b import - + $ python mkmsg.py exported-tip.patch msg.patch + $ cat msg.patch | hg --cwd b import - applying patch from stdin $ hg --cwd b tip | grep second summary: second change @@ -325,7 +326,7 @@ The '---' tests the gitsendmail handling > msg.set_payload('email patch\n\nnext line\n---\n' + patch) > msg['Subject'] = '[PATCH] email patch' > msg['From'] = 'email patcher' - > sys.stdout.write(msg.as_string()) + > file(sys.argv[2], 'wb').write(msg.as_string()) > EOF @@ -338,7 +339,8 @@ plain diff in email, [PATCH] subject, me added 1 changesets with 2 changes to 2 files updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ python mkmsg2.py diffed-tip.patch | hg --cwd b import - + $ python mkmsg2.py diffed-tip.patch msg.patch + $ cat msg.patch | hg --cwd b import - applying patch from stdin $ hg --cwd b tip --template '{desc}\n' email patch