##// END OF EJS Templates
tests: extend revset test
Matt Mackall -
r11419:3cc2e34d default
parent child Browse files
Show More
@@ -1,28 +1,61 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 HGENCODING=utf-8
4 export HGENCODING
5
3 try() {
6 try() {
4 echo '% hg debugrevspec' $@
7 echo '% hg debugrevspec' $@
5 hg debugrevspec $@
8 hg debugrevspec --debug $@
9 }
10
11 log() {
12 echo "% log '$1'"
13 hg log --template '{rev}\n' -r "$1"
6 }
14 }
7
15
8 hg init repo
16 hg init repo
9 cd repo
17 cd repo
18
19 echo a > a
10 hg branch a
20 hg branch a
11 hg ci -m "plain name"
21 hg ci -Aqm0
22
23 echo b > b
12 hg branch b
24 hg branch b
13 hg ci -m "another plain name"
25 hg ci -Aqm1
26
27 rm a
14 hg branch a-b-c-
28 hg branch a-b-c-
15 hg ci -m "with dashes"
29 hg ci -Aqm2 -u Bob
30
31 hg co 1
32 hg branch +a+b+c+
33 hg ci -Aqm3
34
35 hg co 2 # interleave
36 echo bb > b
16 hg branch -- -a-b-c-
37 hg branch -- -a-b-c-
17 hg ci -m "with leading dash"
38 hg ci -Aqm4 -d "May 12 2005"
18 hg branch +a+b+c+
39
19 hg ci -m "with plusses"
40 hg co 3
20 hg branch /a/b/c/
41 hg branch /a/b/c/
21 hg ci -m "with slashes"
42 hg ci -Aqm"5 bug"
43
44 hg merge 4
22 hg branch _a_b_c_
45 hg branch _a_b_c_
23 hg ci -m "with underscores"
46 hg ci -Aqm"6 issue619"
47
24 hg branch .a.b.c.
48 hg branch .a.b.c.
25 hg ci -m "with dots"
49 hg ci -Aqm7
50
51 hg branch all
52 hg ci --close-branch -Aqm8
53
54 hg co 4
55 hg branch Γ©
56 hg ci -Aqm9
57
58 hg tag -r6 1.0
26
59
27 # names that should work without quoting
60 # names that should work without quoting
28 try a
61 try a
@@ -31,8 +64,65 b' try _a_b_c_'
31 try _a_b_c_-a
64 try _a_b_c_-a
32 try .a.b.c.
65 try .a.b.c.
33 try .a.b.c.-a
66 try .a.b.c.-a
67 try -- '-a-b-c-' # complains
68 log -a-b-c- # succeeds with fallback
69 try -- -a-b-c--a # complains
70 try Γ©
34
71
35 # quoting needed
72 # quoting needed
36 try '"-a-b-c-"'
37 try '"-a-b-c-"-a'
73 try '"-a-b-c-"-a'
38
74
75 log '1 or 2'
76 log '1|2'
77 log '1 and 2'
78 log '1&2'
79 try '1&2|3' # precedence - and is higher
80 try '1|2&3'
81 try '1&2&3' # associativity
82 try '1|(2|3)'
83 log '1.0' # tag
84 log 'a' # branch
85 log '2785f51ee'
86 log 'date(2005)'
87 log 'date(this is a test)'
88 log 'date()'
89 log 'date'
90 log 'date('
91 log 'date(tip)'
92 log '"date"'
93 log 'date(2005) and 1::'
94
95 log 'ancestor(1)'
96 log 'ancestor(4,5)'
97 log 'ancestors(5)'
98 log 'author(bob)'
99 log 'branch(Γ©)'
100 log 'children(ancestor(4,5))'
101 log 'closed()'
102 log 'contains(a)'
103 log 'descendants(2 or 3)'
104 log 'file(b)'
105 log 'follow()'
106 log 'grep("issue\d+")'
107 log 'head()'
108 log 'heads(6::)'
109 log 'keyword(issue)'
110 log 'limit(head(), 1)'
111 log 'max(contains(a))'
112 log 'merge()'
113 log 'modifies(b)'
114 log 'p1(merge())'
115 log 'p2(merge())'
116 log 'parents(merge())'
117 log 'removes(a)'
118 log 'roots(all())'
119 log 'reverse(2 or 3 or 4 or 5)'
120 log 'sort(limit(reverse(all()), 3))'
121 log 'sort(2 or 3 or 4 or 5, date)'
122 log 'tagged()'
123 log 'user(bob)'
124
125 log '4::8'
126 log '4:8'
127
128 log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
@@ -1,24 +1,200 b''
1 marked working directory as branch a
1 marked working directory as branch a
2 marked working directory as branch b
2 marked working directory as branch b
3 marked working directory as branch a-b-c-
3 marked working directory as branch a-b-c-
4 marked working directory as branch -a-b-c-
4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 marked working directory as branch +a+b+c+
5 marked working directory as branch +a+b+c+
6 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
7 marked working directory as branch -a-b-c-
8 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
6 marked working directory as branch /a/b/c/
9 marked working directory as branch /a/b/c/
10 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
11 (branch merge, don't forget to commit)
7 marked working directory as branch _a_b_c_
12 marked working directory as branch _a_b_c_
8 marked working directory as branch .a.b.c.
13 marked working directory as branch .a.b.c.
14 marked working directory as branch all
15 abort: can only close branch heads
16 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 marked working directory as branch Γ©
9 % hg debugrevspec a
18 % hg debugrevspec a
19 ('symbol', 'a')
10 0
20 0
11 % hg debugrevspec b-a
21 % hg debugrevspec b-a
22 ('minus', ('symbol', 'b'), ('symbol', 'a'))
12 1
23 1
13 % hg debugrevspec _a_b_c_
24 % hg debugrevspec _a_b_c_
25 ('symbol', '_a_b_c_')
14 6
26 6
15 % hg debugrevspec _a_b_c_-a
27 % hg debugrevspec _a_b_c_-a
28 ('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
16 6
29 6
17 % hg debugrevspec .a.b.c.
30 % hg debugrevspec .a.b.c.
31 ('symbol', '.a.b.c.')
18 7
32 7
19 % hg debugrevspec .a.b.c.-a
33 % hg debugrevspec .a.b.c.-a
34 ('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
20 7
35 7
21 % hg debugrevspec "-a-b-c-"
36 % hg debugrevspec -- -a-b-c-
37 hg: parse error at 7: not a prefix: end
38 % log '-a-b-c-'
39 4
40 % hg debugrevspec -- -a-b-c--a
41 ('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
42 abort: unknown revision '-a'!
43 % hg debugrevspec Γ©
44 ('symbol', '\xc3\xa9')
45 9
46 % hg debugrevspec "-a-b-c-"-a
47 ('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
48 4
49 % log '1 or 2'
50 1
51 2
52 % log '1|2'
53 1
54 2
55 % log '1 and 2'
56 % log '1&2'
57 % hg debugrevspec 1&2|3
58 ('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
59 3
60 % hg debugrevspec 1|2&3
61 ('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
62 1
63 % hg debugrevspec 1&2&3
64 ('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
65 % hg debugrevspec 1|(2|3)
66 ('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
67 1
68 2
69 3
70 % log '1.0'
71 6
72 % log 'a'
73 0
74 % log '2785f51ee'
75 0
76 % log 'date(2005)'
77 4
78 % log 'date(this is a test)'
79 hg: parse error at 10: unexpected token: symbol
80 % log 'date()'
81 hg: parse error: date wants a string
82 % log 'date'
83 hg: parse error: can't use date here
84 % log 'date('
85 hg: parse error at 5: not a prefix: end
86 % log 'date(tip)'
87 abort: invalid date: 'tip'
88 % log '"date"'
89 abort: unknown revision 'date'!
90 % log 'date(2005) and 1::'
91 4
92 % log 'ancestor(1)'
93 hg: parse error: ancestor wants two arguments
94 % log 'ancestor(4,5)'
95 1
96 % log 'ancestors(5)'
97 0
98 1
99 3
100 5
101 % log 'author(bob)'
102 2
103 % log 'branch(Γ©)'
104 8
105 9
106 % log 'children(ancestor(4,5))'
107 2
108 3
109 % log 'closed()'
110 % log 'contains(a)'
111 0
112 1
113 3
114 5
115 % log 'descendants(2 or 3)'
116 2
22 3
117 3
23 % hg debugrevspec "-a-b-c-"-a
118 4
119 5
120 6
121 7
122 8
123 9
124 % log 'file(b)'
125 1
126 4
127 % log 'follow()'
128 0
129 1
130 2
131 4
132 8
133 9
134 % log 'grep("issue\d+")'
135 6
136 % log 'head()'
137 0
138 1
139 2
24 3
140 3
141 4
142 5
143 6
144 7
145 9
146 % log 'heads(6::)'
147 7
148 % log 'keyword(issue)'
149 6
150 % log 'limit(head(), 1)'
151 0
152 % log 'max(contains(a))'
153 5
154 % log 'merge()'
155 6
156 % log 'modifies(b)'
157 4
158 % log 'p1(merge())'
159 5
160 % log 'p2(merge())'
161 4
162 % log 'parents(merge())'
163 4
164 5
165 % log 'removes(a)'
166 2
167 6
168 % log 'roots(all())'
169 0
170 % log 'reverse(2 or 3 or 4 or 5)'
171 5
172 4
173 3
174 2
175 % log 'sort(limit(reverse(all()), 3))'
176 7
177 8
178 9
179 % log 'sort(2 or 3 or 4 or 5, date)'
180 2
181 3
182 5
183 4
184 % log 'tagged()'
185 6
186 % log 'user(bob)'
187 2
188 % log '4::8'
189 4
190 8
191 % log '4:8'
192 4
193 5
194 6
195 7
196 8
197 % log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
198 4
199 2
200 5
General Comments 0
You need to be logged in to leave comments. Login now