This instance will be upgraded to Heptapod 0.21.0rc3 on 2021-04-23 at 10:30 UTC+2 (a few minutes of down time)

Commit 09b86d88 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk

errors: use InputError for errors about bad paths

Differential Revision: https://phab.mercurial-scm.org/D9326
parent c7abdbc8fd47
......@@ -311,7 +311,7 @@ def checknewlabel(repo, lbl, kind):
def checkfilename(f):
'''Check that the filename f is an acceptable filename for a tracked file'''
if b'\r' in f or b'\n' in f:
raise error.Abort(
raise error.InputError(
_(b"'\\n' and '\\r' disallowed in filenames: %r")
% pycompat.bytestr(f)
)
......@@ -326,7 +326,7 @@ def checkportable(ui, f):
if msg:
msg = b"%s: %s" % (msg, procutil.shellquote(f))
if abort:
raise error.Abort(msg)
raise error.InputError(msg)
ui.warn(_(b"warning: %s\n") % msg)
......
......@@ -48,7 +48,7 @@ should fail
[30]
$ hg --config ui.portablefilenames=abort add con.xml
abort: filename contains 'con', which is reserved on Windows: con.xml
[255]
[10]
$ hg st
A a
A b
......@@ -68,7 +68,7 @@ should fail
$ hg --config ui.portablefilenames=abort add
adding hello:world
abort: filename contains ':', which is reserved on Windows: 'hello:world'
[255]
[10]
$ hg st
A a
A b
......
......@@ -9,7 +9,7 @@
$ hg copy a b
$ hg --config ui.portablefilenames=abort copy a con.xml
abort: filename contains 'con', which is reserved on Windows: con.xml
[255]
[10]
$ hg status
A b
$ hg sum
......
......@@ -12,12 +12,12 @@ test issue352
adding he\r (no-eol) (esc)
llo
abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
[255]
[10]
$ hg ci -A -m m
adding he\r (no-eol) (esc)
llo
abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
[255]
[10]
$ rm "$A"
$ echo foo > "hell
> o"
......@@ -25,12 +25,12 @@ test issue352
adding hell
o
abort: '\n' and '\r' disallowed in filenames: 'hell\no'
[255]
[10]
$ hg ci -A -m m
adding hell
o
abort: '\n' and '\r' disallowed in filenames: 'hell\no'
[255]
[10]
$ echo foo > "$A"
$ hg debugwalk -v
* matcher:
......@@ -48,10 +48,10 @@ test issue352
$ A=`printf 'quick\rfox'`
$ hg cp quickfox "$A"
abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
[255]
[10]
$ hg mv quickfox "$A"
abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
[255]
[10]
https://bz.mercurial-scm.org/2036
......
......@@ -13,7 +13,7 @@ rename a single file
$ hg rename d1/d11/a1 d2/c
$ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml
abort: filename contains 'con', which is reserved on Windows: d1/con.xml
[255]
[10]
$ hg sum
parent: 0:9b4b6e7b2c26 tip
1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment