Debian Codegraph @

tests/test-locate.t

raw
1 $ hg init repo
2 $ cd repo
3 $ echo 0 > a
4 $ echo 0 > b
5 $ echo 0 > t.h
6 $ mkdir t
7 $ echo 0 > t/x
8 $ echo 0 > t/b
9 $ echo 0 > t/e.h
10 $ mkdir dir.h
11 $ echo 0 > dir.h/foo
12
13 $ hg ci -A -m m
14 adding a
15 adding b
16 adding dir.h/foo
17 adding t.h
18 adding t/b
19 adding t/e.h
20 adding t/x
21
22 $ touch nottracked
23
24 $ hg locate a
25 a
26
27 $ hg locate NONEXISTENT
28 [1]
29
30 $ hg locate
31 a
32 b
33 dir.h/foo
34 t.h
35 t/b
36 t/e.h
37 t/x
38
39 $ hg rm a
40 $ hg ci -m m
41
42 $ hg locate a
43 [1]
44 $ hg locate NONEXISTENT
45 [1]
46 $ hg locate relpath:NONEXISTENT
47 [1]
48 $ hg locate
49 b
50 dir.h/foo
51 t.h
52 t/b
53 t/e.h
54 t/x
55 $ hg locate -r 0 a
56 a
57 $ hg locate -r 0 NONEXISTENT
58 [1]
59 $ hg locate -r 0 relpath:NONEXISTENT
60 [1]
61 $ hg locate -r 0
62 a
63 b
64 dir.h/foo
65 t.h
66 t/b
67 t/e.h
68 t/x
69
70 -I/-X with relative path should work:
71
72 $ cd t
73 $ hg locate
74 b
75 dir.h/foo
76 t.h
77 t/b
78 t/e.h
79 t/x
80 $ hg locate -I ../t
81 t/b
82 t/e.h
83 t/x
84
85 Issue294: hg remove --after dir fails when dir.* also exists
86
87 $ cd ..
88 $ rm -r t
89
90 $ hg rm t/b
91
92 $ hg locate 't/**'
93 t/b
94 t/e.h
95 t/x
96
97 $ hg files
98 b
99 dir.h/foo
100 t.h
101 t/e.h
102 t/x
103 $ hg files b
104 b
105
106 -X with explicit path:
107
108 $ hg files b -X b
109 [1]
110
111 $ mkdir otherdir
112 $ cd otherdir
113
114 $ hg files path:
115 ../b
116 ../dir.h/foo
117 ../t.h
118 ../t/e.h
119 ../t/x
120 $ hg files path:.
121 ../b
122 ../dir.h/foo
123 ../t.h
124 ../t/e.h
125 ../t/x
126 $ hg files --config ui.relative-paths=yes
127 ../b
128 ../dir.h/foo
129 ../t.h
130 ../t/e.h
131 ../t/x
132 $ hg files --config ui.relative-paths=no
133 b
134 dir.h/foo
135 t.h
136 t/e.h
137 t/x
138 $ hg files --config ui.relative-paths=legacy
139 ../b
140 ../dir.h/foo
141 ../t.h
142 ../t/e.h
143 ../t/x
144
145 $ hg locate b
146 ../b
147 ../t/b
148 $ hg locate '*.h'
149 ../t.h
150 ../t/e.h
151 $ hg locate path:t/x
152 ../t/x
153 $ hg locate 're:.*\.h$'
154 ../t.h
155 ../t/e.h
156 $ hg locate -r 0 b
157 ../b
158 ../t/b
159 $ hg locate -r 0 '*.h'
160 ../t.h
161 ../t/e.h
162 $ hg locate -r 0 path:t/x
163 ../t/x
164 $ hg locate -r 0 're:.*\.h$'
165 ../t.h
166 ../t/e.h
167
168 $ hg files
169 ../b
170 ../dir.h/foo
171 ../t.h
172 ../t/e.h
173 ../t/x
174 $ hg files .
175 [1]
176
177 Fileset at null (i.e. a falsy context) shouldn't crash (issue6046)
178
179 $ hg files -r null 'set:tracked()'
180 [1]
181
182 Convert native path separator to slash (issue5572)
183
184 $ hg files -T '{path|relpath|slashpath}\n'
185 ../b
186 ../dir.h/foo
187 ../t.h
188 ../t/e.h
189 ../t/x
190
191 $ cd ../..