comparison tests/test-add.t @ 13962:8b252e826c68

add: introduce a warning message for non-portable filenames (issue2756) (BC) On POSIX platforms, the 'add', 'addremove', 'copy' and 'rename' commands now warn if a file has a name that can't be checked out on Windows. Example: $ hg add con.xml warning: filename contains 'con', which is reserved on Windows: 'con.xml' $ hg status A con.xml The file is added despite the warning. The warning is ON by default. It can be suppressed by setting the config option 'portablefilenames' in section 'ui' to 'ignore' or 'false': $ hg --config ui.portablefilenames=ignore add con.xml $ hg sta A con.xml If ui.portablefilenames is set to 'abort', then the command is aborted: $ hg --config ui.portablefilenames=abort add con.xml abort: filename contains 'con', which is reserved on Windows: 'con.xml' On Windows, the ui.portablefilenames config setting is irrelevant and the command is always aborted if a problematic filename is found.
author Adrian Buehlmann <adrian@cadifra.com>
date Tue, 19 Apr 2011 12:42:53 +0200
parents 4fee1fd3de9a
children e1f05d7a8c7b
comparison
equal deleted inserted replaced
13961:1708a0cad774 13962:8b252e826c68
30 $ hg add b 30 $ hg add b
31 b already tracked! 31 b already tracked!
32 $ hg st 32 $ hg st
33 A a 33 A a
34 A b 34 A b
35
36 $ echo foo > con.xml
37 $ hg --config ui.portablefilenames=jump add con.xml
38 abort: ui.portablefilenames value is invalid ('jump')
39 [255]
40 $ hg --config ui.portablefilenames=abort add con.xml
41 abort: filename contains 'con', which is reserved on Windows: 'con.xml'
42 [255]
43 $ hg st
44 A a
45 A b
46 ? con.xml
47 $ hg add con.xml
48 warning: filename contains 'con', which is reserved on Windows: 'con.xml'
49 $ hg st
50 A a
51 A b
52 A con.xml
53 $ echo bla > 'hello:world'
54 $ hg --config ui.portablefilenames=abort add
55 adding hello:world
56 abort: filename contains ':', which is reserved on Windows: 'hello:world'
57 [255]
58 $ hg st
59 A a
60 A b
61 A con.xml
62 ? hello:world
63 $ hg --config ui.portablefilenames=ignore add
64 adding hello:world
65 $ hg st
66 A a
67 A b
68 A con.xml
69 A hello:world
35 70
36 $ hg ci -m 0 --traceback 71 $ hg ci -m 0 --traceback
37 72
38 should fail 73 should fail
39 74