##// END OF EJS Templates
scheme: don't crash on invalid URLs
Mads Kiilerich -
r18910:b52404a9 default
parent child Browse files
Show More
@@ -62,7 +62,10 class ShortRepository(object):
62
62
63 def instance(self, ui, url, create):
63 def instance(self, ui, url, create):
64 # Should this use the util.url class, or is manual parsing better?
64 # Should this use the util.url class, or is manual parsing better?
65 try:
65 url = url.split('://', 1)[1]
66 url = url.split('://', 1)[1]
67 except IndexError:
68 raise util.Abort(_("no '://' in scheme url '%s'") % url)
66 parts = url.split('/', self.parts)
69 parts = url.split('/', self.parts)
67 if len(parts) > self.parts:
70 if len(parts) > self.parts:
68 tail = parts[-1]
71 tail = parts[-1]
@@ -14,6 +14,15
14 $ echo a > a
14 $ echo a > a
15 $ hg ci -Am initial
15 $ hg ci -Am initial
16 adding a
16 adding a
17
18 invalid scheme
19
20 $ hg log -R z:z
21 abort: no '://' in scheme url 'z:z'
22 [255]
23
24 http scheme
25
17 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
26 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
18 $ cat hg.pid >> $DAEMON_PIDS
27 $ cat hg.pid >> $DAEMON_PIDS
19 $ hg incoming l://
28 $ hg incoming l://
General Comments 0
You need to be logged in to leave comments. Login now