--- a/tests/test-mq-qimport.t Fri Mar 10 16:18:43 2017 -0800
+++ b/tests/test-mq-qimport.t Mon Mar 20 11:38:37 2017 +0900
@@ -247,11 +247,28 @@
this-name-is-better
url.diff
+import patch of bad filename
+
+ $ touch '../ bad.diff'
+ $ hg qimport '../ bad.diff'
+ abort: patch name cannot begin or end with whitespace
+ [255]
+ $ touch '.hg/patches/ bad.diff'
+ $ hg qimport -e ' bad.diff'
+ abort: patch name cannot begin or end with whitespace
+ [255]
+
qimport with bad name, should abort before reading file
$ hg qimport non-existent-file --name .hg
abort: patch name cannot begin with ".hg"
[255]
+ $ hg qimport non-existent-file --name ' foo'
+ abort: patch name cannot begin or end with whitespace
+ [255]
+ $ hg qimport non-existent-file --name 'foo '
+ abort: patch name cannot begin or end with whitespace
+ [255]
qimport http:// patch with leading slashes in url