equal
deleted
inserted
replaced
|
1 $ mkdir t |
|
2 $ cd t |
|
3 $ hg init |
|
4 $ echo 0 > a |
|
5 $ echo 0 > b |
|
6 $ echo 0 > t.h |
|
7 $ mkdir t |
|
8 $ echo 0 > t/x |
|
9 $ echo 0 > t/b |
|
10 $ echo 0 > t/e.h |
|
11 $ mkdir dir.h |
|
12 $ echo 0 > dir.h/foo |
|
13 |
|
14 $ hg ci -A -m m |
|
15 adding a |
|
16 adding b |
|
17 adding dir.h/foo |
|
18 adding t.h |
|
19 adding t/b |
|
20 adding t/e.h |
|
21 adding t/x |
|
22 |
|
23 $ touch nottracked |
|
24 |
|
25 $ hg locate a && echo locate succeeded || echo locate failed |
|
26 a |
|
27 locate succeeded |
|
28 |
|
29 $ hg locate NONEXISTENT && echo locate succeeded || echo locate failed |
|
30 locate failed |
|
31 |
|
32 $ hg locate |
|
33 a |
|
34 b |
|
35 dir.h/foo |
|
36 t.h |
|
37 t/b |
|
38 t/e.h |
|
39 t/x |
|
40 |
|
41 $ hg rm a |
|
42 $ hg ci -m m |
|
43 |
|
44 $ hg locate a |
|
45 $ hg locate NONEXISTENT |
|
46 $ hg locate relpath:NONEXISTENT |
|
47 $ hg locate |
|
48 b |
|
49 dir.h/foo |
|
50 t.h |
|
51 t/b |
|
52 t/e.h |
|
53 t/x |
|
54 $ hg locate -r 0 a |
|
55 a |
|
56 $ hg locate -r 0 NONEXISTENT |
|
57 $ hg locate -r 0 relpath:NONEXISTENT |
|
58 $ hg locate -r 0 |
|
59 a |
|
60 b |
|
61 dir.h/foo |
|
62 t.h |
|
63 t/b |
|
64 t/e.h |
|
65 t/x |
|
66 |
|
67 -I/-X with relative path should work: |
|
68 |
|
69 $ cd t |
|
70 $ hg locate |
|
71 b |
|
72 dir.h/foo |
|
73 t.h |
|
74 t/b |
|
75 t/e.h |
|
76 t/x |
|
77 $ hg locate -I ../t |
|
78 t/b |
|
79 t/e.h |
|
80 t/x |
|
81 |
|
82 Test issue294: |
|
83 |
|
84 $ cd .. |
|
85 $ rm -r t |
|
86 |
|
87 $ hg locate 't/**' |
|
88 t/b |
|
89 t/e.h |
|
90 t/x |
|
91 |
|
92 $ mkdir otherdir |
|
93 $ cd otherdir |
|
94 |
|
95 $ hg locate b |
|
96 ../b |
|
97 ../t/b |
|
98 $ hg locate '*.h' |
|
99 ../t.h |
|
100 ../t/e.h |
|
101 $ hg locate path:t/x |
|
102 ../t/x |
|
103 $ hg locate 're:.*\.h$' |
|
104 ../t.h |
|
105 ../t/e.h |
|
106 $ hg locate -r 0 b |
|
107 ../b |
|
108 ../t/b |
|
109 $ hg locate -r 0 '*.h' |
|
110 ../t.h |
|
111 ../t/e.h |
|
112 $ hg locate -r 0 path:t/x |
|
113 ../t/x |
|
114 $ hg locate -r 0 're:.*\.h$' |
|
115 ../t.h |
|
116 ../t/e.h |
|
117 |