summaryrefslogtreecommitdiff
path: root/tests/test-locate.t
blob: 0f5bf87034a364125ca72bcf250d20f3aad9b9e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
  $ hg init t
  $ cd t
  $ echo 0 > a
  $ echo 0 > b
  $ echo 0 > t.h
  $ mkdir t
  $ echo 0 > t/x
  $ echo 0 > t/b
  $ echo 0 > t/e.h
  $ mkdir dir.h
  $ echo 0 > dir.h/foo

  $ hg ci -A -m m
  adding a
  adding b
  adding dir.h/foo
  adding t.h
  adding t/b
  adding t/e.h
  adding t/x

  $ touch nottracked

  $ hg locate a
  a

  $ hg locate NONEXISTENT
  [1]

  $ hg locate
  a
  b
  dir.h/foo
  t.h
  t/b
  t/e.h
  t/x

  $ hg rm a
  $ hg ci -m m

  $ hg locate a
  [1]
  $ hg locate NONEXISTENT
  [1]
  $ hg locate relpath:NONEXISTENT
  [1]
  $ hg locate
  b
  dir.h/foo
  t.h
  t/b
  t/e.h
  t/x
  $ hg locate -r 0 a
  a
  $ hg locate -r 0 NONEXISTENT
  [1]
  $ hg locate -r 0 relpath:NONEXISTENT
  [1]
  $ hg locate -r 0
  a
  b
  dir.h/foo
  t.h
  t/b
  t/e.h
  t/x

-I/-X with relative path should work:

  $ cd t
  $ hg locate
  b
  dir.h/foo
  t.h
  t/b
  t/e.h
  t/x
  $ hg locate -I ../t
  t/b
  t/e.h
  t/x

Issue294: hg remove --after dir fails when dir.* also exists

  $ cd ..
  $ rm -r t

  $ hg locate 't/**'
  t/b
  t/e.h
  t/x

  $ mkdir otherdir
  $ cd otherdir

  $ hg locate b
  ../b
  ../t/b
  $ hg locate '*.h'
  ../t.h
  ../t/e.h
  $ hg locate path:t/x
  ../t/x
  $ hg locate 're:.*\.h$'
  ../t.h
  ../t/e.h
  $ hg locate -r 0 b
  ../b
  ../t/b
  $ hg locate -r 0 '*.h'
  ../t.h
  ../t/e.h
  $ hg locate -r 0 path:t/x
  ../t/x
  $ hg locate -r 0 're:.*\.h$'
  ../t.h
  ../t/e.h