changeset 7266:e7f6401584f7

test-mq-qimport: fix URL generation under windows
author Patrick Mezard <pmezard@gmail.com>
date Sat, 25 Oct 2008 13:24:14 +0200
parents 0cf3442ee844
children 6a51ca1e05c3
files tests/test-mq-qimport
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-mq-qimport	Mon Oct 27 22:07:39 2008 +0100
+++ b/tests/test-mq-qimport	Sat Oct 25 13:24:14 2008 +0200
@@ -33,7 +33,14 @@
 hg diff > $HGTMP/url.diff
 hg revert --no-backup foo
 rm foo
-hg qimport file://$HGTMP/url.diff
+# Under unix: file:///foobar/blah
+# Under windows: file:///c:/foobar/blah
+patchurl=`echo $HGTMP/url.diff | tr '\\' /`
+expr $patchurl : "\/" > /dev/null
+if [ $? -ne 0 ]; then
+    patchurl='/'$patchurl
+fi
+hg qimport file://$patchurl
 hg qun
 
 echo % import patch that already exists