comparison tests/test-hgignore.t @ 12312:83a310f2f14a

tests: unify test-hgignore
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 15 Sep 2010 22:18:46 +0200
parents tests/test-hgignore@31abcae33b4f
children c01dc9087d9a
comparison
equal deleted inserted replaced
12311:8afbf44cfe86 12312:83a310f2f14a
1 $ hg init
2
3 Test issue 562: .hgignore requires newline at end:
4
5 $ touch foo
6 $ touch bar
7 $ touch baz
8 $ cat > makeignore.py <<EOF
9 > f = open(".hgignore", "w")
10 > f.write("ignore\n")
11 > f.write("foo\n")
12 > # No EOL here
13 > f.write("bar")
14 > f.close()
15 > EOF
16
17 $ python makeignore.py
18
19 Should display baz only:
20
21 $ hg status
22 ? baz
23
24 $ rm foo bar baz .hgignore makeignore.py
25
26 $ touch a.o
27 $ touch a.c
28 $ touch syntax
29 $ mkdir dir
30 $ touch dir/a.o
31 $ touch dir/b.o
32 $ touch dir/c.o
33
34 $ hg add dir/a.o
35 $ hg commit -m 0
36 $ hg add dir/b.o
37
38 $ hg status
39 A dir/b.o
40 ? a.c
41 ? a.o
42 ? dir/c.o
43 ? syntax
44
45 $ echo "*.o" > .hgignore
46 $ hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/'
47 abort: .hgignore: invalid pattern (relre): *.o
48
49 $ echo ".*\.o" > .hgignore
50 $ hg status
51 A dir/b.o
52 ? .hgignore
53 ? a.c
54 ? syntax
55
56 Check it does not ignore the current directory '.':
57
58 $ echo "^\." > .hgignore
59 $ hg status
60 A dir/b.o
61 ? a.c
62 ? a.o
63 ? dir/c.o
64 ? syntax
65
66 $ echo "glob:**.o" > .hgignore
67 $ hg status
68 A dir/b.o
69 ? .hgignore
70 ? a.c
71 ? syntax
72
73 $ echo "glob:*.o" > .hgignore
74 $ hg status
75 A dir/b.o
76 ? .hgignore
77 ? a.c
78 ? syntax
79
80 $ echo "syntax: glob" > .hgignore
81 $ echo "re:.*\.o" >> .hgignore
82 $ hg status
83 A dir/b.o
84 ? .hgignore
85 ? a.c
86 ? syntax
87
88 $ echo "syntax: invalid" > .hgignore
89 $ hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
90 .hgignore: ignoring invalid syntax 'invalid'
91 A dir/b.o
92 ? .hgignore
93 ? a.c
94 ? a.o
95 ? dir/c.o
96 ? syntax
97
98 $ echo "syntax: glob" > .hgignore
99 $ echo "*.o" >> .hgignore
100 $ hg status
101 A dir/b.o
102 ? .hgignore
103 ? a.c
104 ? syntax
105
106 $ echo "relglob:syntax*" > .hgignore
107 $ hg status
108 A dir/b.o
109 ? .hgignore
110 ? a.c
111 ? a.o
112 ? dir/c.o
113
114 $ echo "relglob:*" > .hgignore
115 $ hg status
116 A dir/b.o
117
118 $ cd dir
119 $ hg status .
120 A b.o
121