Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
14395:dc961471efde | 14396:170747a3e139 |
---|---|
206 qimport with bad name, should abort before reading file | 206 qimport with bad name, should abort before reading file |
207 | 207 |
208 $ hg qimport non-existant-file --name .hg | 208 $ hg qimport non-existant-file --name .hg |
209 abort: patch name cannot begin with ".hg" | 209 abort: patch name cannot begin with ".hg" |
210 [255] | 210 [255] |
211 | |
212 qimport http:// patch with leading slashes in url | |
213 | |
214 set up hgweb | |
215 | |
216 $ cd .. | |
217 $ hg init served | |
218 $ cd served | |
219 $ echo a > a | |
220 $ hg ci -Am patch | |
221 adding a | |
222 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
223 $ cat hg.pid >> $DAEMON_PIDS | |
224 | |
225 $ cd ../repo | |
226 $ hg qimport http://localhost:$HGPORT/raw-rev/0/// | |
227 adding 0 to series file |