diff tests/test-mq-qimport.t @ 14396:170747a3e139

mq: strip all leading slashes from url when importing When trying to import a url that ends with a slash os.path.basename() would return an empty string. So when seeing a leading slash, remove it and infer the patch name from the remaining url. e.g. `hg qimport http://paste.pocoo.org/raw/xxx/` deduced '.' to be the patch name. Now we'll deduce 'xxx'.
author Idan Kamara <idankk86@gmail.com>
date Fri, 20 May 2011 21:20:24 +0300
parents dc961471efde
children c5c9ca3719f9
line wrap: on
line diff
--- a/tests/test-mq-qimport.t	Fri May 20 21:19:33 2011 +0300
+++ b/tests/test-mq-qimport.t	Fri May 20 21:20:24 2011 +0300
@@ -208,3 +208,20 @@
   $ hg qimport non-existant-file --name .hg
   abort: patch name cannot begin with ".hg"
   [255]
+
+qimport http:// patch with leading slashes in url
+
+set up hgweb
+
+  $ cd ..
+  $ hg init served
+  $ cd served
+  $ echo a > a
+  $ hg ci -Am patch
+  adding a
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+  $ cd ../repo
+  $ hg qimport http://localhost:$HGPORT/raw-rev/0///
+  adding 0 to series file