Debian Codegraph @

tests/test-eolfilename.t

raw
1 #require eol-in-paths
2
3 https://bz.mercurial-scm.org/352
4
5 test issue352
6
7 $ hg init foo
8 $ cd foo
9 $ A=`printf 'he\rllo'`
10 $ echo foo > "$A"
11 $ hg add
12 adding he\r (no-eol) (esc)
13 llo
14 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
15 [10]
16 $ hg ci -A -m m
17 adding he\r (no-eol) (esc)
18 llo
19 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
20 [10]
21 $ rm "$A"
22 $ echo foo > "hell
23 > o"
24 $ hg add
25 adding hell
26 o
27 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
28 [10]
29 $ hg ci -A -m m
30 adding hell
31 o
32 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
33 [10]
34 $ echo foo > "$A"
35 $ hg debugwalk -v
36 * matcher:
37 <alwaysmatcher>
38 f he\r (no-eol) (esc)
39 llo he\r (no-eol) (esc)
40 llo
41 f hell
42 o hell
43 o
44
45 $ echo bla > quickfox
46 $ hg add quickfox
47 $ hg ci -m 2
48 $ A=`printf 'quick\rfox'`
49 $ hg cp quickfox "$A"
50 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
51 [10]
52 $ hg mv quickfox "$A"
53 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
54 [10]
55
56 https://bz.mercurial-scm.org/2036
57
58 $ cd ..
59
60 test issue2039
61
62 $ hg init bar
63 $ cd bar
64 $ cat <<EOF >> $HGRCPATH
65 > [extensions]
66 > color =
67 > [color]
68 > mode = ansi
69 > EOF
70 $ A=`printf 'foo\nbar'`
71 $ B=`printf 'foo\nbar.baz'`
72 $ touch "$A"
73 $ touch "$B"
74 $ hg status --color=always
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc)
76 \x1b[0;35;1;4mbar\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc)
78 \x1b[0;35;1;4mbar.baz\x1b[0m (esc)
79
80 $ cd ..