##// END OF EJS Templates
errors: use InputError for errors about bad paths...
Martin von Zweigbergk -
r46448:3175b0e0 default
parent child Browse files
Show More
@@ -311,7 +311,7 b' def checknewlabel(repo, lbl, kind):'
311 311 def checkfilename(f):
312 312 '''Check that the filename f is an acceptable filename for a tracked file'''
313 313 if b'\r' in f or b'\n' in f:
314 raise error.Abort(
314 raise error.InputError(
315 315 _(b"'\\n' and '\\r' disallowed in filenames: %r")
316 316 % pycompat.bytestr(f)
317 317 )
@@ -326,7 +326,7 b' def checkportable(ui, f):'
326 326 if msg:
327 327 msg = b"%s: %s" % (msg, procutil.shellquote(f))
328 328 if abort:
329 raise error.Abort(msg)
329 raise error.InputError(msg)
330 330 ui.warn(_(b"warning: %s\n") % msg)
331 331
332 332
@@ -48,7 +48,7 b' should fail'
48 48 [30]
49 49 $ hg --config ui.portablefilenames=abort add con.xml
50 50 abort: filename contains 'con', which is reserved on Windows: con.xml
51 [255]
51 [10]
52 52 $ hg st
53 53 A a
54 54 A b
@@ -68,7 +68,7 b' should fail'
68 68 $ hg --config ui.portablefilenames=abort add
69 69 adding hello:world
70 70 abort: filename contains ':', which is reserved on Windows: 'hello:world'
71 [255]
71 [10]
72 72 $ hg st
73 73 A a
74 74 A b
@@ -9,7 +9,7 b''
9 9 $ hg copy a b
10 10 $ hg --config ui.portablefilenames=abort copy a con.xml
11 11 abort: filename contains 'con', which is reserved on Windows: con.xml
12 [255]
12 [10]
13 13 $ hg status
14 14 A b
15 15 $ hg sum
@@ -12,12 +12,12 b' test issue352'
12 12 adding he\r (no-eol) (esc)
13 13 llo
14 14 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
15 [255]
15 [10]
16 16 $ hg ci -A -m m
17 17 adding he\r (no-eol) (esc)
18 18 llo
19 19 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
20 [255]
20 [10]
21 21 $ rm "$A"
22 22 $ echo foo > "hell
23 23 > o"
@@ -25,12 +25,12 b' test issue352'
25 25 adding hell
26 26 o
27 27 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
28 [255]
28 [10]
29 29 $ hg ci -A -m m
30 30 adding hell
31 31 o
32 32 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
33 [255]
33 [10]
34 34 $ echo foo > "$A"
35 35 $ hg debugwalk -v
36 36 * matcher:
@@ -48,10 +48,10 b' test issue352'
48 48 $ A=`printf 'quick\rfox'`
49 49 $ hg cp quickfox "$A"
50 50 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
51 [255]
51 [10]
52 52 $ hg mv quickfox "$A"
53 53 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
54 [255]
54 [10]
55 55
56 56 https://bz.mercurial-scm.org/2036
57 57
@@ -13,7 +13,7 b' rename a single file'
13 13 $ hg rename d1/d11/a1 d2/c
14 14 $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml
15 15 abort: filename contains 'con', which is reserved on Windows: d1/con.xml
16 [255]
16 [10]
17 17 $ hg sum
18 18 parent: 0:9b4b6e7b2c26 tip
19 19 1
General Comments 0
You need to be logged in to leave comments. Login now