Show More
@@ -1,748 +1,748 b'' | |||||
1 | $ cat > $TESTTMP/filter.py <<EOF |
|
1 | $ cat > $TESTTMP/filter.py <<EOF | |
2 | > from __future__ import absolute_import, print_function |
|
2 | > from __future__ import absolute_import, print_function | |
3 | > import re |
|
3 | > import re | |
4 | > import sys |
|
4 | > import sys | |
5 | > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") |
|
5 | > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") | |
6 | > EOF |
|
6 | > EOF | |
7 |
|
7 | |||
8 | $ cat <<EOF >> $HGRCPATH |
|
8 | $ cat <<EOF >> $HGRCPATH | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > notify= |
|
10 | > notify= | |
11 | > |
|
11 | > | |
12 | > [hooks] |
|
12 | > [hooks] | |
13 | > incoming.notify = python:hgext.notify.hook |
|
13 | > incoming.notify = python:hgext.notify.hook | |
14 | > |
|
14 | > | |
15 | > [notify] |
|
15 | > [notify] | |
16 | > sources = pull |
|
16 | > sources = pull | |
17 | > diffstat = False |
|
17 | > diffstat = False | |
18 | > |
|
18 | > | |
19 | > [usersubs] |
|
19 | > [usersubs] | |
20 | > foo@bar = * |
|
20 | > foo@bar = * | |
21 | > |
|
21 | > | |
22 | > [reposubs] |
|
22 | > [reposubs] | |
23 | > * = baz |
|
23 | > * = baz | |
24 | > EOF |
|
24 | > EOF | |
25 | $ hg help notify |
|
25 | $ hg help notify | |
26 | notify extension - hooks for sending email push notifications |
|
26 | notify extension - hooks for sending email push notifications | |
27 |
|
27 | |||
28 | This extension implements hooks to send email notifications when changesets |
|
28 | This extension implements hooks to send email notifications when changesets | |
29 | are sent from or received by the local repository. |
|
29 | are sent from or received by the local repository. | |
30 |
|
30 | |||
31 | First, enable the extension as explained in 'hg help extensions', and register |
|
31 | First, enable the extension as explained in 'hg help extensions', and register | |
32 | the hook you want to run. "incoming" and "changegroup" hooks are run when |
|
32 | the hook you want to run. "incoming" and "changegroup" hooks are run when | |
33 | changesets are received, while "outgoing" hooks are for changesets sent to |
|
33 | changesets are received, while "outgoing" hooks are for changesets sent to | |
34 | another repository: |
|
34 | another repository: | |
35 |
|
35 | |||
36 | [hooks] |
|
36 | [hooks] | |
37 | # one email for each incoming changeset |
|
37 | # one email for each incoming changeset | |
38 | incoming.notify = python:hgext.notify.hook |
|
38 | incoming.notify = python:hgext.notify.hook | |
39 | # one email for all incoming changesets |
|
39 | # one email for all incoming changesets | |
40 | changegroup.notify = python:hgext.notify.hook |
|
40 | changegroup.notify = python:hgext.notify.hook | |
41 |
|
41 | |||
42 | # one email for all outgoing changesets |
|
42 | # one email for all outgoing changesets | |
43 | outgoing.notify = python:hgext.notify.hook |
|
43 | outgoing.notify = python:hgext.notify.hook | |
44 |
|
44 | |||
45 | This registers the hooks. To enable notification, subscribers must be assigned |
|
45 | This registers the hooks. To enable notification, subscribers must be assigned | |
46 | to repositories. The "[usersubs]" section maps multiple repositories to a |
|
46 | to repositories. The "[usersubs]" section maps multiple repositories to a | |
47 | given recipient. The "[reposubs]" section maps multiple recipients to a single |
|
47 | given recipient. The "[reposubs]" section maps multiple recipients to a single | |
48 | repository: |
|
48 | repository: | |
49 |
|
49 | |||
50 | [usersubs] |
|
50 | [usersubs] | |
51 | # key is subscriber email, value is a comma-separated list of repo patterns |
|
51 | # key is subscriber email, value is a comma-separated list of repo patterns | |
52 | user@host = pattern |
|
52 | user@host = pattern | |
53 |
|
53 | |||
54 | [reposubs] |
|
54 | [reposubs] | |
55 | # key is repo pattern, value is a comma-separated list of subscriber emails |
|
55 | # key is repo pattern, value is a comma-separated list of subscriber emails | |
56 | pattern = user@host |
|
56 | pattern = user@host | |
57 |
|
57 | |||
58 | A "pattern" is a "glob" matching the absolute path to a repository, optionally |
|
58 | A "pattern" is a "glob" matching the absolute path to a repository, optionally | |
59 | combined with a revset expression. A revset expression, if present, is |
|
59 | combined with a revset expression. A revset expression, if present, is | |
60 | separated from the glob by a hash. Example: |
|
60 | separated from the glob by a hash. Example: | |
61 |
|
61 | |||
62 | [reposubs] |
|
62 | [reposubs] | |
63 | */widgets#branch(release) = qa-team@example.com |
|
63 | */widgets#branch(release) = qa-team@example.com | |
64 |
|
64 | |||
65 | This sends to "qa-team@example.com" whenever a changeset on the "release" |
|
65 | This sends to "qa-team@example.com" whenever a changeset on the "release" | |
66 | branch triggers a notification in any repository ending in "widgets". |
|
66 | branch triggers a notification in any repository ending in "widgets". | |
67 |
|
67 | |||
68 | In order to place them under direct user management, "[usersubs]" and |
|
68 | In order to place them under direct user management, "[usersubs]" and | |
69 | "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated |
|
69 | "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated | |
70 | by reference: |
|
70 | by reference: | |
71 |
|
71 | |||
72 | [notify] |
|
72 | [notify] | |
73 | config = /path/to/subscriptionsfile |
|
73 | config = /path/to/subscriptionsfile | |
74 |
|
74 | |||
75 | Notifications will not be sent until the "notify.test" value is set to |
|
75 | Notifications will not be sent until the "notify.test" value is set to | |
76 | "False"; see below. |
|
76 | "False"; see below. | |
77 |
|
77 | |||
78 | Notifications content can be tweaked with the following configuration entries: |
|
78 | Notifications content can be tweaked with the following configuration entries: | |
79 |
|
79 | |||
80 | notify.test |
|
80 | notify.test | |
81 | If "True", print messages to stdout instead of sending them. Default: True. |
|
81 | If "True", print messages to stdout instead of sending them. Default: True. | |
82 |
|
82 | |||
83 | notify.sources |
|
83 | notify.sources | |
84 | Space-separated list of change sources. Notifications are activated only |
|
84 | Space-separated list of change sources. Notifications are activated only | |
85 | when a changeset's source is in this list. Sources may be: |
|
85 | when a changeset's source is in this list. Sources may be: | |
86 |
|
86 | |||
87 | "serve" changesets received via http or ssh |
|
87 | "serve" changesets received via http or ssh | |
88 | "pull" changesets received via "hg pull" |
|
88 | "pull" changesets received via "hg pull" | |
89 | "unbundle" changesets received via "hg unbundle" |
|
89 | "unbundle" changesets received via "hg unbundle" | |
90 | "push" changesets sent or received via "hg push" |
|
90 | "push" changesets sent or received via "hg push" | |
91 | "bundle" changesets sent via "hg unbundle" |
|
91 | "bundle" changesets sent via "hg unbundle" | |
92 |
|
92 | |||
93 | Default: serve. |
|
93 | Default: serve. | |
94 |
|
94 | |||
95 | notify.strip |
|
95 | notify.strip | |
96 | Number of leading slashes to strip from url paths. By default, notifications |
|
96 | Number of leading slashes to strip from url paths. By default, notifications | |
97 | reference repositories with their absolute path. "notify.strip" lets you |
|
97 | reference repositories with their absolute path. "notify.strip" lets you | |
98 | turn them into relative paths. For example, "notify.strip=3" will change |
|
98 | turn them into relative paths. For example, "notify.strip=3" will change | |
99 | "/long/path/repository" into "repository". Default: 0. |
|
99 | "/long/path/repository" into "repository". Default: 0. | |
100 |
|
100 | |||
101 | notify.domain |
|
101 | notify.domain | |
102 | Default email domain for sender or recipients with no explicit domain. |
|
102 | Default email domain for sender or recipients with no explicit domain. | |
103 |
|
103 | |||
104 | notify.style |
|
104 | notify.style | |
105 | Style file to use when formatting emails. |
|
105 | Style file to use when formatting emails. | |
106 |
|
106 | |||
107 | notify.template |
|
107 | notify.template | |
108 | Template to use when formatting emails. |
|
108 | Template to use when formatting emails. | |
109 |
|
109 | |||
110 | notify.incoming |
|
110 | notify.incoming | |
111 | Template to use when run as an incoming hook, overriding "notify.template". |
|
111 | Template to use when run as an incoming hook, overriding "notify.template". | |
112 |
|
112 | |||
113 | notify.outgoing |
|
113 | notify.outgoing | |
114 | Template to use when run as an outgoing hook, overriding "notify.template". |
|
114 | Template to use when run as an outgoing hook, overriding "notify.template". | |
115 |
|
115 | |||
116 | notify.changegroup |
|
116 | notify.changegroup | |
117 | Template to use when running as a changegroup hook, overriding |
|
117 | Template to use when running as a changegroup hook, overriding | |
118 | "notify.template". |
|
118 | "notify.template". | |
119 |
|
119 | |||
120 | notify.maxdiff |
|
120 | notify.maxdiff | |
121 | Maximum number of diff lines to include in notification email. Set to 0 to |
|
121 | Maximum number of diff lines to include in notification email. Set to 0 to | |
122 | disable the diff, or -1 to include all of it. Default: 300. |
|
122 | disable the diff, or -1 to include all of it. Default: 300. | |
123 |
|
123 | |||
124 | notify.maxdiffstat |
|
124 | notify.maxdiffstat | |
125 | Maximum number of diffstat lines to include in notification email. Set to -1 |
|
125 | Maximum number of diffstat lines to include in notification email. Set to -1 | |
126 | to include all of it. Default: -1. |
|
126 | to include all of it. Default: -1. | |
127 |
|
127 | |||
128 | notify.maxsubject |
|
128 | notify.maxsubject | |
129 | Maximum number of characters in email's subject line. Default: 67. |
|
129 | Maximum number of characters in email's subject line. Default: 67. | |
130 |
|
130 | |||
131 | notify.diffstat |
|
131 | notify.diffstat | |
132 | Set to True to include a diffstat before diff content. Default: True. |
|
132 | Set to True to include a diffstat before diff content. Default: True. | |
133 |
|
133 | |||
134 | notify.showfunc |
|
134 | notify.showfunc | |
135 | If set, override "diff.showfunc" for the diff content. Default: None. |
|
135 | If set, override "diff.showfunc" for the diff content. Default: None. | |
136 |
|
136 | |||
137 | notify.merge |
|
137 | notify.merge | |
138 | If True, send notifications for merge changesets. Default: True. |
|
138 | If True, send notifications for merge changesets. Default: True. | |
139 |
|
139 | |||
140 | notify.mbox |
|
140 | notify.mbox | |
141 | If set, append mails to this mbox file instead of sending. Default: None. |
|
141 | If set, append mails to this mbox file instead of sending. Default: None. | |
142 |
|
142 | |||
143 | notify.fromauthor |
|
143 | notify.fromauthor | |
144 | If set, use the committer of the first changeset in a changegroup for the |
|
144 | If set, use the committer of the first changeset in a changegroup for the | |
145 | "From" field of the notification mail. If not set, take the user from the |
|
145 | "From" field of the notification mail. If not set, take the user from the | |
146 | pushing repo. Default: False. |
|
146 | pushing repo. Default: False. | |
147 |
|
147 | |||
148 | If set, the following entries will also be used to customize the |
|
148 | If set, the following entries will also be used to customize the | |
149 | notifications: |
|
149 | notifications: | |
150 |
|
150 | |||
151 | email.from |
|
151 | email.from | |
152 | Email "From" address to use if none can be found in the generated email |
|
152 | Email "From" address to use if none can be found in the generated email | |
153 | content. |
|
153 | content. | |
154 |
|
154 | |||
155 | web.baseurl |
|
155 | web.baseurl | |
156 | Root repository URL to combine with repository paths when making references. |
|
156 | Root repository URL to combine with repository paths when making references. | |
157 | See also "notify.strip". |
|
157 | See also "notify.strip". | |
158 |
|
158 | |||
159 | no commands defined |
|
159 | no commands defined | |
160 | $ hg init a |
|
160 | $ hg init a | |
161 | $ echo a > a/a |
|
161 | $ echo a > a/a | |
162 | $ echo b > a/b |
|
162 | $ echo b > a/b | |
163 |
|
163 | |||
164 | commit |
|
164 | commit | |
165 |
|
165 | |||
166 | $ hg --cwd a commit -Ama -d '0 0' |
|
166 | $ hg --cwd a commit -Ama -d '0 0' | |
167 | adding a |
|
167 | adding a | |
168 | adding b |
|
168 | adding b | |
169 |
|
169 | |||
170 | clone |
|
170 | clone | |
171 |
|
171 | |||
172 | $ hg --traceback clone a b |
|
172 | $ hg --traceback clone a b | |
173 | updating to branch default |
|
173 | updating to branch default | |
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
175 | $ echo a >> a/a |
|
175 | $ echo a >> a/a | |
176 | $ echo b >> a/b |
|
176 | $ echo b >> a/b | |
177 |
|
177 | |||
178 | commit |
|
178 | commit | |
179 |
|
179 | |||
180 | $ hg --traceback --cwd a commit -Amb -d '1 0' |
|
180 | $ hg --traceback --cwd a commit -Amb -d '1 0' | |
181 |
|
181 | |||
182 | on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line |
|
182 | on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line | |
183 |
|
183 | |||
184 | $ cat <<EOF >> $HGRCPATH |
|
184 | $ cat <<EOF >> $HGRCPATH | |
185 | > [notify] |
|
185 | > [notify] | |
186 | > maxsubject = 200 |
|
186 | > maxsubject = 200 | |
187 | > EOF |
|
187 | > EOF | |
188 |
|
188 | |||
189 | the python call below wraps continuation lines, which appear on Mac OS X 10.5 because |
|
189 | the python call below wraps continuation lines, which appear on Mac OS X 10.5 because | |
190 | of the very long subject line |
|
190 | of the very long subject line | |
191 | pull (minimal config) |
|
191 | pull (minimal config) | |
192 |
|
192 | |||
193 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
193 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
194 | pulling from ../a |
|
194 | pulling from ../a | |
195 | searching for changes |
|
195 | searching for changes | |
196 | adding changesets |
|
196 | adding changesets | |
197 | adding manifests |
|
197 | adding manifests | |
198 | adding file changes |
|
198 | adding file changes | |
199 | added 1 changesets with 2 changes to 2 files |
|
199 | added 1 changesets with 2 changes to 2 files | |
200 | new changesets 00a13f371396 |
|
200 | new changesets 00a13f371396 | |
201 | MIME-Version: 1.0 |
|
201 | MIME-Version: 1.0 | |
202 | Content-Type: text/plain; charset="us-ascii" |
|
202 | Content-Type: text/plain; charset="us-ascii" | |
203 | Content-Transfer-Encoding: 7bit |
|
203 | Content-Transfer-Encoding: 7bit | |
204 | Date: * (glob) |
|
204 | Date: * (glob) | |
205 | Subject: changeset in $TESTTMP/b: b |
|
205 | Subject: changeset in $TESTTMP/b: b | |
206 | From: test |
|
206 | From: test | |
207 | X-Hg-Notification: changeset 00a13f371396 |
|
207 | X-Hg-Notification: changeset 00a13f371396 | |
208 | Message-Id: <*> (glob) |
|
208 | Message-Id: <*> (glob) | |
209 | To: baz, foo@bar |
|
209 | To: baz, foo@bar | |
210 |
|
210 | |||
211 | changeset 00a13f371396 in $TESTTMP/b |
|
211 | changeset 00a13f371396 in $TESTTMP/b | |
212 | details: $TESTTMP/b?cmd=changeset;node=00a13f371396 |
|
212 | details: $TESTTMP/b?cmd=changeset;node=00a13f371396 | |
213 | description: b |
|
213 | description: b | |
214 |
|
214 | |||
215 | diffs (12 lines): |
|
215 | diffs (12 lines): | |
216 |
|
216 | |||
217 | diff -r 0cd96de13884 -r 00a13f371396 a |
|
217 | diff -r 0cd96de13884 -r 00a13f371396 a | |
218 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
218 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
219 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
219 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
220 | @@ -1,1 +1,2 @@ a |
|
220 | @@ -1,1 +1,2 @@ a | |
221 | +a |
|
221 | +a | |
222 | diff -r 0cd96de13884 -r 00a13f371396 b |
|
222 | diff -r 0cd96de13884 -r 00a13f371396 b | |
223 | --- a/b Thu Jan 01 00:00:00 1970 +0000 |
|
223 | --- a/b Thu Jan 01 00:00:00 1970 +0000 | |
224 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 |
|
224 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 | |
225 | @@ -1,1 +1,2 @@ b |
|
225 | @@ -1,1 +1,2 @@ b | |
226 | +b |
|
226 | +b | |
227 | (run 'hg update' to get a working copy) |
|
227 | (run 'hg update' to get a working copy) | |
228 |
|
228 | |||
229 | $ cat <<EOF >> $HGRCPATH |
|
229 | $ cat <<EOF >> $HGRCPATH | |
230 | > [notify] |
|
230 | > [notify] | |
231 | > config = `pwd`/.notify.conf |
|
231 | > config = `pwd`/.notify.conf | |
232 | > domain = test.com |
|
232 | > domain = test.com | |
233 | > strip = 42 |
|
233 | > strip = 42 | |
234 | > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} |
|
234 | > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} | |
235 | > |
|
235 | > | |
236 | > [web] |
|
236 | > [web] | |
237 | > baseurl = http://test/ |
|
237 | > baseurl = http://test/ | |
238 | > EOF |
|
238 | > EOF | |
239 |
|
239 | |||
240 | fail for config file is missing |
|
240 | fail for config file is missing | |
241 |
|
241 | |||
242 | $ hg --cwd b rollback |
|
242 | $ hg --cwd b rollback | |
243 | repository tip rolled back to revision 0 (undo pull) |
|
243 | repository tip rolled back to revision 0 (undo pull) | |
244 | $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed |
|
244 | $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed | |
245 | pull failed |
|
245 | pull failed | |
246 | $ touch ".notify.conf" |
|
246 | $ touch ".notify.conf" | |
247 |
|
247 | |||
248 | pull |
|
248 | pull | |
249 |
|
249 | |||
250 | $ hg --cwd b rollback |
|
250 | $ hg --cwd b rollback | |
251 | repository tip rolled back to revision 0 (undo pull) |
|
251 | repository tip rolled back to revision 0 (undo pull) | |
252 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
252 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
253 | pulling from ../a |
|
253 | pulling from ../a | |
254 | searching for changes |
|
254 | searching for changes | |
255 | adding changesets |
|
255 | adding changesets | |
256 | adding manifests |
|
256 | adding manifests | |
257 | adding file changes |
|
257 | adding file changes | |
258 | added 1 changesets with 2 changes to 2 files |
|
258 | added 1 changesets with 2 changes to 2 files | |
259 | new changesets 00a13f371396 |
|
259 | new changesets 00a13f371396 | |
260 | MIME-Version: 1.0 |
|
260 | MIME-Version: 1.0 | |
261 | Content-Type: text/plain; charset="us-ascii" |
|
261 | Content-Type: text/plain; charset="us-ascii" | |
262 | Content-Transfer-Encoding: 7bit |
|
262 | Content-Transfer-Encoding: 7bit | |
263 | X-Test: foo |
|
263 | X-Test: foo | |
264 | Date: * (glob) |
|
264 | Date: * (glob) | |
265 | Subject: b |
|
265 | Subject: b | |
266 | From: test@test.com |
|
266 | From: test@test.com | |
267 | X-Hg-Notification: changeset 00a13f371396 |
|
267 | X-Hg-Notification: changeset 00a13f371396 | |
268 | Message-Id: <*> (glob) |
|
268 | Message-Id: <*> (glob) | |
269 | To: baz@test.com, foo@bar |
|
269 | To: baz@test.com, foo@bar | |
270 |
|
270 | |||
271 | changeset 00a13f371396 in b |
|
271 | changeset 00a13f371396 in b | |
272 | description: b |
|
272 | description: b | |
273 | diffs (12 lines): |
|
273 | diffs (12 lines): | |
274 |
|
274 | |||
275 | diff -r 0cd96de13884 -r 00a13f371396 a |
|
275 | diff -r 0cd96de13884 -r 00a13f371396 a | |
276 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
276 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
277 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
277 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
278 | @@ -1,1 +1,2 @@ a |
|
278 | @@ -1,1 +1,2 @@ a | |
279 | +a |
|
279 | +a | |
280 | diff -r 0cd96de13884 -r 00a13f371396 b |
|
280 | diff -r 0cd96de13884 -r 00a13f371396 b | |
281 | --- a/b Thu Jan 01 00:00:00 1970 +0000 |
|
281 | --- a/b Thu Jan 01 00:00:00 1970 +0000 | |
282 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 |
|
282 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 | |
283 | @@ -1,1 +1,2 @@ b |
|
283 | @@ -1,1 +1,2 @@ b | |
284 | +b |
|
284 | +b | |
285 | (run 'hg update' to get a working copy) |
|
285 | (run 'hg update' to get a working copy) | |
286 |
|
286 | |||
287 | $ cat << EOF >> $HGRCPATH |
|
287 | $ cat << EOF >> $HGRCPATH | |
288 | > [hooks] |
|
288 | > [hooks] | |
289 | > incoming.notify = python:hgext.notify.hook |
|
289 | > incoming.notify = python:hgext.notify.hook | |
290 | > |
|
290 | > | |
291 | > [notify] |
|
291 | > [notify] | |
292 | > sources = pull |
|
292 | > sources = pull | |
293 | > diffstat = True |
|
293 | > diffstat = True | |
294 | > EOF |
|
294 | > EOF | |
295 |
|
295 | |||
296 | pull |
|
296 | pull | |
297 |
|
297 | |||
298 | $ hg --cwd b rollback |
|
298 | $ hg --cwd b rollback | |
299 | repository tip rolled back to revision 0 (undo pull) |
|
299 | repository tip rolled back to revision 0 (undo pull) | |
300 | $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
300 | $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
301 | pulling from ../a |
|
301 | pulling from ../a | |
302 | searching for changes |
|
302 | searching for changes | |
303 | adding changesets |
|
303 | adding changesets | |
304 | adding manifests |
|
304 | adding manifests | |
305 | adding file changes |
|
305 | adding file changes | |
306 | added 1 changesets with 2 changes to 2 files |
|
306 | added 1 changesets with 2 changes to 2 files | |
307 | new changesets 00a13f371396 |
|
307 | new changesets 00a13f371396 | |
308 | MIME-Version: 1.0 |
|
308 | MIME-Version: 1.0 | |
309 | Content-Type: text/plain; charset="us-ascii" |
|
309 | Content-Type: text/plain; charset="us-ascii" | |
310 | Content-Transfer-Encoding: 7bit |
|
310 | Content-Transfer-Encoding: 7bit | |
311 | X-Test: foo |
|
311 | X-Test: foo | |
312 | Date: * (glob) |
|
312 | Date: * (glob) | |
313 | Subject: b |
|
313 | Subject: b | |
314 | From: test@test.com |
|
314 | From: test@test.com | |
315 | X-Hg-Notification: changeset 00a13f371396 |
|
315 | X-Hg-Notification: changeset 00a13f371396 | |
316 | Message-Id: <*> (glob) |
|
316 | Message-Id: <*> (glob) | |
317 | To: baz@test.com, foo@bar |
|
317 | To: baz@test.com, foo@bar | |
318 |
|
318 | |||
319 | changeset 00a13f371396 in b |
|
319 | changeset 00a13f371396 in b | |
320 | description: b |
|
320 | description: b | |
321 | diffstat (truncated from 2 to 1 lines): |
|
321 | diffstat (truncated from 2 to 1 lines): | |
322 | a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) |
|
322 | a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) | |
323 |
|
323 | |||
324 | diffs (12 lines): |
|
324 | diffs (12 lines): | |
325 |
|
325 | |||
326 | diff -r 0cd96de13884 -r 00a13f371396 a |
|
326 | diff -r 0cd96de13884 -r 00a13f371396 a | |
327 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
327 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
328 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
328 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
329 | @@ -1,1 +1,2 @@ a |
|
329 | @@ -1,1 +1,2 @@ a | |
330 | +a |
|
330 | +a | |
331 | diff -r 0cd96de13884 -r 00a13f371396 b |
|
331 | diff -r 0cd96de13884 -r 00a13f371396 b | |
332 | --- a/b Thu Jan 01 00:00:00 1970 +0000 |
|
332 | --- a/b Thu Jan 01 00:00:00 1970 +0000 | |
333 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 |
|
333 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 | |
334 | @@ -1,1 +1,2 @@ b |
|
334 | @@ -1,1 +1,2 @@ b | |
335 | +b |
|
335 | +b | |
336 | (run 'hg update' to get a working copy) |
|
336 | (run 'hg update' to get a working copy) | |
337 |
|
337 | |||
338 | test merge |
|
338 | test merge | |
339 |
|
339 | |||
340 | $ cd a |
|
340 | $ cd a | |
341 | $ hg up -C 0 |
|
341 | $ hg up -C 0 | |
342 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
342 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
343 | $ echo a >> a |
|
343 | $ echo a >> a | |
344 | $ hg ci -Am adda2 -d '2 0' |
|
344 | $ hg ci -Am adda2 -d '2 0' | |
345 | created new head |
|
345 | created new head | |
346 | $ hg merge |
|
346 | $ hg merge | |
347 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
347 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
348 | (branch merge, don't forget to commit) |
|
348 | (branch merge, don't forget to commit) | |
349 | $ hg ci -m merge -d '3 0' |
|
349 | $ hg ci -m merge -d '3 0' | |
350 | $ cd .. |
|
350 | $ cd .. | |
351 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
351 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
352 | pulling from ../a |
|
352 | pulling from ../a | |
353 | searching for changes |
|
353 | searching for changes | |
354 | adding changesets |
|
354 | adding changesets | |
355 | adding manifests |
|
355 | adding manifests | |
356 | adding file changes |
|
356 | adding file changes | |
357 | added 2 changesets with 0 changes to 0 files |
|
357 | added 2 changesets with 0 changes to 0 files | |
358 | new changesets 3332653e1f3c:fccf66cd0c35 |
|
358 | new changesets 3332653e1f3c:fccf66cd0c35 | |
359 | MIME-Version: 1.0 |
|
359 | MIME-Version: 1.0 | |
360 | Content-Type: text/plain; charset="us-ascii" |
|
360 | Content-Type: text/plain; charset="us-ascii" | |
361 | Content-Transfer-Encoding: 7bit |
|
361 | Content-Transfer-Encoding: 7bit | |
362 | X-Test: foo |
|
362 | X-Test: foo | |
363 | Date: * (glob) |
|
363 | Date: * (glob) | |
364 | Subject: adda2 |
|
364 | Subject: adda2 | |
365 | From: test@test.com |
|
365 | From: test@test.com | |
366 | X-Hg-Notification: changeset 3332653e1f3c |
|
366 | X-Hg-Notification: changeset 3332653e1f3c | |
367 | Message-Id: <*> (glob) |
|
367 | Message-Id: <*> (glob) | |
368 | To: baz@test.com, foo@bar |
|
368 | To: baz@test.com, foo@bar | |
369 |
|
369 | |||
370 | changeset 3332653e1f3c in b |
|
370 | changeset 3332653e1f3c in b | |
371 | description: adda2 |
|
371 | description: adda2 | |
372 | diffstat: |
|
372 | diffstat: | |
373 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
373 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
374 |
|
374 | |||
375 | diffs (6 lines): |
|
375 | diffs (6 lines): | |
376 |
|
376 | |||
377 | diff -r 0cd96de13884 -r 3332653e1f3c a |
|
377 | diff -r 0cd96de13884 -r 3332653e1f3c a | |
378 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
378 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
379 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
379 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 | |
380 | @@ -1,1 +1,2 @@ a |
|
380 | @@ -1,1 +1,2 @@ a | |
381 | +a |
|
381 | +a | |
382 | MIME-Version: 1.0 |
|
382 | MIME-Version: 1.0 | |
383 | Content-Type: text/plain; charset="us-ascii" |
|
383 | Content-Type: text/plain; charset="us-ascii" | |
384 | Content-Transfer-Encoding: 7bit |
|
384 | Content-Transfer-Encoding: 7bit | |
385 | X-Test: foo |
|
385 | X-Test: foo | |
386 | Date: * (glob) |
|
386 | Date: * (glob) | |
387 | Subject: merge |
|
387 | Subject: merge | |
388 | From: test@test.com |
|
388 | From: test@test.com | |
389 | X-Hg-Notification: changeset fccf66cd0c35 |
|
389 | X-Hg-Notification: changeset fccf66cd0c35 | |
390 | Message-Id: <*> (glob) |
|
390 | Message-Id: <*> (glob) | |
391 | To: baz@test.com, foo@bar |
|
391 | To: baz@test.com, foo@bar | |
392 |
|
392 | |||
393 | changeset fccf66cd0c35 in b |
|
393 | changeset fccf66cd0c35 in b | |
394 | description: merge |
|
394 | description: merge | |
395 | diffstat: |
|
395 | diffstat: | |
396 | b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
396 | b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
397 |
|
397 | |||
398 | diffs (6 lines): |
|
398 | diffs (6 lines): | |
399 |
|
399 | |||
400 | diff -r 3332653e1f3c -r fccf66cd0c35 b |
|
400 | diff -r 3332653e1f3c -r fccf66cd0c35 b | |
401 | --- a/b Thu Jan 01 00:00:02 1970 +0000 |
|
401 | --- a/b Thu Jan 01 00:00:02 1970 +0000 | |
402 | +++ b/b Thu Jan 01 00:00:03 1970 +0000 |
|
402 | +++ b/b Thu Jan 01 00:00:03 1970 +0000 | |
403 | @@ -1,1 +1,2 @@ b |
|
403 | @@ -1,1 +1,2 @@ b | |
404 | +b |
|
404 | +b | |
405 | (run 'hg update' to get a working copy) |
|
405 | (run 'hg update' to get a working copy) | |
406 |
|
406 | |||
407 | non-ascii content and truncation of multi-byte subject |
|
407 | non-ascii content and truncation of multi-byte subject | |
408 |
|
408 | |||
409 | $ cat <<EOF >> $HGRCPATH |
|
409 | $ cat <<EOF >> $HGRCPATH | |
410 | > [notify] |
|
410 | > [notify] | |
411 | > maxsubject = 4 |
|
411 | > maxsubject = 4 | |
412 | > EOF |
|
412 | > EOF | |
413 | $ echo a >> a/a |
|
413 | $ echo a >> a/a | |
414 | $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \ |
|
414 | $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \ | |
415 |
> -m `"$PYTHON" -c 'print |
|
415 | > -m `"$PYTHON" -c 'print("\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'` | |
416 | $ hg --traceback --cwd b --encoding utf-8 pull ../a | \ |
|
416 | $ hg --traceback --cwd b --encoding utf-8 pull ../a | \ | |
417 | > "$PYTHON" $TESTTMP/filter.py |
|
417 | > "$PYTHON" $TESTTMP/filter.py | |
418 | pulling from ../a |
|
418 | pulling from ../a | |
419 | searching for changes |
|
419 | searching for changes | |
420 | adding changesets |
|
420 | adding changesets | |
421 | adding manifests |
|
421 | adding manifests | |
422 | adding file changes |
|
422 | adding file changes | |
423 | added 1 changesets with 1 changes to 1 files |
|
423 | added 1 changesets with 1 changes to 1 files | |
424 | new changesets 0f25f9c22b4c |
|
424 | new changesets 0f25f9c22b4c | |
425 | MIME-Version: 1.0 |
|
425 | MIME-Version: 1.0 | |
426 | Content-Type: text/plain; charset="us-ascii" |
|
426 | Content-Type: text/plain; charset="us-ascii" | |
427 | Content-Transfer-Encoding: 8bit |
|
427 | Content-Transfer-Encoding: 8bit | |
428 | X-Test: foo |
|
428 | X-Test: foo | |
429 | Date: * (glob) |
|
429 | Date: * (glob) | |
430 | Subject: \xc3\xa0... (esc) |
|
430 | Subject: \xc3\xa0... (esc) | |
431 | From: test@test.com |
|
431 | From: test@test.com | |
432 | X-Hg-Notification: changeset 0f25f9c22b4c |
|
432 | X-Hg-Notification: changeset 0f25f9c22b4c | |
433 | Message-Id: <*> (glob) |
|
433 | Message-Id: <*> (glob) | |
434 | To: baz@test.com, foo@bar |
|
434 | To: baz@test.com, foo@bar | |
435 |
|
435 | |||
436 | changeset 0f25f9c22b4c in b |
|
436 | changeset 0f25f9c22b4c in b | |
437 | description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc) |
|
437 | description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc) | |
438 | diffstat: |
|
438 | diffstat: | |
439 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
439 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
440 |
|
440 | |||
441 | diffs (7 lines): |
|
441 | diffs (7 lines): | |
442 |
|
442 | |||
443 | diff -r fccf66cd0c35 -r 0f25f9c22b4c a |
|
443 | diff -r fccf66cd0c35 -r 0f25f9c22b4c a | |
444 | --- a/a Thu Jan 01 00:00:03 1970 +0000 |
|
444 | --- a/a Thu Jan 01 00:00:03 1970 +0000 | |
445 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
445 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
446 | @@ -1,2 +1,3 @@ a a |
|
446 | @@ -1,2 +1,3 @@ a a | |
447 | +a |
|
447 | +a | |
448 | (run 'hg update' to get a working copy) |
|
448 | (run 'hg update' to get a working copy) | |
449 |
|
449 | |||
450 | long lines |
|
450 | long lines | |
451 |
|
451 | |||
452 | $ cat <<EOF >> $HGRCPATH |
|
452 | $ cat <<EOF >> $HGRCPATH | |
453 | > [notify] |
|
453 | > [notify] | |
454 | > maxsubject = 67 |
|
454 | > maxsubject = 67 | |
455 | > test = False |
|
455 | > test = False | |
456 | > mbox = mbox |
|
456 | > mbox = mbox | |
457 | > EOF |
|
457 | > EOF | |
458 | $ "$PYTHON" -c 'open("a/a", "ab").write("no" * 500 + "\xd1\x84" + "\n")' |
|
458 | $ "$PYTHON" -c 'open("a/a", "ab").write("no" * 500 + "\xd1\x84" + "\n")' | |
459 | $ hg --cwd a commit -A -m "long line" |
|
459 | $ hg --cwd a commit -A -m "long line" | |
460 | $ hg --traceback --cwd b pull ../a |
|
460 | $ hg --traceback --cwd b pull ../a | |
461 | pulling from ../a |
|
461 | pulling from ../a | |
462 | searching for changes |
|
462 | searching for changes | |
463 | adding changesets |
|
463 | adding changesets | |
464 | adding manifests |
|
464 | adding manifests | |
465 | adding file changes |
|
465 | adding file changes | |
466 | added 1 changesets with 1 changes to 1 files |
|
466 | added 1 changesets with 1 changes to 1 files | |
467 | new changesets a846b5f6ebb7 |
|
467 | new changesets a846b5f6ebb7 | |
468 | notify: sending 2 subscribers 1 changes |
|
468 | notify: sending 2 subscribers 1 changes | |
469 | (run 'hg update' to get a working copy) |
|
469 | (run 'hg update' to get a working copy) | |
470 | $ "$PYTHON" $TESTTMP/filter.py < b/mbox |
|
470 | $ "$PYTHON" $TESTTMP/filter.py < b/mbox | |
471 | From test@test.com ... ... .. ..:..:.. .... (re) |
|
471 | From test@test.com ... ... .. ..:..:.. .... (re) | |
472 | MIME-Version: 1.0 |
|
472 | MIME-Version: 1.0 | |
473 | Content-Type: text/plain; charset="*" (glob) |
|
473 | Content-Type: text/plain; charset="*" (glob) | |
474 | Content-Transfer-Encoding: quoted-printable |
|
474 | Content-Transfer-Encoding: quoted-printable | |
475 | X-Test: foo |
|
475 | X-Test: foo | |
476 | Date: * (glob) |
|
476 | Date: * (glob) | |
477 | Subject: long line |
|
477 | Subject: long line | |
478 | From: test@test.com |
|
478 | From: test@test.com | |
479 | X-Hg-Notification: changeset a846b5f6ebb7 |
|
479 | X-Hg-Notification: changeset a846b5f6ebb7 | |
480 | Message-Id: <hg.a846b5f6ebb7.*.*@*> (glob) |
|
480 | Message-Id: <hg.a846b5f6ebb7.*.*@*> (glob) | |
481 | To: baz@test.com, foo@bar |
|
481 | To: baz@test.com, foo@bar | |
482 |
|
482 | |||
483 | changeset a846b5f6ebb7 in b |
|
483 | changeset a846b5f6ebb7 in b | |
484 | description: long line |
|
484 | description: long line | |
485 | diffstat: |
|
485 | diffstat: | |
486 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
486 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
487 |
|
487 | |||
488 | diffs (8 lines): |
|
488 | diffs (8 lines): | |
489 |
|
489 | |||
490 | diff -r 0f25f9c22b4c -r a846b5f6ebb7 a |
|
490 | diff -r 0f25f9c22b4c -r a846b5f6ebb7 a | |
491 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
491 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
492 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
492 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
493 | @@ -1,3 +1,4 @@ a a a |
|
493 | @@ -1,3 +1,4 @@ a a a | |
494 | +nonononononononononononononononononononononononononononononononononononono= |
|
494 | +nonononononononononononononononononononononononononononononononononononono= | |
495 | nononononononononononononononononononononononononononononononononononononon= |
|
495 | nononononononononononononononononononononononononononononononononononononon= | |
496 | ononononononononononononononononononononononononononononononononononononono= |
|
496 | ononononononononononononononononononononononononononononononononononononono= | |
497 | nononononononononononononononononononononononononononononononononononononon= |
|
497 | nononononononononononononononononononononononononononononononononononononon= | |
498 | ononononononononononononononononononononononononononononononononononononono= |
|
498 | ononononononononononononononononononononononononononononononononononononono= | |
499 | nononononononononononononononononononononononononononononononononononononon= |
|
499 | nononononononononononononononononononononononononononononononononononononon= | |
500 | ononononononononononononononononononononononononononononononononononononono= |
|
500 | ononononononononononononononononononononononononononononononononononononono= | |
501 | nononononononononononononononononononononononononononononononononononononon= |
|
501 | nononononononononononononononononononononononononononononononononononononon= | |
502 | ononononononononononononononononononononononononononononononononononononono= |
|
502 | ononononononononononononononononononononononononononononononononononononono= | |
503 | nononononononononononononononononononononononononononononononononononononon= |
|
503 | nononononononononononononononononononononononononononononononononononononon= | |
504 | ononononononononononononononononononononononononononononononononononononono= |
|
504 | ononononononononononononononononononononononononononononononononononononono= | |
505 | nononononononononononononononononononononononononononononononononononononon= |
|
505 | nononononononononononononononononononononononononononononononononononononon= | |
506 | ononononononononononononononononononononononononononononononononononononono= |
|
506 | ononononononononononononononononononononononononononononononononononononono= | |
507 | nonononononononononononono=D1=84 |
|
507 | nonononononononononononono=D1=84 | |
508 |
|
508 | |||
509 | revset selection: send to address that matches branch and repo |
|
509 | revset selection: send to address that matches branch and repo | |
510 |
|
510 | |||
511 | $ cat << EOF >> $HGRCPATH |
|
511 | $ cat << EOF >> $HGRCPATH | |
512 | > [hooks] |
|
512 | > [hooks] | |
513 | > incoming.notify = python:hgext.notify.hook |
|
513 | > incoming.notify = python:hgext.notify.hook | |
514 | > |
|
514 | > | |
515 | > [notify] |
|
515 | > [notify] | |
516 | > sources = pull |
|
516 | > sources = pull | |
517 | > test = True |
|
517 | > test = True | |
518 | > diffstat = False |
|
518 | > diffstat = False | |
519 | > maxdiff = 0 |
|
519 | > maxdiff = 0 | |
520 | > |
|
520 | > | |
521 | > [reposubs] |
|
521 | > [reposubs] | |
522 | > */a#branch(test) = will_no_be_send@example.com |
|
522 | > */a#branch(test) = will_no_be_send@example.com | |
523 | > */b#branch(test) = notify@example.com |
|
523 | > */b#branch(test) = notify@example.com | |
524 | > EOF |
|
524 | > EOF | |
525 | $ hg --cwd a branch test |
|
525 | $ hg --cwd a branch test | |
526 | marked working directory as branch test |
|
526 | marked working directory as branch test | |
527 | (branches are permanent and global, did you want a bookmark?) |
|
527 | (branches are permanent and global, did you want a bookmark?) | |
528 | $ echo a >> a/a |
|
528 | $ echo a >> a/a | |
529 | $ hg --cwd a ci -m test -d '1 0' |
|
529 | $ hg --cwd a ci -m test -d '1 0' | |
530 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
530 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
531 | pulling from ../a |
|
531 | pulling from ../a | |
532 | searching for changes |
|
532 | searching for changes | |
533 | adding changesets |
|
533 | adding changesets | |
534 | adding manifests |
|
534 | adding manifests | |
535 | adding file changes |
|
535 | adding file changes | |
536 | added 1 changesets with 1 changes to 1 files |
|
536 | added 1 changesets with 1 changes to 1 files | |
537 | new changesets f7e5aaed4080 |
|
537 | new changesets f7e5aaed4080 | |
538 | MIME-Version: 1.0 |
|
538 | MIME-Version: 1.0 | |
539 | Content-Type: text/plain; charset="us-ascii" |
|
539 | Content-Type: text/plain; charset="us-ascii" | |
540 | Content-Transfer-Encoding: 7bit |
|
540 | Content-Transfer-Encoding: 7bit | |
541 | X-Test: foo |
|
541 | X-Test: foo | |
542 | Date: * (glob) |
|
542 | Date: * (glob) | |
543 | Subject: test |
|
543 | Subject: test | |
544 | From: test@test.com |
|
544 | From: test@test.com | |
545 | X-Hg-Notification: changeset f7e5aaed4080 |
|
545 | X-Hg-Notification: changeset f7e5aaed4080 | |
546 | Message-Id: <hg.f7e5aaed4080.*.*@*> (glob) |
|
546 | Message-Id: <hg.f7e5aaed4080.*.*@*> (glob) | |
547 | To: baz@test.com, foo@bar, notify@example.com |
|
547 | To: baz@test.com, foo@bar, notify@example.com | |
548 |
|
548 | |||
549 | changeset f7e5aaed4080 in b |
|
549 | changeset f7e5aaed4080 in b | |
550 | description: test |
|
550 | description: test | |
551 | (run 'hg update' to get a working copy) |
|
551 | (run 'hg update' to get a working copy) | |
552 |
|
552 | |||
553 | revset selection: don't send to address that waits for mails |
|
553 | revset selection: don't send to address that waits for mails | |
554 | from different branch |
|
554 | from different branch | |
555 |
|
555 | |||
556 | $ hg --cwd a update default |
|
556 | $ hg --cwd a update default | |
557 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
557 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
558 | $ echo a >> a/a |
|
558 | $ echo a >> a/a | |
559 | $ hg --cwd a ci -m test -d '1 0' |
|
559 | $ hg --cwd a ci -m test -d '1 0' | |
560 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
560 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
561 | pulling from ../a |
|
561 | pulling from ../a | |
562 | searching for changes |
|
562 | searching for changes | |
563 | adding changesets |
|
563 | adding changesets | |
564 | adding manifests |
|
564 | adding manifests | |
565 | adding file changes |
|
565 | adding file changes | |
566 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
566 | added 1 changesets with 0 changes to 0 files (+1 heads) | |
567 | new changesets 645eb6690ecf |
|
567 | new changesets 645eb6690ecf | |
568 | MIME-Version: 1.0 |
|
568 | MIME-Version: 1.0 | |
569 | Content-Type: text/plain; charset="us-ascii" |
|
569 | Content-Type: text/plain; charset="us-ascii" | |
570 | Content-Transfer-Encoding: 7bit |
|
570 | Content-Transfer-Encoding: 7bit | |
571 | X-Test: foo |
|
571 | X-Test: foo | |
572 | Date: * (glob) |
|
572 | Date: * (glob) | |
573 | Subject: test |
|
573 | Subject: test | |
574 | From: test@test.com |
|
574 | From: test@test.com | |
575 | X-Hg-Notification: changeset 645eb6690ecf |
|
575 | X-Hg-Notification: changeset 645eb6690ecf | |
576 | Message-Id: <hg.645eb6690ecf.*.*@*> (glob) |
|
576 | Message-Id: <hg.645eb6690ecf.*.*@*> (glob) | |
577 | To: baz@test.com, foo@bar |
|
577 | To: baz@test.com, foo@bar | |
578 |
|
578 | |||
579 | changeset 645eb6690ecf in b |
|
579 | changeset 645eb6690ecf in b | |
580 | description: test |
|
580 | description: test | |
581 | (run 'hg heads' to see heads) |
|
581 | (run 'hg heads' to see heads) | |
582 |
|
582 | |||
583 | default template: |
|
583 | default template: | |
584 |
|
584 | |||
585 | $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new" |
|
585 | $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new" | |
586 | $ mv "$HGRCPATH.new" $HGRCPATH |
|
586 | $ mv "$HGRCPATH.new" $HGRCPATH | |
587 | $ echo a >> a/a |
|
587 | $ echo a >> a/a | |
588 | $ hg --cwd a commit -m 'default template' |
|
588 | $ hg --cwd a commit -m 'default template' | |
589 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py |
|
589 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py | |
590 | MIME-Version: 1.0 |
|
590 | MIME-Version: 1.0 | |
591 | Content-Type: text/plain; charset="us-ascii" |
|
591 | Content-Type: text/plain; charset="us-ascii" | |
592 | Content-Transfer-Encoding: 7bit |
|
592 | Content-Transfer-Encoding: 7bit | |
593 | Date: * (glob) |
|
593 | Date: * (glob) | |
594 | Subject: changeset in b: default template |
|
594 | Subject: changeset in b: default template | |
595 | From: test@test.com |
|
595 | From: test@test.com | |
596 | X-Hg-Notification: changeset 5cd4346eed47 |
|
596 | X-Hg-Notification: changeset 5cd4346eed47 | |
597 | Message-Id: <hg.5cd4346eed47.*.*@*> (glob) |
|
597 | Message-Id: <hg.5cd4346eed47.*.*@*> (glob) | |
598 | To: baz@test.com, foo@bar |
|
598 | To: baz@test.com, foo@bar | |
599 |
|
599 | |||
600 | changeset 5cd4346eed47 in $TESTTMP/b |
|
600 | changeset 5cd4346eed47 in $TESTTMP/b | |
601 | details: http://test/b?cmd=changeset;node=5cd4346eed47 |
|
601 | details: http://test/b?cmd=changeset;node=5cd4346eed47 | |
602 | description: default template |
|
602 | description: default template | |
603 |
|
603 | |||
604 | with style: |
|
604 | with style: | |
605 |
|
605 | |||
606 | $ cat <<EOF > notifystyle.map |
|
606 | $ cat <<EOF > notifystyle.map | |
607 | > changeset = "Subject: {desc|firstline|strip} |
|
607 | > changeset = "Subject: {desc|firstline|strip} | |
608 | > From: {author} |
|
608 | > From: {author} | |
609 | > {""} |
|
609 | > {""} | |
610 | > changeset {node|short}" |
|
610 | > changeset {node|short}" | |
611 | > EOF |
|
611 | > EOF | |
612 | $ cat <<EOF >> $HGRCPATH |
|
612 | $ cat <<EOF >> $HGRCPATH | |
613 | > [notify] |
|
613 | > [notify] | |
614 | > style = $TESTTMP/notifystyle.map |
|
614 | > style = $TESTTMP/notifystyle.map | |
615 | > EOF |
|
615 | > EOF | |
616 | $ echo a >> a/a |
|
616 | $ echo a >> a/a | |
617 | $ hg --cwd a commit -m 'with style' |
|
617 | $ hg --cwd a commit -m 'with style' | |
618 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py |
|
618 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py | |
619 | MIME-Version: 1.0 |
|
619 | MIME-Version: 1.0 | |
620 | Content-Type: text/plain; charset="us-ascii" |
|
620 | Content-Type: text/plain; charset="us-ascii" | |
621 | Content-Transfer-Encoding: 7bit |
|
621 | Content-Transfer-Encoding: 7bit | |
622 | Date: * (glob) |
|
622 | Date: * (glob) | |
623 | Subject: with style |
|
623 | Subject: with style | |
624 | From: test@test.com |
|
624 | From: test@test.com | |
625 | X-Hg-Notification: changeset ec8d9d852f56 |
|
625 | X-Hg-Notification: changeset ec8d9d852f56 | |
626 | Message-Id: <hg.ec8d9d852f56.*.*@*> (glob) |
|
626 | Message-Id: <hg.ec8d9d852f56.*.*@*> (glob) | |
627 | To: baz@test.com, foo@bar |
|
627 | To: baz@test.com, foo@bar | |
628 |
|
628 | |||
629 | changeset ec8d9d852f56 |
|
629 | changeset ec8d9d852f56 | |
630 |
|
630 | |||
631 | with template (overrides style): |
|
631 | with template (overrides style): | |
632 |
|
632 | |||
633 | $ cat <<EOF >> $HGRCPATH |
|
633 | $ cat <<EOF >> $HGRCPATH | |
634 | > template = Subject: {node|short}: {desc|firstline|strip} |
|
634 | > template = Subject: {node|short}: {desc|firstline|strip} | |
635 | > From: {author} |
|
635 | > From: {author} | |
636 | > {""} |
|
636 | > {""} | |
637 | > {desc} |
|
637 | > {desc} | |
638 | > EOF |
|
638 | > EOF | |
639 | $ echo a >> a/a |
|
639 | $ echo a >> a/a | |
640 | $ hg --cwd a commit -m 'with template' |
|
640 | $ hg --cwd a commit -m 'with template' | |
641 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py |
|
641 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py | |
642 | MIME-Version: 1.0 |
|
642 | MIME-Version: 1.0 | |
643 | Content-Type: text/plain; charset="us-ascii" |
|
643 | Content-Type: text/plain; charset="us-ascii" | |
644 | Content-Transfer-Encoding: 7bit |
|
644 | Content-Transfer-Encoding: 7bit | |
645 | Date: * (glob) |
|
645 | Date: * (glob) | |
646 | Subject: 14721b538ae3: with template |
|
646 | Subject: 14721b538ae3: with template | |
647 | From: test@test.com |
|
647 | From: test@test.com | |
648 | X-Hg-Notification: changeset 14721b538ae3 |
|
648 | X-Hg-Notification: changeset 14721b538ae3 | |
649 | Message-Id: <hg.14721b538ae3.*.*@*> (glob) |
|
649 | Message-Id: <hg.14721b538ae3.*.*@*> (glob) | |
650 | To: baz@test.com, foo@bar |
|
650 | To: baz@test.com, foo@bar | |
651 |
|
651 | |||
652 | with template |
|
652 | with template | |
653 |
|
653 | |||
654 | showfunc diff |
|
654 | showfunc diff | |
655 | $ cat <<EOF >> $HGRCPATH |
|
655 | $ cat <<EOF >> $HGRCPATH | |
656 | > showfunc = True |
|
656 | > showfunc = True | |
657 | > template = |
|
657 | > template = | |
658 | > maxdiff = -1 |
|
658 | > maxdiff = -1 | |
659 | > EOF |
|
659 | > EOF | |
660 | $ cd a |
|
660 | $ cd a | |
661 | $ cat > f1 << EOF |
|
661 | $ cat > f1 << EOF | |
662 | > int main() { |
|
662 | > int main() { | |
663 | > int a = 0; |
|
663 | > int a = 0; | |
664 | > int b = 1; |
|
664 | > int b = 1; | |
665 | > int c = 2; |
|
665 | > int c = 2; | |
666 | > int d = 3; |
|
666 | > int d = 3; | |
667 | > return a + b + c + d; |
|
667 | > return a + b + c + d; | |
668 | > } |
|
668 | > } | |
669 | > EOF |
|
669 | > EOF | |
670 | $ hg commit -Am addfunction |
|
670 | $ hg commit -Am addfunction | |
671 | adding f1 |
|
671 | adding f1 | |
672 | $ hg --cwd ../b pull ../a |
|
672 | $ hg --cwd ../b pull ../a | |
673 | pulling from ../a |
|
673 | pulling from ../a | |
674 | searching for changes |
|
674 | searching for changes | |
675 | adding changesets |
|
675 | adding changesets | |
676 | adding manifests |
|
676 | adding manifests | |
677 | adding file changes |
|
677 | adding file changes | |
678 | added 1 changesets with 1 changes to 1 files |
|
678 | added 1 changesets with 1 changes to 1 files | |
679 | new changesets b86bc16ff894 |
|
679 | new changesets b86bc16ff894 | |
680 | MIME-Version: 1.0 |
|
680 | MIME-Version: 1.0 | |
681 | Content-Type: text/plain; charset="us-ascii" |
|
681 | Content-Type: text/plain; charset="us-ascii" | |
682 | Content-Transfer-Encoding: 7bit |
|
682 | Content-Transfer-Encoding: 7bit | |
683 | Date: * (glob) |
|
683 | Date: * (glob) | |
684 | Subject: addfunction |
|
684 | Subject: addfunction | |
685 | From: test@test.com |
|
685 | From: test@test.com | |
686 | X-Hg-Notification: changeset b86bc16ff894 |
|
686 | X-Hg-Notification: changeset b86bc16ff894 | |
687 | Message-Id: <hg.b86bc16ff894.*.*@*> (glob) |
|
687 | Message-Id: <hg.b86bc16ff894.*.*@*> (glob) | |
688 | To: baz@test.com, foo@bar |
|
688 | To: baz@test.com, foo@bar | |
689 |
|
689 | |||
690 | changeset b86bc16ff894 |
|
690 | changeset b86bc16ff894 | |
691 | diffs (11 lines): |
|
691 | diffs (11 lines): | |
692 |
|
692 | |||
693 | diff -r 14721b538ae3 -r b86bc16ff894 f1 |
|
693 | diff -r 14721b538ae3 -r b86bc16ff894 f1 | |
694 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
694 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
695 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 |
|
695 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 | |
696 | @@ -0,0 +1,7 @@ |
|
696 | @@ -0,0 +1,7 @@ | |
697 | +int main() { |
|
697 | +int main() { | |
698 | + int a = 0; |
|
698 | + int a = 0; | |
699 | + int b = 1; |
|
699 | + int b = 1; | |
700 | + int c = 2; |
|
700 | + int c = 2; | |
701 | + int d = 3; |
|
701 | + int d = 3; | |
702 | + return a + b + c + d; |
|
702 | + return a + b + c + d; | |
703 | +} |
|
703 | +} | |
704 | (run 'hg update' to get a working copy) |
|
704 | (run 'hg update' to get a working copy) | |
705 | $ cat > f1 << EOF |
|
705 | $ cat > f1 << EOF | |
706 | > int main() { |
|
706 | > int main() { | |
707 | > int a = 0; |
|
707 | > int a = 0; | |
708 | > int b = 1; |
|
708 | > int b = 1; | |
709 | > int c = 2; |
|
709 | > int c = 2; | |
710 | > int e = 3; |
|
710 | > int e = 3; | |
711 | > return a + b + c + e; |
|
711 | > return a + b + c + e; | |
712 | > } |
|
712 | > } | |
713 | > EOF |
|
713 | > EOF | |
714 | $ hg commit -m changefunction |
|
714 | $ hg commit -m changefunction | |
715 | $ hg --cwd ../b --config notify.showfunc=True pull ../a |
|
715 | $ hg --cwd ../b --config notify.showfunc=True pull ../a | |
716 | pulling from ../a |
|
716 | pulling from ../a | |
717 | searching for changes |
|
717 | searching for changes | |
718 | adding changesets |
|
718 | adding changesets | |
719 | adding manifests |
|
719 | adding manifests | |
720 | adding file changes |
|
720 | adding file changes | |
721 | added 1 changesets with 1 changes to 1 files |
|
721 | added 1 changesets with 1 changes to 1 files | |
722 | new changesets e81040e9838c |
|
722 | new changesets e81040e9838c | |
723 | MIME-Version: 1.0 |
|
723 | MIME-Version: 1.0 | |
724 | Content-Type: text/plain; charset="us-ascii" |
|
724 | Content-Type: text/plain; charset="us-ascii" | |
725 | Content-Transfer-Encoding: 7bit |
|
725 | Content-Transfer-Encoding: 7bit | |
726 | Date: * (glob) |
|
726 | Date: * (glob) | |
727 | Subject: changefunction |
|
727 | Subject: changefunction | |
728 | From: test@test.com |
|
728 | From: test@test.com | |
729 | X-Hg-Notification: changeset e81040e9838c |
|
729 | X-Hg-Notification: changeset e81040e9838c | |
730 | Message-Id: <hg.e81040e9838c.*.*@*> (glob) |
|
730 | Message-Id: <hg.e81040e9838c.*.*@*> (glob) | |
731 | To: baz@test.com, foo@bar |
|
731 | To: baz@test.com, foo@bar | |
732 |
|
732 | |||
733 | changeset e81040e9838c |
|
733 | changeset e81040e9838c | |
734 | diffs (12 lines): |
|
734 | diffs (12 lines): | |
735 |
|
735 | |||
736 | diff -r b86bc16ff894 -r e81040e9838c f1 |
|
736 | diff -r b86bc16ff894 -r e81040e9838c f1 | |
737 | --- a/f1 Thu Jan 01 00:00:00 1970 +0000 |
|
737 | --- a/f1 Thu Jan 01 00:00:00 1970 +0000 | |
738 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 |
|
738 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 | |
739 | @@ -2,6 +2,6 @@ int main() { |
|
739 | @@ -2,6 +2,6 @@ int main() { | |
740 | int a = 0; |
|
740 | int a = 0; | |
741 | int b = 1; |
|
741 | int b = 1; | |
742 | int c = 2; |
|
742 | int c = 2; | |
743 | - int d = 3; |
|
743 | - int d = 3; | |
744 | - return a + b + c + d; |
|
744 | - return a + b + c + d; | |
745 | + int e = 3; |
|
745 | + int e = 3; | |
746 | + return a + b + c + e; |
|
746 | + return a + b + c + e; | |
747 | } |
|
747 | } | |
748 | (run 'hg update' to get a working copy) |
|
748 | (run 'hg update' to get a working copy) |
@@ -1,1854 +1,1854 b'' | |||||
1 | $ HGENCODING=utf-8 |
|
1 | $ HGENCODING=utf-8 | |
2 | $ export HGENCODING |
|
2 | $ export HGENCODING | |
3 | $ cat >> $HGRCPATH << EOF |
|
3 | $ cat >> $HGRCPATH << EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > drawdag=$TESTDIR/drawdag.py |
|
5 | > drawdag=$TESTDIR/drawdag.py | |
6 | > EOF |
|
6 | > EOF | |
7 |
|
7 | |||
8 | $ try() { |
|
8 | $ try() { | |
9 | > hg debugrevspec --debug "$@" |
|
9 | > hg debugrevspec --debug "$@" | |
10 | > } |
|
10 | > } | |
11 |
|
11 | |||
12 | $ log() { |
|
12 | $ log() { | |
13 | > hg log --template '{rev}\n' -r "$1" |
|
13 | > hg log --template '{rev}\n' -r "$1" | |
14 | > } |
|
14 | > } | |
15 |
|
15 | |||
16 | $ hg init repo |
|
16 | $ hg init repo | |
17 | $ cd repo |
|
17 | $ cd repo | |
18 |
|
18 | |||
19 | $ echo a > a |
|
19 | $ echo a > a | |
20 | $ hg branch a |
|
20 | $ hg branch a | |
21 | marked working directory as branch a |
|
21 | marked working directory as branch a | |
22 | (branches are permanent and global, did you want a bookmark?) |
|
22 | (branches are permanent and global, did you want a bookmark?) | |
23 | $ hg ci -Aqm0 |
|
23 | $ hg ci -Aqm0 | |
24 |
|
24 | |||
25 | $ echo b > b |
|
25 | $ echo b > b | |
26 | $ hg branch b |
|
26 | $ hg branch b | |
27 | marked working directory as branch b |
|
27 | marked working directory as branch b | |
28 | $ hg ci -Aqm1 |
|
28 | $ hg ci -Aqm1 | |
29 |
|
29 | |||
30 | $ rm a |
|
30 | $ rm a | |
31 | $ hg branch a-b-c- |
|
31 | $ hg branch a-b-c- | |
32 | marked working directory as branch a-b-c- |
|
32 | marked working directory as branch a-b-c- | |
33 | $ hg ci -Aqm2 -u Bob |
|
33 | $ hg ci -Aqm2 -u Bob | |
34 |
|
34 | |||
35 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' |
|
35 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' | |
36 | 2 |
|
36 | 2 | |
37 | $ hg log -r "extra('branch')" --template '{rev}\n' |
|
37 | $ hg log -r "extra('branch')" --template '{rev}\n' | |
38 | 0 |
|
38 | 0 | |
39 | 1 |
|
39 | 1 | |
40 | 2 |
|
40 | 2 | |
41 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' |
|
41 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' | |
42 | 0 a |
|
42 | 0 a | |
43 | 2 a-b-c- |
|
43 | 2 a-b-c- | |
44 |
|
44 | |||
45 | $ hg co 1 |
|
45 | $ hg co 1 | |
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
47 | $ hg branch +a+b+c+ |
|
47 | $ hg branch +a+b+c+ | |
48 | marked working directory as branch +a+b+c+ |
|
48 | marked working directory as branch +a+b+c+ | |
49 | $ hg ci -Aqm3 |
|
49 | $ hg ci -Aqm3 | |
50 |
|
50 | |||
51 | $ hg co 2 # interleave |
|
51 | $ hg co 2 # interleave | |
52 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
52 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
53 | $ echo bb > b |
|
53 | $ echo bb > b | |
54 | $ hg branch -- -a-b-c- |
|
54 | $ hg branch -- -a-b-c- | |
55 | marked working directory as branch -a-b-c- |
|
55 | marked working directory as branch -a-b-c- | |
56 | $ hg ci -Aqm4 -d "May 12 2005" |
|
56 | $ hg ci -Aqm4 -d "May 12 2005" | |
57 |
|
57 | |||
58 | $ hg co 3 |
|
58 | $ hg co 3 | |
59 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
60 | $ hg branch !a/b/c/ |
|
60 | $ hg branch !a/b/c/ | |
61 | marked working directory as branch !a/b/c/ |
|
61 | marked working directory as branch !a/b/c/ | |
62 | $ hg ci -Aqm"5 bug" |
|
62 | $ hg ci -Aqm"5 bug" | |
63 |
|
63 | |||
64 | $ hg merge 4 |
|
64 | $ hg merge 4 | |
65 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
65 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
66 | (branch merge, don't forget to commit) |
|
66 | (branch merge, don't forget to commit) | |
67 | $ hg branch _a_b_c_ |
|
67 | $ hg branch _a_b_c_ | |
68 | marked working directory as branch _a_b_c_ |
|
68 | marked working directory as branch _a_b_c_ | |
69 | $ hg ci -Aqm"6 issue619" |
|
69 | $ hg ci -Aqm"6 issue619" | |
70 |
|
70 | |||
71 | $ hg branch .a.b.c. |
|
71 | $ hg branch .a.b.c. | |
72 | marked working directory as branch .a.b.c. |
|
72 | marked working directory as branch .a.b.c. | |
73 | $ hg ci -Aqm7 |
|
73 | $ hg ci -Aqm7 | |
74 |
|
74 | |||
75 | $ hg branch all |
|
75 | $ hg branch all | |
76 | marked working directory as branch all |
|
76 | marked working directory as branch all | |
77 |
|
77 | |||
78 | $ hg co 4 |
|
78 | $ hg co 4 | |
79 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
80 | $ hg branch Γ© |
|
80 | $ hg branch Γ© | |
81 | marked working directory as branch \xc3\xa9 (esc) |
|
81 | marked working directory as branch \xc3\xa9 (esc) | |
82 | $ hg ci -Aqm9 |
|
82 | $ hg ci -Aqm9 | |
83 |
|
83 | |||
84 | $ hg tag -r6 1.0 |
|
84 | $ hg tag -r6 1.0 | |
85 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
85 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
86 |
|
86 | |||
87 | $ hg clone --quiet -U -r 7 . ../remote1 |
|
87 | $ hg clone --quiet -U -r 7 . ../remote1 | |
88 | $ hg clone --quiet -U -r 8 . ../remote2 |
|
88 | $ hg clone --quiet -U -r 8 . ../remote2 | |
89 | $ echo "[paths]" >> .hg/hgrc |
|
89 | $ echo "[paths]" >> .hg/hgrc | |
90 | $ echo "default = ../remote1" >> .hg/hgrc |
|
90 | $ echo "default = ../remote1" >> .hg/hgrc | |
91 |
|
91 | |||
92 | test subtracting something from an addset |
|
92 | test subtracting something from an addset | |
93 |
|
93 | |||
94 | $ log '(outgoing() or removes(a)) - removes(a)' |
|
94 | $ log '(outgoing() or removes(a)) - removes(a)' | |
95 | 8 |
|
95 | 8 | |
96 | 9 |
|
96 | 9 | |
97 |
|
97 | |||
98 | test intersecting something with an addset |
|
98 | test intersecting something with an addset | |
99 |
|
99 | |||
100 | $ log 'parents(outgoing() or removes(a))' |
|
100 | $ log 'parents(outgoing() or removes(a))' | |
101 | 1 |
|
101 | 1 | |
102 | 4 |
|
102 | 4 | |
103 | 5 |
|
103 | 5 | |
104 | 8 |
|
104 | 8 | |
105 |
|
105 | |||
106 | test that `or` operation combines elements in the right order: |
|
106 | test that `or` operation combines elements in the right order: | |
107 |
|
107 | |||
108 | $ log '3:4 or 2:5' |
|
108 | $ log '3:4 or 2:5' | |
109 | 3 |
|
109 | 3 | |
110 | 4 |
|
110 | 4 | |
111 | 2 |
|
111 | 2 | |
112 | 5 |
|
112 | 5 | |
113 | $ log '3:4 or 5:2' |
|
113 | $ log '3:4 or 5:2' | |
114 | 3 |
|
114 | 3 | |
115 | 4 |
|
115 | 4 | |
116 | 5 |
|
116 | 5 | |
117 | 2 |
|
117 | 2 | |
118 | $ log 'sort(3:4 or 2:5)' |
|
118 | $ log 'sort(3:4 or 2:5)' | |
119 | 2 |
|
119 | 2 | |
120 | 3 |
|
120 | 3 | |
121 | 4 |
|
121 | 4 | |
122 | 5 |
|
122 | 5 | |
123 | $ log 'sort(3:4 or 5:2)' |
|
123 | $ log 'sort(3:4 or 5:2)' | |
124 | 2 |
|
124 | 2 | |
125 | 3 |
|
125 | 3 | |
126 | 4 |
|
126 | 4 | |
127 | 5 |
|
127 | 5 | |
128 |
|
128 | |||
129 | test that more than one `-r`s are combined in the right order and deduplicated: |
|
129 | test that more than one `-r`s are combined in the right order and deduplicated: | |
130 |
|
130 | |||
131 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' |
|
131 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' | |
132 | 3 |
|
132 | 3 | |
133 | 4 |
|
133 | 4 | |
134 | 5 |
|
134 | 5 | |
135 | 2 |
|
135 | 2 | |
136 | 0 |
|
136 | 0 | |
137 | 1 |
|
137 | 1 | |
138 |
|
138 | |||
139 | test that `or` operation skips duplicated revisions from right-hand side |
|
139 | test that `or` operation skips duplicated revisions from right-hand side | |
140 |
|
140 | |||
141 | $ try 'reverse(1::5) or ancestors(4)' |
|
141 | $ try 'reverse(1::5) or ancestors(4)' | |
142 | (or |
|
142 | (or | |
143 | (list |
|
143 | (list | |
144 | (func |
|
144 | (func | |
145 | (symbol 'reverse') |
|
145 | (symbol 'reverse') | |
146 | (dagrange |
|
146 | (dagrange | |
147 | (symbol '1') |
|
147 | (symbol '1') | |
148 | (symbol '5'))) |
|
148 | (symbol '5'))) | |
149 | (func |
|
149 | (func | |
150 | (symbol 'ancestors') |
|
150 | (symbol 'ancestors') | |
151 | (symbol '4')))) |
|
151 | (symbol '4')))) | |
152 | * set: |
|
152 | * set: | |
153 | <addset |
|
153 | <addset | |
154 | <baseset- [1, 3, 5]>, |
|
154 | <baseset- [1, 3, 5]>, | |
155 | <generatorsetdesc+>> |
|
155 | <generatorsetdesc+>> | |
156 | 5 |
|
156 | 5 | |
157 | 3 |
|
157 | 3 | |
158 | 1 |
|
158 | 1 | |
159 | 0 |
|
159 | 0 | |
160 | 2 |
|
160 | 2 | |
161 | 4 |
|
161 | 4 | |
162 | $ try 'sort(ancestors(4) or reverse(1::5))' |
|
162 | $ try 'sort(ancestors(4) or reverse(1::5))' | |
163 | (func |
|
163 | (func | |
164 | (symbol 'sort') |
|
164 | (symbol 'sort') | |
165 | (or |
|
165 | (or | |
166 | (list |
|
166 | (list | |
167 | (func |
|
167 | (func | |
168 | (symbol 'ancestors') |
|
168 | (symbol 'ancestors') | |
169 | (symbol '4')) |
|
169 | (symbol '4')) | |
170 | (func |
|
170 | (func | |
171 | (symbol 'reverse') |
|
171 | (symbol 'reverse') | |
172 | (dagrange |
|
172 | (dagrange | |
173 | (symbol '1') |
|
173 | (symbol '1') | |
174 | (symbol '5')))))) |
|
174 | (symbol '5')))))) | |
175 | * set: |
|
175 | * set: | |
176 | <addset+ |
|
176 | <addset+ | |
177 | <generatorsetdesc+>, |
|
177 | <generatorsetdesc+>, | |
178 | <baseset- [1, 3, 5]>> |
|
178 | <baseset- [1, 3, 5]>> | |
179 | 0 |
|
179 | 0 | |
180 | 1 |
|
180 | 1 | |
181 | 2 |
|
181 | 2 | |
182 | 3 |
|
182 | 3 | |
183 | 4 |
|
183 | 4 | |
184 | 5 |
|
184 | 5 | |
185 |
|
185 | |||
186 | test optimization of trivial `or` operation |
|
186 | test optimization of trivial `or` operation | |
187 |
|
187 | |||
188 | $ try --optimize '0|(1)|"2"|-2|tip|null' |
|
188 | $ try --optimize '0|(1)|"2"|-2|tip|null' | |
189 | (or |
|
189 | (or | |
190 | (list |
|
190 | (list | |
191 | (symbol '0') |
|
191 | (symbol '0') | |
192 | (group |
|
192 | (group | |
193 | (symbol '1')) |
|
193 | (symbol '1')) | |
194 | (string '2') |
|
194 | (string '2') | |
195 | (negate |
|
195 | (negate | |
196 | (symbol '2')) |
|
196 | (symbol '2')) | |
197 | (symbol 'tip') |
|
197 | (symbol 'tip') | |
198 | (symbol 'null'))) |
|
198 | (symbol 'null'))) | |
199 | * optimized: |
|
199 | * optimized: | |
200 | (func |
|
200 | (func | |
201 | (symbol '_list') |
|
201 | (symbol '_list') | |
202 | (string '0\x001\x002\x00-2\x00tip\x00null')) |
|
202 | (string '0\x001\x002\x00-2\x00tip\x00null')) | |
203 | * set: |
|
203 | * set: | |
204 | <baseset [0, 1, 2, 8, 9, -1]> |
|
204 | <baseset [0, 1, 2, 8, 9, -1]> | |
205 | 0 |
|
205 | 0 | |
206 | 1 |
|
206 | 1 | |
207 | 2 |
|
207 | 2 | |
208 | 8 |
|
208 | 8 | |
209 | 9 |
|
209 | 9 | |
210 | -1 |
|
210 | -1 | |
211 |
|
211 | |||
212 | $ try --optimize '0|1|2:3' |
|
212 | $ try --optimize '0|1|2:3' | |
213 | (or |
|
213 | (or | |
214 | (list |
|
214 | (list | |
215 | (symbol '0') |
|
215 | (symbol '0') | |
216 | (symbol '1') |
|
216 | (symbol '1') | |
217 | (range |
|
217 | (range | |
218 | (symbol '2') |
|
218 | (symbol '2') | |
219 | (symbol '3')))) |
|
219 | (symbol '3')))) | |
220 | * optimized: |
|
220 | * optimized: | |
221 | (or |
|
221 | (or | |
222 | (list |
|
222 | (list | |
223 | (func |
|
223 | (func | |
224 | (symbol '_list') |
|
224 | (symbol '_list') | |
225 | (string '0\x001')) |
|
225 | (string '0\x001')) | |
226 | (range |
|
226 | (range | |
227 | (symbol '2') |
|
227 | (symbol '2') | |
228 | (symbol '3')))) |
|
228 | (symbol '3')))) | |
229 | * set: |
|
229 | * set: | |
230 | <addset |
|
230 | <addset | |
231 | <baseset [0, 1]>, |
|
231 | <baseset [0, 1]>, | |
232 | <spanset+ 2:4>> |
|
232 | <spanset+ 2:4>> | |
233 | 0 |
|
233 | 0 | |
234 | 1 |
|
234 | 1 | |
235 | 2 |
|
235 | 2 | |
236 | 3 |
|
236 | 3 | |
237 |
|
237 | |||
238 | $ try --optimize '0:1|2|3:4|5|6' |
|
238 | $ try --optimize '0:1|2|3:4|5|6' | |
239 | (or |
|
239 | (or | |
240 | (list |
|
240 | (list | |
241 | (range |
|
241 | (range | |
242 | (symbol '0') |
|
242 | (symbol '0') | |
243 | (symbol '1')) |
|
243 | (symbol '1')) | |
244 | (symbol '2') |
|
244 | (symbol '2') | |
245 | (range |
|
245 | (range | |
246 | (symbol '3') |
|
246 | (symbol '3') | |
247 | (symbol '4')) |
|
247 | (symbol '4')) | |
248 | (symbol '5') |
|
248 | (symbol '5') | |
249 | (symbol '6'))) |
|
249 | (symbol '6'))) | |
250 | * optimized: |
|
250 | * optimized: | |
251 | (or |
|
251 | (or | |
252 | (list |
|
252 | (list | |
253 | (range |
|
253 | (range | |
254 | (symbol '0') |
|
254 | (symbol '0') | |
255 | (symbol '1')) |
|
255 | (symbol '1')) | |
256 | (symbol '2') |
|
256 | (symbol '2') | |
257 | (range |
|
257 | (range | |
258 | (symbol '3') |
|
258 | (symbol '3') | |
259 | (symbol '4')) |
|
259 | (symbol '4')) | |
260 | (func |
|
260 | (func | |
261 | (symbol '_list') |
|
261 | (symbol '_list') | |
262 | (string '5\x006')))) |
|
262 | (string '5\x006')))) | |
263 | * set: |
|
263 | * set: | |
264 | <addset |
|
264 | <addset | |
265 | <addset |
|
265 | <addset | |
266 | <spanset+ 0:2>, |
|
266 | <spanset+ 0:2>, | |
267 | <baseset [2]>>, |
|
267 | <baseset [2]>>, | |
268 | <addset |
|
268 | <addset | |
269 | <spanset+ 3:5>, |
|
269 | <spanset+ 3:5>, | |
270 | <baseset [5, 6]>>> |
|
270 | <baseset [5, 6]>>> | |
271 | 0 |
|
271 | 0 | |
272 | 1 |
|
272 | 1 | |
273 | 2 |
|
273 | 2 | |
274 | 3 |
|
274 | 3 | |
275 | 4 |
|
275 | 4 | |
276 | 5 |
|
276 | 5 | |
277 | 6 |
|
277 | 6 | |
278 |
|
278 | |||
279 | unoptimized `or` looks like this |
|
279 | unoptimized `or` looks like this | |
280 |
|
280 | |||
281 | $ try --no-optimized -p analyzed '0|1|2|3|4' |
|
281 | $ try --no-optimized -p analyzed '0|1|2|3|4' | |
282 | * analyzed: |
|
282 | * analyzed: | |
283 | (or |
|
283 | (or | |
284 | (list |
|
284 | (list | |
285 | (symbol '0') |
|
285 | (symbol '0') | |
286 | (symbol '1') |
|
286 | (symbol '1') | |
287 | (symbol '2') |
|
287 | (symbol '2') | |
288 | (symbol '3') |
|
288 | (symbol '3') | |
289 | (symbol '4'))) |
|
289 | (symbol '4'))) | |
290 | * set: |
|
290 | * set: | |
291 | <addset |
|
291 | <addset | |
292 | <addset |
|
292 | <addset | |
293 | <baseset [0]>, |
|
293 | <baseset [0]>, | |
294 | <baseset [1]>>, |
|
294 | <baseset [1]>>, | |
295 | <addset |
|
295 | <addset | |
296 | <baseset [2]>, |
|
296 | <baseset [2]>, | |
297 | <addset |
|
297 | <addset | |
298 | <baseset [3]>, |
|
298 | <baseset [3]>, | |
299 | <baseset [4]>>>> |
|
299 | <baseset [4]>>>> | |
300 | 0 |
|
300 | 0 | |
301 | 1 |
|
301 | 1 | |
302 | 2 |
|
302 | 2 | |
303 | 3 |
|
303 | 3 | |
304 | 4 |
|
304 | 4 | |
305 |
|
305 | |||
306 | test that `_list` should be narrowed by provided `subset` |
|
306 | test that `_list` should be narrowed by provided `subset` | |
307 |
|
307 | |||
308 | $ log '0:2 and (null|1|2|3)' |
|
308 | $ log '0:2 and (null|1|2|3)' | |
309 | 1 |
|
309 | 1 | |
310 | 2 |
|
310 | 2 | |
311 |
|
311 | |||
312 | test that `_list` should remove duplicates |
|
312 | test that `_list` should remove duplicates | |
313 |
|
313 | |||
314 | $ log '0|1|2|1|2|-1|tip' |
|
314 | $ log '0|1|2|1|2|-1|tip' | |
315 | 0 |
|
315 | 0 | |
316 | 1 |
|
316 | 1 | |
317 | 2 |
|
317 | 2 | |
318 | 9 |
|
318 | 9 | |
319 |
|
319 | |||
320 | test unknown revision in `_list` |
|
320 | test unknown revision in `_list` | |
321 |
|
321 | |||
322 | $ log '0|unknown' |
|
322 | $ log '0|unknown' | |
323 | abort: unknown revision 'unknown'! |
|
323 | abort: unknown revision 'unknown'! | |
324 | [255] |
|
324 | [255] | |
325 |
|
325 | |||
326 | test integer range in `_list` |
|
326 | test integer range in `_list` | |
327 |
|
327 | |||
328 | $ log '-1|-10' |
|
328 | $ log '-1|-10' | |
329 | 9 |
|
329 | 9 | |
330 | 0 |
|
330 | 0 | |
331 |
|
331 | |||
332 | $ log '-10|-11' |
|
332 | $ log '-10|-11' | |
333 | abort: unknown revision '-11'! |
|
333 | abort: unknown revision '-11'! | |
334 | [255] |
|
334 | [255] | |
335 |
|
335 | |||
336 | $ log '9|10' |
|
336 | $ log '9|10' | |
337 | abort: unknown revision '10'! |
|
337 | abort: unknown revision '10'! | |
338 | [255] |
|
338 | [255] | |
339 |
|
339 | |||
340 | test '0000' != '0' in `_list` |
|
340 | test '0000' != '0' in `_list` | |
341 |
|
341 | |||
342 | $ log '0|0000' |
|
342 | $ log '0|0000' | |
343 | 0 |
|
343 | 0 | |
344 | -1 |
|
344 | -1 | |
345 |
|
345 | |||
346 | test ',' in `_list` |
|
346 | test ',' in `_list` | |
347 | $ log '0,1' |
|
347 | $ log '0,1' | |
348 | hg: parse error: can't use a list in this context |
|
348 | hg: parse error: can't use a list in this context | |
349 | (see 'hg help "revsets.x or y"') |
|
349 | (see 'hg help "revsets.x or y"') | |
350 | [255] |
|
350 | [255] | |
351 | $ try '0,1,2' |
|
351 | $ try '0,1,2' | |
352 | (list |
|
352 | (list | |
353 | (symbol '0') |
|
353 | (symbol '0') | |
354 | (symbol '1') |
|
354 | (symbol '1') | |
355 | (symbol '2')) |
|
355 | (symbol '2')) | |
356 | hg: parse error: can't use a list in this context |
|
356 | hg: parse error: can't use a list in this context | |
357 | (see 'hg help "revsets.x or y"') |
|
357 | (see 'hg help "revsets.x or y"') | |
358 | [255] |
|
358 | [255] | |
359 |
|
359 | |||
360 | test that chained `or` operations make balanced addsets |
|
360 | test that chained `or` operations make balanced addsets | |
361 |
|
361 | |||
362 | $ try '0:1|1:2|2:3|3:4|4:5' |
|
362 | $ try '0:1|1:2|2:3|3:4|4:5' | |
363 | (or |
|
363 | (or | |
364 | (list |
|
364 | (list | |
365 | (range |
|
365 | (range | |
366 | (symbol '0') |
|
366 | (symbol '0') | |
367 | (symbol '1')) |
|
367 | (symbol '1')) | |
368 | (range |
|
368 | (range | |
369 | (symbol '1') |
|
369 | (symbol '1') | |
370 | (symbol '2')) |
|
370 | (symbol '2')) | |
371 | (range |
|
371 | (range | |
372 | (symbol '2') |
|
372 | (symbol '2') | |
373 | (symbol '3')) |
|
373 | (symbol '3')) | |
374 | (range |
|
374 | (range | |
375 | (symbol '3') |
|
375 | (symbol '3') | |
376 | (symbol '4')) |
|
376 | (symbol '4')) | |
377 | (range |
|
377 | (range | |
378 | (symbol '4') |
|
378 | (symbol '4') | |
379 | (symbol '5')))) |
|
379 | (symbol '5')))) | |
380 | * set: |
|
380 | * set: | |
381 | <addset |
|
381 | <addset | |
382 | <addset |
|
382 | <addset | |
383 | <spanset+ 0:2>, |
|
383 | <spanset+ 0:2>, | |
384 | <spanset+ 1:3>>, |
|
384 | <spanset+ 1:3>>, | |
385 | <addset |
|
385 | <addset | |
386 | <spanset+ 2:4>, |
|
386 | <spanset+ 2:4>, | |
387 | <addset |
|
387 | <addset | |
388 | <spanset+ 3:5>, |
|
388 | <spanset+ 3:5>, | |
389 | <spanset+ 4:6>>>> |
|
389 | <spanset+ 4:6>>>> | |
390 | 0 |
|
390 | 0 | |
391 | 1 |
|
391 | 1 | |
392 | 2 |
|
392 | 2 | |
393 | 3 |
|
393 | 3 | |
394 | 4 |
|
394 | 4 | |
395 | 5 |
|
395 | 5 | |
396 |
|
396 | |||
397 | no crash by empty group "()" while optimizing `or` operations |
|
397 | no crash by empty group "()" while optimizing `or` operations | |
398 |
|
398 | |||
399 | $ try --optimize '0|()' |
|
399 | $ try --optimize '0|()' | |
400 | (or |
|
400 | (or | |
401 | (list |
|
401 | (list | |
402 | (symbol '0') |
|
402 | (symbol '0') | |
403 | (group |
|
403 | (group | |
404 | None))) |
|
404 | None))) | |
405 | * optimized: |
|
405 | * optimized: | |
406 | (or |
|
406 | (or | |
407 | (list |
|
407 | (list | |
408 | (symbol '0') |
|
408 | (symbol '0') | |
409 | None)) |
|
409 | None)) | |
410 | hg: parse error: missing argument |
|
410 | hg: parse error: missing argument | |
411 | [255] |
|
411 | [255] | |
412 |
|
412 | |||
413 | test that chained `or` operations never eat up stack (issue4624) |
|
413 | test that chained `or` operations never eat up stack (issue4624) | |
414 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) |
|
414 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) | |
415 |
|
415 | |||
416 |
$ hg log -T '{rev}\n' -r `"$PYTHON" -c "print |
|
416 | $ hg log -T '{rev}\n' -r `"$PYTHON" -c "print('+'.join(['0:1'] * 500))"` | |
417 | 0 |
|
417 | 0 | |
418 | 1 |
|
418 | 1 | |
419 |
|
419 | |||
420 | test that repeated `-r` options never eat up stack (issue4565) |
|
420 | test that repeated `-r` options never eat up stack (issue4565) | |
421 | (uses `-r 0::1` to avoid possible optimization at old-style parser) |
|
421 | (uses `-r 0::1` to avoid possible optimization at old-style parser) | |
422 |
|
422 | |||
423 |
$ hg log -T '{rev}\n' `"$PYTHON" -c "for i in range(500): print |
|
423 | $ hg log -T '{rev}\n' `"$PYTHON" -c "for i in range(500): print('-r 0::1 ')"` | |
424 | 0 |
|
424 | 0 | |
425 | 1 |
|
425 | 1 | |
426 |
|
426 | |||
427 | check that conversion to only works |
|
427 | check that conversion to only works | |
428 | $ try --optimize '::3 - ::1' |
|
428 | $ try --optimize '::3 - ::1' | |
429 | (minus |
|
429 | (minus | |
430 | (dagrangepre |
|
430 | (dagrangepre | |
431 | (symbol '3')) |
|
431 | (symbol '3')) | |
432 | (dagrangepre |
|
432 | (dagrangepre | |
433 | (symbol '1'))) |
|
433 | (symbol '1'))) | |
434 | * optimized: |
|
434 | * optimized: | |
435 | (func |
|
435 | (func | |
436 | (symbol 'only') |
|
436 | (symbol 'only') | |
437 | (list |
|
437 | (list | |
438 | (symbol '3') |
|
438 | (symbol '3') | |
439 | (symbol '1'))) |
|
439 | (symbol '1'))) | |
440 | * set: |
|
440 | * set: | |
441 | <baseset+ [3]> |
|
441 | <baseset+ [3]> | |
442 | 3 |
|
442 | 3 | |
443 | $ try --optimize 'ancestors(1) - ancestors(3)' |
|
443 | $ try --optimize 'ancestors(1) - ancestors(3)' | |
444 | (minus |
|
444 | (minus | |
445 | (func |
|
445 | (func | |
446 | (symbol 'ancestors') |
|
446 | (symbol 'ancestors') | |
447 | (symbol '1')) |
|
447 | (symbol '1')) | |
448 | (func |
|
448 | (func | |
449 | (symbol 'ancestors') |
|
449 | (symbol 'ancestors') | |
450 | (symbol '3'))) |
|
450 | (symbol '3'))) | |
451 | * optimized: |
|
451 | * optimized: | |
452 | (func |
|
452 | (func | |
453 | (symbol 'only') |
|
453 | (symbol 'only') | |
454 | (list |
|
454 | (list | |
455 | (symbol '1') |
|
455 | (symbol '1') | |
456 | (symbol '3'))) |
|
456 | (symbol '3'))) | |
457 | * set: |
|
457 | * set: | |
458 | <baseset+ []> |
|
458 | <baseset+ []> | |
459 | $ try --optimize 'not ::2 and ::6' |
|
459 | $ try --optimize 'not ::2 and ::6' | |
460 | (and |
|
460 | (and | |
461 | (not |
|
461 | (not | |
462 | (dagrangepre |
|
462 | (dagrangepre | |
463 | (symbol '2'))) |
|
463 | (symbol '2'))) | |
464 | (dagrangepre |
|
464 | (dagrangepre | |
465 | (symbol '6'))) |
|
465 | (symbol '6'))) | |
466 | * optimized: |
|
466 | * optimized: | |
467 | (func |
|
467 | (func | |
468 | (symbol 'only') |
|
468 | (symbol 'only') | |
469 | (list |
|
469 | (list | |
470 | (symbol '6') |
|
470 | (symbol '6') | |
471 | (symbol '2'))) |
|
471 | (symbol '2'))) | |
472 | * set: |
|
472 | * set: | |
473 | <baseset+ [3, 4, 5, 6]> |
|
473 | <baseset+ [3, 4, 5, 6]> | |
474 | 3 |
|
474 | 3 | |
475 | 4 |
|
475 | 4 | |
476 | 5 |
|
476 | 5 | |
477 | 6 |
|
477 | 6 | |
478 | $ try --optimize 'ancestors(6) and not ancestors(4)' |
|
478 | $ try --optimize 'ancestors(6) and not ancestors(4)' | |
479 | (and |
|
479 | (and | |
480 | (func |
|
480 | (func | |
481 | (symbol 'ancestors') |
|
481 | (symbol 'ancestors') | |
482 | (symbol '6')) |
|
482 | (symbol '6')) | |
483 | (not |
|
483 | (not | |
484 | (func |
|
484 | (func | |
485 | (symbol 'ancestors') |
|
485 | (symbol 'ancestors') | |
486 | (symbol '4')))) |
|
486 | (symbol '4')))) | |
487 | * optimized: |
|
487 | * optimized: | |
488 | (func |
|
488 | (func | |
489 | (symbol 'only') |
|
489 | (symbol 'only') | |
490 | (list |
|
490 | (list | |
491 | (symbol '6') |
|
491 | (symbol '6') | |
492 | (symbol '4'))) |
|
492 | (symbol '4'))) | |
493 | * set: |
|
493 | * set: | |
494 | <baseset+ [3, 5, 6]> |
|
494 | <baseset+ [3, 5, 6]> | |
495 | 3 |
|
495 | 3 | |
496 | 5 |
|
496 | 5 | |
497 | 6 |
|
497 | 6 | |
498 |
|
498 | |||
499 | no crash by empty group "()" while optimizing to "only()" |
|
499 | no crash by empty group "()" while optimizing to "only()" | |
500 |
|
500 | |||
501 | $ try --optimize '::1 and ()' |
|
501 | $ try --optimize '::1 and ()' | |
502 | (and |
|
502 | (and | |
503 | (dagrangepre |
|
503 | (dagrangepre | |
504 | (symbol '1')) |
|
504 | (symbol '1')) | |
505 | (group |
|
505 | (group | |
506 | None)) |
|
506 | None)) | |
507 | * optimized: |
|
507 | * optimized: | |
508 | (andsmally |
|
508 | (andsmally | |
509 | (func |
|
509 | (func | |
510 | (symbol 'ancestors') |
|
510 | (symbol 'ancestors') | |
511 | (symbol '1')) |
|
511 | (symbol '1')) | |
512 | None) |
|
512 | None) | |
513 | hg: parse error: missing argument |
|
513 | hg: parse error: missing argument | |
514 | [255] |
|
514 | [255] | |
515 |
|
515 | |||
516 | optimization to only() works only if ancestors() takes only one argument |
|
516 | optimization to only() works only if ancestors() takes only one argument | |
517 |
|
517 | |||
518 | $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' |
|
518 | $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' | |
519 | * optimized: |
|
519 | * optimized: | |
520 | (difference |
|
520 | (difference | |
521 | (func |
|
521 | (func | |
522 | (symbol 'ancestors') |
|
522 | (symbol 'ancestors') | |
523 | (symbol '6')) |
|
523 | (symbol '6')) | |
524 | (func |
|
524 | (func | |
525 | (symbol 'ancestors') |
|
525 | (symbol 'ancestors') | |
526 | (list |
|
526 | (list | |
527 | (symbol '4') |
|
527 | (symbol '4') | |
528 | (symbol '1')))) |
|
528 | (symbol '1')))) | |
529 | 0 |
|
529 | 0 | |
530 | 1 |
|
530 | 1 | |
531 | 3 |
|
531 | 3 | |
532 | 5 |
|
532 | 5 | |
533 | 6 |
|
533 | 6 | |
534 | $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' |
|
534 | $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' | |
535 | * optimized: |
|
535 | * optimized: | |
536 | (difference |
|
536 | (difference | |
537 | (func |
|
537 | (func | |
538 | (symbol 'ancestors') |
|
538 | (symbol 'ancestors') | |
539 | (list |
|
539 | (list | |
540 | (symbol '6') |
|
540 | (symbol '6') | |
541 | (symbol '1'))) |
|
541 | (symbol '1'))) | |
542 | (func |
|
542 | (func | |
543 | (symbol 'ancestors') |
|
543 | (symbol 'ancestors') | |
544 | (symbol '4'))) |
|
544 | (symbol '4'))) | |
545 | 5 |
|
545 | 5 | |
546 | 6 |
|
546 | 6 | |
547 |
|
547 | |||
548 | optimization disabled if keyword arguments passed (because we're too lazy |
|
548 | optimization disabled if keyword arguments passed (because we're too lazy | |
549 | to support it) |
|
549 | to support it) | |
550 |
|
550 | |||
551 | $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' |
|
551 | $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' | |
552 | * optimized: |
|
552 | * optimized: | |
553 | (difference |
|
553 | (difference | |
554 | (func |
|
554 | (func | |
555 | (symbol 'ancestors') |
|
555 | (symbol 'ancestors') | |
556 | (keyvalue |
|
556 | (keyvalue | |
557 | (symbol 'set') |
|
557 | (symbol 'set') | |
558 | (symbol '6'))) |
|
558 | (symbol '6'))) | |
559 | (func |
|
559 | (func | |
560 | (symbol 'ancestors') |
|
560 | (symbol 'ancestors') | |
561 | (keyvalue |
|
561 | (keyvalue | |
562 | (symbol 'set') |
|
562 | (symbol 'set') | |
563 | (symbol '4')))) |
|
563 | (symbol '4')))) | |
564 | 3 |
|
564 | 3 | |
565 | 5 |
|
565 | 5 | |
566 | 6 |
|
566 | 6 | |
567 |
|
567 | |||
568 | invalid function call should not be optimized to only() |
|
568 | invalid function call should not be optimized to only() | |
569 |
|
569 | |||
570 | $ log '"ancestors"(6) and not ancestors(4)' |
|
570 | $ log '"ancestors"(6) and not ancestors(4)' | |
571 | hg: parse error: not a symbol |
|
571 | hg: parse error: not a symbol | |
572 | [255] |
|
572 | [255] | |
573 |
|
573 | |||
574 | $ log 'ancestors(6) and not "ancestors"(4)' |
|
574 | $ log 'ancestors(6) and not "ancestors"(4)' | |
575 | hg: parse error: not a symbol |
|
575 | hg: parse error: not a symbol | |
576 | [255] |
|
576 | [255] | |
577 |
|
577 | |||
578 | test empty string |
|
578 | test empty string | |
579 |
|
579 | |||
580 | $ log '' |
|
580 | $ log '' | |
581 | hg: parse error: empty query |
|
581 | hg: parse error: empty query | |
582 | [255] |
|
582 | [255] | |
583 | $ log 'parents("")' |
|
583 | $ log 'parents("")' | |
584 | hg: parse error: empty string is not a valid revision |
|
584 | hg: parse error: empty string is not a valid revision | |
585 | [255] |
|
585 | [255] | |
586 |
|
586 | |||
587 | test empty revset |
|
587 | test empty revset | |
588 | $ hg log 'none()' |
|
588 | $ hg log 'none()' | |
589 |
|
589 | |||
590 | we can use patterns when searching for tags |
|
590 | we can use patterns when searching for tags | |
591 |
|
591 | |||
592 | $ log 'tag("1..*")' |
|
592 | $ log 'tag("1..*")' | |
593 | abort: tag '1..*' does not exist! |
|
593 | abort: tag '1..*' does not exist! | |
594 | [255] |
|
594 | [255] | |
595 | $ log 'tag("re:1..*")' |
|
595 | $ log 'tag("re:1..*")' | |
596 | 6 |
|
596 | 6 | |
597 | $ log 'tag("re:[0-9].[0-9]")' |
|
597 | $ log 'tag("re:[0-9].[0-9]")' | |
598 | 6 |
|
598 | 6 | |
599 | $ log 'tag("literal:1.0")' |
|
599 | $ log 'tag("literal:1.0")' | |
600 | 6 |
|
600 | 6 | |
601 | $ log 'tag("re:0..*")' |
|
601 | $ log 'tag("re:0..*")' | |
602 |
|
602 | |||
603 | $ log 'tag(unknown)' |
|
603 | $ log 'tag(unknown)' | |
604 | abort: tag 'unknown' does not exist! |
|
604 | abort: tag 'unknown' does not exist! | |
605 | [255] |
|
605 | [255] | |
606 | $ log 'tag("re:unknown")' |
|
606 | $ log 'tag("re:unknown")' | |
607 | $ log 'present(tag("unknown"))' |
|
607 | $ log 'present(tag("unknown"))' | |
608 | $ log 'present(tag("re:unknown"))' |
|
608 | $ log 'present(tag("re:unknown"))' | |
609 | $ log 'branch(unknown)' |
|
609 | $ log 'branch(unknown)' | |
610 | abort: unknown revision 'unknown'! |
|
610 | abort: unknown revision 'unknown'! | |
611 | [255] |
|
611 | [255] | |
612 | $ log 'branch("literal:unknown")' |
|
612 | $ log 'branch("literal:unknown")' | |
613 | abort: branch 'unknown' does not exist! |
|
613 | abort: branch 'unknown' does not exist! | |
614 | [255] |
|
614 | [255] | |
615 | $ log 'branch("re:unknown")' |
|
615 | $ log 'branch("re:unknown")' | |
616 | $ log 'present(branch("unknown"))' |
|
616 | $ log 'present(branch("unknown"))' | |
617 | $ log 'present(branch("re:unknown"))' |
|
617 | $ log 'present(branch("re:unknown"))' | |
618 | $ log 'user(bob)' |
|
618 | $ log 'user(bob)' | |
619 | 2 |
|
619 | 2 | |
620 |
|
620 | |||
621 | $ log '4::8' |
|
621 | $ log '4::8' | |
622 | 4 |
|
622 | 4 | |
623 | 8 |
|
623 | 8 | |
624 | $ log '4:8' |
|
624 | $ log '4:8' | |
625 | 4 |
|
625 | 4 | |
626 | 5 |
|
626 | 5 | |
627 | 6 |
|
627 | 6 | |
628 | 7 |
|
628 | 7 | |
629 | 8 |
|
629 | 8 | |
630 |
|
630 | |||
631 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' |
|
631 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' | |
632 | 4 |
|
632 | 4 | |
633 | 2 |
|
633 | 2 | |
634 | 5 |
|
634 | 5 | |
635 |
|
635 | |||
636 | $ log 'not 0 and 0:2' |
|
636 | $ log 'not 0 and 0:2' | |
637 | 1 |
|
637 | 1 | |
638 | 2 |
|
638 | 2 | |
639 | $ log 'not 1 and 0:2' |
|
639 | $ log 'not 1 and 0:2' | |
640 | 0 |
|
640 | 0 | |
641 | 2 |
|
641 | 2 | |
642 | $ log 'not 2 and 0:2' |
|
642 | $ log 'not 2 and 0:2' | |
643 | 0 |
|
643 | 0 | |
644 | 1 |
|
644 | 1 | |
645 | $ log '(1 and 2)::' |
|
645 | $ log '(1 and 2)::' | |
646 | $ log '(1 and 2):' |
|
646 | $ log '(1 and 2):' | |
647 | $ log '(1 and 2):3' |
|
647 | $ log '(1 and 2):3' | |
648 | $ log 'sort(head(), -rev)' |
|
648 | $ log 'sort(head(), -rev)' | |
649 | 9 |
|
649 | 9 | |
650 | 7 |
|
650 | 7 | |
651 | 6 |
|
651 | 6 | |
652 | 5 |
|
652 | 5 | |
653 | 4 |
|
653 | 4 | |
654 | 3 |
|
654 | 3 | |
655 | 2 |
|
655 | 2 | |
656 | 1 |
|
656 | 1 | |
657 | 0 |
|
657 | 0 | |
658 | $ log '4::8 - 8' |
|
658 | $ log '4::8 - 8' | |
659 | 4 |
|
659 | 4 | |
660 |
|
660 | |||
661 | matching() should preserve the order of the input set: |
|
661 | matching() should preserve the order of the input set: | |
662 |
|
662 | |||
663 | $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' |
|
663 | $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' | |
664 | 2 |
|
664 | 2 | |
665 | 3 |
|
665 | 3 | |
666 | 1 |
|
666 | 1 | |
667 |
|
667 | |||
668 | $ log 'named("unknown")' |
|
668 | $ log 'named("unknown")' | |
669 | abort: namespace 'unknown' does not exist! |
|
669 | abort: namespace 'unknown' does not exist! | |
670 | [255] |
|
670 | [255] | |
671 | $ log 'named("re:unknown")' |
|
671 | $ log 'named("re:unknown")' | |
672 | abort: no namespace exists that match 'unknown'! |
|
672 | abort: no namespace exists that match 'unknown'! | |
673 | [255] |
|
673 | [255] | |
674 | $ log 'present(named("unknown"))' |
|
674 | $ log 'present(named("unknown"))' | |
675 | $ log 'present(named("re:unknown"))' |
|
675 | $ log 'present(named("re:unknown"))' | |
676 |
|
676 | |||
677 | $ log 'tag()' |
|
677 | $ log 'tag()' | |
678 | 6 |
|
678 | 6 | |
679 | $ log 'named("tags")' |
|
679 | $ log 'named("tags")' | |
680 | 6 |
|
680 | 6 | |
681 |
|
681 | |||
682 | issue2437 |
|
682 | issue2437 | |
683 |
|
683 | |||
684 | $ log '3 and p1(5)' |
|
684 | $ log '3 and p1(5)' | |
685 | 3 |
|
685 | 3 | |
686 | $ log '4 and p2(6)' |
|
686 | $ log '4 and p2(6)' | |
687 | 4 |
|
687 | 4 | |
688 | $ log '1 and parents(:2)' |
|
688 | $ log '1 and parents(:2)' | |
689 | 1 |
|
689 | 1 | |
690 | $ log '2 and children(1:)' |
|
690 | $ log '2 and children(1:)' | |
691 | 2 |
|
691 | 2 | |
692 | $ log 'roots(all()) or roots(all())' |
|
692 | $ log 'roots(all()) or roots(all())' | |
693 | 0 |
|
693 | 0 | |
694 | $ hg debugrevspec 'roots(all()) or roots(all())' |
|
694 | $ hg debugrevspec 'roots(all()) or roots(all())' | |
695 | 0 |
|
695 | 0 | |
696 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' |
|
696 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' | |
697 | 9 |
|
697 | 9 | |
698 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' |
|
698 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' | |
699 | 4 |
|
699 | 4 | |
700 |
|
700 | |||
701 | issue2654: report a parse error if the revset was not completely parsed |
|
701 | issue2654: report a parse error if the revset was not completely parsed | |
702 |
|
702 | |||
703 | $ log '1 OR 2' |
|
703 | $ log '1 OR 2' | |
704 | hg: parse error at 2: invalid token |
|
704 | hg: parse error at 2: invalid token | |
705 | (1 OR 2 |
|
705 | (1 OR 2 | |
706 | ^ here) |
|
706 | ^ here) | |
707 | [255] |
|
707 | [255] | |
708 |
|
708 | |||
709 | or operator should preserve ordering: |
|
709 | or operator should preserve ordering: | |
710 | $ log 'reverse(2::4) or tip' |
|
710 | $ log 'reverse(2::4) or tip' | |
711 | 4 |
|
711 | 4 | |
712 | 2 |
|
712 | 2 | |
713 | 9 |
|
713 | 9 | |
714 |
|
714 | |||
715 | parentrevspec |
|
715 | parentrevspec | |
716 |
|
716 | |||
717 | $ log 'merge()^0' |
|
717 | $ log 'merge()^0' | |
718 | 6 |
|
718 | 6 | |
719 | $ log 'merge()^' |
|
719 | $ log 'merge()^' | |
720 | 5 |
|
720 | 5 | |
721 | $ log 'merge()^1' |
|
721 | $ log 'merge()^1' | |
722 | 5 |
|
722 | 5 | |
723 | $ log 'merge()^2' |
|
723 | $ log 'merge()^2' | |
724 | 4 |
|
724 | 4 | |
725 | $ log '(not merge())^2' |
|
725 | $ log '(not merge())^2' | |
726 | $ log 'merge()^^' |
|
726 | $ log 'merge()^^' | |
727 | 3 |
|
727 | 3 | |
728 | $ log 'merge()^1^' |
|
728 | $ log 'merge()^1^' | |
729 | 3 |
|
729 | 3 | |
730 | $ log 'merge()^^^' |
|
730 | $ log 'merge()^^^' | |
731 | 1 |
|
731 | 1 | |
732 |
|
732 | |||
733 | $ hg debugrevspec -s '(merge() | 0)~-1' |
|
733 | $ hg debugrevspec -s '(merge() | 0)~-1' | |
734 | * set: |
|
734 | * set: | |
735 | <baseset+ [1, 7]> |
|
735 | <baseset+ [1, 7]> | |
736 | 1 |
|
736 | 1 | |
737 | 7 |
|
737 | 7 | |
738 | $ log 'merge()~-1' |
|
738 | $ log 'merge()~-1' | |
739 | 7 |
|
739 | 7 | |
740 | $ log 'tip~-1' |
|
740 | $ log 'tip~-1' | |
741 | $ log '(tip | merge())~-1' |
|
741 | $ log '(tip | merge())~-1' | |
742 | 7 |
|
742 | 7 | |
743 | $ log 'merge()~0' |
|
743 | $ log 'merge()~0' | |
744 | 6 |
|
744 | 6 | |
745 | $ log 'merge()~1' |
|
745 | $ log 'merge()~1' | |
746 | 5 |
|
746 | 5 | |
747 | $ log 'merge()~2' |
|
747 | $ log 'merge()~2' | |
748 | 3 |
|
748 | 3 | |
749 | $ log 'merge()~2^1' |
|
749 | $ log 'merge()~2^1' | |
750 | 1 |
|
750 | 1 | |
751 | $ log 'merge()~3' |
|
751 | $ log 'merge()~3' | |
752 | 1 |
|
752 | 1 | |
753 |
|
753 | |||
754 | $ log '(-3:tip)^' |
|
754 | $ log '(-3:tip)^' | |
755 | 4 |
|
755 | 4 | |
756 | 6 |
|
756 | 6 | |
757 | 8 |
|
757 | 8 | |
758 |
|
758 | |||
759 | $ log 'tip^foo' |
|
759 | $ log 'tip^foo' | |
760 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
760 | hg: parse error: ^ expects a number 0, 1, or 2 | |
761 | [255] |
|
761 | [255] | |
762 |
|
762 | |||
763 | $ log 'branchpoint()~-1' |
|
763 | $ log 'branchpoint()~-1' | |
764 | abort: revision in set has more than one child! |
|
764 | abort: revision in set has more than one child! | |
765 | [255] |
|
765 | [255] | |
766 |
|
766 | |||
767 | Bogus function gets suggestions |
|
767 | Bogus function gets suggestions | |
768 | $ log 'add()' |
|
768 | $ log 'add()' | |
769 | hg: parse error: unknown identifier: add |
|
769 | hg: parse error: unknown identifier: add | |
770 | (did you mean adds?) |
|
770 | (did you mean adds?) | |
771 | [255] |
|
771 | [255] | |
772 | $ log 'added()' |
|
772 | $ log 'added()' | |
773 | hg: parse error: unknown identifier: added |
|
773 | hg: parse error: unknown identifier: added | |
774 | (did you mean adds?) |
|
774 | (did you mean adds?) | |
775 | [255] |
|
775 | [255] | |
776 | $ log 'remo()' |
|
776 | $ log 'remo()' | |
777 | hg: parse error: unknown identifier: remo |
|
777 | hg: parse error: unknown identifier: remo | |
778 | (did you mean one of remote, removes?) |
|
778 | (did you mean one of remote, removes?) | |
779 | [255] |
|
779 | [255] | |
780 | $ log 'babar()' |
|
780 | $ log 'babar()' | |
781 | hg: parse error: unknown identifier: babar |
|
781 | hg: parse error: unknown identifier: babar | |
782 | [255] |
|
782 | [255] | |
783 |
|
783 | |||
784 | Bogus function with a similar internal name doesn't suggest the internal name |
|
784 | Bogus function with a similar internal name doesn't suggest the internal name | |
785 | $ log 'matches()' |
|
785 | $ log 'matches()' | |
786 | hg: parse error: unknown identifier: matches |
|
786 | hg: parse error: unknown identifier: matches | |
787 | (did you mean matching?) |
|
787 | (did you mean matching?) | |
788 | [255] |
|
788 | [255] | |
789 |
|
789 | |||
790 | Undocumented functions aren't suggested as similar either |
|
790 | Undocumented functions aren't suggested as similar either | |
791 | $ log 'tagged2()' |
|
791 | $ log 'tagged2()' | |
792 | hg: parse error: unknown identifier: tagged2 |
|
792 | hg: parse error: unknown identifier: tagged2 | |
793 | [255] |
|
793 | [255] | |
794 |
|
794 | |||
795 | multiple revspecs |
|
795 | multiple revspecs | |
796 |
|
796 | |||
797 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' |
|
797 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' | |
798 | 8 |
|
798 | 8 | |
799 | 9 |
|
799 | 9 | |
800 | 4 |
|
800 | 4 | |
801 | 5 |
|
801 | 5 | |
802 | 6 |
|
802 | 6 | |
803 | 7 |
|
803 | 7 | |
804 |
|
804 | |||
805 | test usage in revpair (with "+") |
|
805 | test usage in revpair (with "+") | |
806 |
|
806 | |||
807 | (real pair) |
|
807 | (real pair) | |
808 |
|
808 | |||
809 | $ hg diff -r 'tip^^' -r 'tip' |
|
809 | $ hg diff -r 'tip^^' -r 'tip' | |
810 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
810 | diff -r 2326846efdab -r 24286f4ae135 .hgtags | |
811 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
811 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
812 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
812 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
813 | @@ -0,0 +1,1 @@ |
|
813 | @@ -0,0 +1,1 @@ | |
814 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
814 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
815 | $ hg diff -r 'tip^^::tip' |
|
815 | $ hg diff -r 'tip^^::tip' | |
816 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
816 | diff -r 2326846efdab -r 24286f4ae135 .hgtags | |
817 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
817 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
818 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
818 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
819 | @@ -0,0 +1,1 @@ |
|
819 | @@ -0,0 +1,1 @@ | |
820 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
820 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
821 |
|
821 | |||
822 | (single rev) |
|
822 | (single rev) | |
823 |
|
823 | |||
824 | $ hg diff -r 'tip^' -r 'tip^' |
|
824 | $ hg diff -r 'tip^' -r 'tip^' | |
825 | $ hg diff -r 'tip^:tip^' |
|
825 | $ hg diff -r 'tip^:tip^' | |
826 |
|
826 | |||
827 | (single rev that does not looks like a range) |
|
827 | (single rev that does not looks like a range) | |
828 |
|
828 | |||
829 | $ hg diff -r 'tip^::tip^ or tip^' |
|
829 | $ hg diff -r 'tip^::tip^ or tip^' | |
830 | diff -r d5d0dcbdc4d9 .hgtags |
|
830 | diff -r d5d0dcbdc4d9 .hgtags | |
831 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
831 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
832 | +++ b/.hgtags * (glob) |
|
832 | +++ b/.hgtags * (glob) | |
833 | @@ -0,0 +1,1 @@ |
|
833 | @@ -0,0 +1,1 @@ | |
834 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
834 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
835 | $ hg diff -r 'tip^ or tip^' |
|
835 | $ hg diff -r 'tip^ or tip^' | |
836 | diff -r d5d0dcbdc4d9 .hgtags |
|
836 | diff -r d5d0dcbdc4d9 .hgtags | |
837 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
837 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
838 | +++ b/.hgtags * (glob) |
|
838 | +++ b/.hgtags * (glob) | |
839 | @@ -0,0 +1,1 @@ |
|
839 | @@ -0,0 +1,1 @@ | |
840 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
840 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
841 |
|
841 | |||
842 | (no rev) |
|
842 | (no rev) | |
843 |
|
843 | |||
844 | $ hg diff -r 'author("babar") or author("celeste")' |
|
844 | $ hg diff -r 'author("babar") or author("celeste")' | |
845 | abort: empty revision range |
|
845 | abort: empty revision range | |
846 | [255] |
|
846 | [255] | |
847 |
|
847 | |||
848 | aliases: |
|
848 | aliases: | |
849 |
|
849 | |||
850 | $ echo '[revsetalias]' >> .hg/hgrc |
|
850 | $ echo '[revsetalias]' >> .hg/hgrc | |
851 | $ echo 'm = merge()' >> .hg/hgrc |
|
851 | $ echo 'm = merge()' >> .hg/hgrc | |
852 | (revset aliases can override builtin revsets) |
|
852 | (revset aliases can override builtin revsets) | |
853 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc |
|
853 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc | |
854 | $ echo 'sincem = descendants(m)' >> .hg/hgrc |
|
854 | $ echo 'sincem = descendants(m)' >> .hg/hgrc | |
855 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc |
|
855 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc | |
856 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
856 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc | |
857 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
857 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc | |
858 |
|
858 | |||
859 | $ try m |
|
859 | $ try m | |
860 | (symbol 'm') |
|
860 | (symbol 'm') | |
861 | * expanded: |
|
861 | * expanded: | |
862 | (func |
|
862 | (func | |
863 | (symbol 'merge') |
|
863 | (symbol 'merge') | |
864 | None) |
|
864 | None) | |
865 | * set: |
|
865 | * set: | |
866 | <filteredset |
|
866 | <filteredset | |
867 | <fullreposet+ 0:10>, |
|
867 | <fullreposet+ 0:10>, | |
868 | <merge>> |
|
868 | <merge>> | |
869 | 6 |
|
869 | 6 | |
870 |
|
870 | |||
871 | $ HGPLAIN=1 |
|
871 | $ HGPLAIN=1 | |
872 | $ export HGPLAIN |
|
872 | $ export HGPLAIN | |
873 | $ try m |
|
873 | $ try m | |
874 | (symbol 'm') |
|
874 | (symbol 'm') | |
875 | abort: unknown revision 'm'! |
|
875 | abort: unknown revision 'm'! | |
876 | [255] |
|
876 | [255] | |
877 |
|
877 | |||
878 | $ HGPLAINEXCEPT=revsetalias |
|
878 | $ HGPLAINEXCEPT=revsetalias | |
879 | $ export HGPLAINEXCEPT |
|
879 | $ export HGPLAINEXCEPT | |
880 | $ try m |
|
880 | $ try m | |
881 | (symbol 'm') |
|
881 | (symbol 'm') | |
882 | * expanded: |
|
882 | * expanded: | |
883 | (func |
|
883 | (func | |
884 | (symbol 'merge') |
|
884 | (symbol 'merge') | |
885 | None) |
|
885 | None) | |
886 | * set: |
|
886 | * set: | |
887 | <filteredset |
|
887 | <filteredset | |
888 | <fullreposet+ 0:10>, |
|
888 | <fullreposet+ 0:10>, | |
889 | <merge>> |
|
889 | <merge>> | |
890 | 6 |
|
890 | 6 | |
891 |
|
891 | |||
892 | $ unset HGPLAIN |
|
892 | $ unset HGPLAIN | |
893 | $ unset HGPLAINEXCEPT |
|
893 | $ unset HGPLAINEXCEPT | |
894 |
|
894 | |||
895 | $ try 'p2(.)' |
|
895 | $ try 'p2(.)' | |
896 | (func |
|
896 | (func | |
897 | (symbol 'p2') |
|
897 | (symbol 'p2') | |
898 | (symbol '.')) |
|
898 | (symbol '.')) | |
899 | * expanded: |
|
899 | * expanded: | |
900 | (func |
|
900 | (func | |
901 | (symbol 'p1') |
|
901 | (symbol 'p1') | |
902 | (symbol '.')) |
|
902 | (symbol '.')) | |
903 | * set: |
|
903 | * set: | |
904 | <baseset+ [8]> |
|
904 | <baseset+ [8]> | |
905 | 8 |
|
905 | 8 | |
906 |
|
906 | |||
907 | $ HGPLAIN=1 |
|
907 | $ HGPLAIN=1 | |
908 | $ export HGPLAIN |
|
908 | $ export HGPLAIN | |
909 | $ try 'p2(.)' |
|
909 | $ try 'p2(.)' | |
910 | (func |
|
910 | (func | |
911 | (symbol 'p2') |
|
911 | (symbol 'p2') | |
912 | (symbol '.')) |
|
912 | (symbol '.')) | |
913 | * set: |
|
913 | * set: | |
914 | <baseset+ []> |
|
914 | <baseset+ []> | |
915 |
|
915 | |||
916 | $ HGPLAINEXCEPT=revsetalias |
|
916 | $ HGPLAINEXCEPT=revsetalias | |
917 | $ export HGPLAINEXCEPT |
|
917 | $ export HGPLAINEXCEPT | |
918 | $ try 'p2(.)' |
|
918 | $ try 'p2(.)' | |
919 | (func |
|
919 | (func | |
920 | (symbol 'p2') |
|
920 | (symbol 'p2') | |
921 | (symbol '.')) |
|
921 | (symbol '.')) | |
922 | * expanded: |
|
922 | * expanded: | |
923 | (func |
|
923 | (func | |
924 | (symbol 'p1') |
|
924 | (symbol 'p1') | |
925 | (symbol '.')) |
|
925 | (symbol '.')) | |
926 | * set: |
|
926 | * set: | |
927 | <baseset+ [8]> |
|
927 | <baseset+ [8]> | |
928 | 8 |
|
928 | 8 | |
929 |
|
929 | |||
930 | $ unset HGPLAIN |
|
930 | $ unset HGPLAIN | |
931 | $ unset HGPLAINEXCEPT |
|
931 | $ unset HGPLAINEXCEPT | |
932 |
|
932 | |||
933 | test alias recursion |
|
933 | test alias recursion | |
934 |
|
934 | |||
935 | $ try sincem |
|
935 | $ try sincem | |
936 | (symbol 'sincem') |
|
936 | (symbol 'sincem') | |
937 | * expanded: |
|
937 | * expanded: | |
938 | (func |
|
938 | (func | |
939 | (symbol 'descendants') |
|
939 | (symbol 'descendants') | |
940 | (func |
|
940 | (func | |
941 | (symbol 'merge') |
|
941 | (symbol 'merge') | |
942 | None)) |
|
942 | None)) | |
943 | * set: |
|
943 | * set: | |
944 | <generatorsetasc+> |
|
944 | <generatorsetasc+> | |
945 | 6 |
|
945 | 6 | |
946 | 7 |
|
946 | 7 | |
947 |
|
947 | |||
948 | test infinite recursion |
|
948 | test infinite recursion | |
949 |
|
949 | |||
950 | $ echo 'recurse1 = recurse2' >> .hg/hgrc |
|
950 | $ echo 'recurse1 = recurse2' >> .hg/hgrc | |
951 | $ echo 'recurse2 = recurse1' >> .hg/hgrc |
|
951 | $ echo 'recurse2 = recurse1' >> .hg/hgrc | |
952 | $ try recurse1 |
|
952 | $ try recurse1 | |
953 | (symbol 'recurse1') |
|
953 | (symbol 'recurse1') | |
954 | hg: parse error: infinite expansion of revset alias "recurse1" detected |
|
954 | hg: parse error: infinite expansion of revset alias "recurse1" detected | |
955 | [255] |
|
955 | [255] | |
956 |
|
956 | |||
957 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc |
|
957 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc | |
958 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc |
|
958 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc | |
959 | $ try "level2(level1(1, 2), 3)" |
|
959 | $ try "level2(level1(1, 2), 3)" | |
960 | (func |
|
960 | (func | |
961 | (symbol 'level2') |
|
961 | (symbol 'level2') | |
962 | (list |
|
962 | (list | |
963 | (func |
|
963 | (func | |
964 | (symbol 'level1') |
|
964 | (symbol 'level1') | |
965 | (list |
|
965 | (list | |
966 | (symbol '1') |
|
966 | (symbol '1') | |
967 | (symbol '2'))) |
|
967 | (symbol '2'))) | |
968 | (symbol '3'))) |
|
968 | (symbol '3'))) | |
969 | * expanded: |
|
969 | * expanded: | |
970 | (or |
|
970 | (or | |
971 | (list |
|
971 | (list | |
972 | (symbol '3') |
|
972 | (symbol '3') | |
973 | (or |
|
973 | (or | |
974 | (list |
|
974 | (list | |
975 | (symbol '1') |
|
975 | (symbol '1') | |
976 | (symbol '2'))))) |
|
976 | (symbol '2'))))) | |
977 | * set: |
|
977 | * set: | |
978 | <addset |
|
978 | <addset | |
979 | <baseset [3]>, |
|
979 | <baseset [3]>, | |
980 | <baseset [1, 2]>> |
|
980 | <baseset [1, 2]>> | |
981 | 3 |
|
981 | 3 | |
982 | 1 |
|
982 | 1 | |
983 | 2 |
|
983 | 2 | |
984 |
|
984 | |||
985 | test nesting and variable passing |
|
985 | test nesting and variable passing | |
986 |
|
986 | |||
987 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc |
|
987 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc | |
988 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc |
|
988 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc | |
989 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc |
|
989 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc | |
990 | $ try 'nested(2:5)' |
|
990 | $ try 'nested(2:5)' | |
991 | (func |
|
991 | (func | |
992 | (symbol 'nested') |
|
992 | (symbol 'nested') | |
993 | (range |
|
993 | (range | |
994 | (symbol '2') |
|
994 | (symbol '2') | |
995 | (symbol '5'))) |
|
995 | (symbol '5'))) | |
996 | * expanded: |
|
996 | * expanded: | |
997 | (func |
|
997 | (func | |
998 | (symbol 'max') |
|
998 | (symbol 'max') | |
999 | (range |
|
999 | (range | |
1000 | (symbol '2') |
|
1000 | (symbol '2') | |
1001 | (symbol '5'))) |
|
1001 | (symbol '5'))) | |
1002 | * set: |
|
1002 | * set: | |
1003 | <baseset |
|
1003 | <baseset | |
1004 | <max |
|
1004 | <max | |
1005 | <fullreposet+ 0:10>, |
|
1005 | <fullreposet+ 0:10>, | |
1006 | <spanset+ 2:6>>> |
|
1006 | <spanset+ 2:6>>> | |
1007 | 5 |
|
1007 | 5 | |
1008 |
|
1008 | |||
1009 | test chained `or` operations are flattened at parsing phase |
|
1009 | test chained `or` operations are flattened at parsing phase | |
1010 |
|
1010 | |||
1011 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc |
|
1011 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc | |
1012 | $ try 'chainedorops(0:1, 1:2, 2:3)' |
|
1012 | $ try 'chainedorops(0:1, 1:2, 2:3)' | |
1013 | (func |
|
1013 | (func | |
1014 | (symbol 'chainedorops') |
|
1014 | (symbol 'chainedorops') | |
1015 | (list |
|
1015 | (list | |
1016 | (range |
|
1016 | (range | |
1017 | (symbol '0') |
|
1017 | (symbol '0') | |
1018 | (symbol '1')) |
|
1018 | (symbol '1')) | |
1019 | (range |
|
1019 | (range | |
1020 | (symbol '1') |
|
1020 | (symbol '1') | |
1021 | (symbol '2')) |
|
1021 | (symbol '2')) | |
1022 | (range |
|
1022 | (range | |
1023 | (symbol '2') |
|
1023 | (symbol '2') | |
1024 | (symbol '3')))) |
|
1024 | (symbol '3')))) | |
1025 | * expanded: |
|
1025 | * expanded: | |
1026 | (or |
|
1026 | (or | |
1027 | (list |
|
1027 | (list | |
1028 | (range |
|
1028 | (range | |
1029 | (symbol '0') |
|
1029 | (symbol '0') | |
1030 | (symbol '1')) |
|
1030 | (symbol '1')) | |
1031 | (range |
|
1031 | (range | |
1032 | (symbol '1') |
|
1032 | (symbol '1') | |
1033 | (symbol '2')) |
|
1033 | (symbol '2')) | |
1034 | (range |
|
1034 | (range | |
1035 | (symbol '2') |
|
1035 | (symbol '2') | |
1036 | (symbol '3')))) |
|
1036 | (symbol '3')))) | |
1037 | * set: |
|
1037 | * set: | |
1038 | <addset |
|
1038 | <addset | |
1039 | <spanset+ 0:2>, |
|
1039 | <spanset+ 0:2>, | |
1040 | <addset |
|
1040 | <addset | |
1041 | <spanset+ 1:3>, |
|
1041 | <spanset+ 1:3>, | |
1042 | <spanset+ 2:4>>> |
|
1042 | <spanset+ 2:4>>> | |
1043 | 0 |
|
1043 | 0 | |
1044 | 1 |
|
1044 | 1 | |
1045 | 2 |
|
1045 | 2 | |
1046 | 3 |
|
1046 | 3 | |
1047 |
|
1047 | |||
1048 | test variable isolation, variable placeholders are rewritten as string |
|
1048 | test variable isolation, variable placeholders are rewritten as string | |
1049 | then parsed and matched again as string. Check they do not leak too |
|
1049 | then parsed and matched again as string. Check they do not leak too | |
1050 | far away. |
|
1050 | far away. | |
1051 |
|
1051 | |||
1052 | $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc |
|
1052 | $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc | |
1053 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc |
|
1053 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc | |
1054 | $ try 'callinjection(2:5)' |
|
1054 | $ try 'callinjection(2:5)' | |
1055 | (func |
|
1055 | (func | |
1056 | (symbol 'callinjection') |
|
1056 | (symbol 'callinjection') | |
1057 | (range |
|
1057 | (range | |
1058 | (symbol '2') |
|
1058 | (symbol '2') | |
1059 | (symbol '5'))) |
|
1059 | (symbol '5'))) | |
1060 | * expanded: |
|
1060 | * expanded: | |
1061 | (func |
|
1061 | (func | |
1062 | (symbol 'descendants') |
|
1062 | (symbol 'descendants') | |
1063 | (func |
|
1063 | (func | |
1064 | (symbol 'max') |
|
1064 | (symbol 'max') | |
1065 | (string '$1'))) |
|
1065 | (string '$1'))) | |
1066 | abort: unknown revision '$1'! |
|
1066 | abort: unknown revision '$1'! | |
1067 | [255] |
|
1067 | [255] | |
1068 |
|
1068 | |||
1069 | test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', |
|
1069 | test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', | |
1070 | but 'all()' should never be substituted to '0()'. |
|
1070 | but 'all()' should never be substituted to '0()'. | |
1071 |
|
1071 | |||
1072 | $ echo 'universe = all()' >> .hg/hgrc |
|
1072 | $ echo 'universe = all()' >> .hg/hgrc | |
1073 | $ echo 'shadowall(all) = all and universe' >> .hg/hgrc |
|
1073 | $ echo 'shadowall(all) = all and universe' >> .hg/hgrc | |
1074 | $ try 'shadowall(0)' |
|
1074 | $ try 'shadowall(0)' | |
1075 | (func |
|
1075 | (func | |
1076 | (symbol 'shadowall') |
|
1076 | (symbol 'shadowall') | |
1077 | (symbol '0')) |
|
1077 | (symbol '0')) | |
1078 | * expanded: |
|
1078 | * expanded: | |
1079 | (and |
|
1079 | (and | |
1080 | (symbol '0') |
|
1080 | (symbol '0') | |
1081 | (func |
|
1081 | (func | |
1082 | (symbol 'all') |
|
1082 | (symbol 'all') | |
1083 | None)) |
|
1083 | None)) | |
1084 | * set: |
|
1084 | * set: | |
1085 | <filteredset |
|
1085 | <filteredset | |
1086 | <baseset [0]>, |
|
1086 | <baseset [0]>, | |
1087 | <spanset+ 0:10>> |
|
1087 | <spanset+ 0:10>> | |
1088 | 0 |
|
1088 | 0 | |
1089 |
|
1089 | |||
1090 | test unknown reference: |
|
1090 | test unknown reference: | |
1091 |
|
1091 | |||
1092 | $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' |
|
1092 | $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' | |
1093 | (func |
|
1093 | (func | |
1094 | (symbol 'unknownref') |
|
1094 | (symbol 'unknownref') | |
1095 | (symbol '0')) |
|
1095 | (symbol '0')) | |
1096 | abort: bad definition of revset alias "unknownref": invalid symbol '$2' |
|
1096 | abort: bad definition of revset alias "unknownref": invalid symbol '$2' | |
1097 | [255] |
|
1097 | [255] | |
1098 |
|
1098 | |||
1099 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" |
|
1099 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" | |
1100 | (symbol 'tip') |
|
1100 | (symbol 'tip') | |
1101 | warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end |
|
1101 | warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end | |
1102 | * set: |
|
1102 | * set: | |
1103 | <baseset [9]> |
|
1103 | <baseset [9]> | |
1104 | 9 |
|
1104 | 9 | |
1105 |
|
1105 | |||
1106 | $ try 'tip' |
|
1106 | $ try 'tip' | |
1107 | (symbol 'tip') |
|
1107 | (symbol 'tip') | |
1108 | * set: |
|
1108 | * set: | |
1109 | <baseset [9]> |
|
1109 | <baseset [9]> | |
1110 | 9 |
|
1110 | 9 | |
1111 |
|
1111 | |||
1112 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" |
|
1112 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" | |
1113 | (symbol 'tip') |
|
1113 | (symbol 'tip') | |
1114 | warning: bad declaration of revset alias "bad name": at 4: invalid token |
|
1114 | warning: bad declaration of revset alias "bad name": at 4: invalid token | |
1115 | * set: |
|
1115 | * set: | |
1116 | <baseset [9]> |
|
1116 | <baseset [9]> | |
1117 | 9 |
|
1117 | 9 | |
1118 | $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc |
|
1118 | $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc | |
1119 | $ try 'strictreplacing("foo", tip)' |
|
1119 | $ try 'strictreplacing("foo", tip)' | |
1120 | (func |
|
1120 | (func | |
1121 | (symbol 'strictreplacing') |
|
1121 | (symbol 'strictreplacing') | |
1122 | (list |
|
1122 | (list | |
1123 | (string 'foo') |
|
1123 | (string 'foo') | |
1124 | (symbol 'tip'))) |
|
1124 | (symbol 'tip'))) | |
1125 | * expanded: |
|
1125 | * expanded: | |
1126 | (or |
|
1126 | (or | |
1127 | (list |
|
1127 | (list | |
1128 | (symbol 'tip') |
|
1128 | (symbol 'tip') | |
1129 | (func |
|
1129 | (func | |
1130 | (symbol 'desc') |
|
1130 | (symbol 'desc') | |
1131 | (string '$1')))) |
|
1131 | (string '$1')))) | |
1132 | * set: |
|
1132 | * set: | |
1133 | <addset |
|
1133 | <addset | |
1134 | <baseset [9]>, |
|
1134 | <baseset [9]>, | |
1135 | <filteredset |
|
1135 | <filteredset | |
1136 | <fullreposet+ 0:10>, |
|
1136 | <fullreposet+ 0:10>, | |
1137 | <desc '$1'>>> |
|
1137 | <desc '$1'>>> | |
1138 | 9 |
|
1138 | 9 | |
1139 |
|
1139 | |||
1140 | $ try 'd(2:5)' |
|
1140 | $ try 'd(2:5)' | |
1141 | (func |
|
1141 | (func | |
1142 | (symbol 'd') |
|
1142 | (symbol 'd') | |
1143 | (range |
|
1143 | (range | |
1144 | (symbol '2') |
|
1144 | (symbol '2') | |
1145 | (symbol '5'))) |
|
1145 | (symbol '5'))) | |
1146 | * expanded: |
|
1146 | * expanded: | |
1147 | (func |
|
1147 | (func | |
1148 | (symbol 'reverse') |
|
1148 | (symbol 'reverse') | |
1149 | (func |
|
1149 | (func | |
1150 | (symbol 'sort') |
|
1150 | (symbol 'sort') | |
1151 | (list |
|
1151 | (list | |
1152 | (range |
|
1152 | (range | |
1153 | (symbol '2') |
|
1153 | (symbol '2') | |
1154 | (symbol '5')) |
|
1154 | (symbol '5')) | |
1155 | (symbol 'date')))) |
|
1155 | (symbol 'date')))) | |
1156 | * set: |
|
1156 | * set: | |
1157 | <baseset [4, 5, 3, 2]> |
|
1157 | <baseset [4, 5, 3, 2]> | |
1158 | 4 |
|
1158 | 4 | |
1159 | 5 |
|
1159 | 5 | |
1160 | 3 |
|
1160 | 3 | |
1161 | 2 |
|
1161 | 2 | |
1162 | $ try 'rs(2 or 3, date)' |
|
1162 | $ try 'rs(2 or 3, date)' | |
1163 | (func |
|
1163 | (func | |
1164 | (symbol 'rs') |
|
1164 | (symbol 'rs') | |
1165 | (list |
|
1165 | (list | |
1166 | (or |
|
1166 | (or | |
1167 | (list |
|
1167 | (list | |
1168 | (symbol '2') |
|
1168 | (symbol '2') | |
1169 | (symbol '3'))) |
|
1169 | (symbol '3'))) | |
1170 | (symbol 'date'))) |
|
1170 | (symbol 'date'))) | |
1171 | * expanded: |
|
1171 | * expanded: | |
1172 | (func |
|
1172 | (func | |
1173 | (symbol 'reverse') |
|
1173 | (symbol 'reverse') | |
1174 | (func |
|
1174 | (func | |
1175 | (symbol 'sort') |
|
1175 | (symbol 'sort') | |
1176 | (list |
|
1176 | (list | |
1177 | (or |
|
1177 | (or | |
1178 | (list |
|
1178 | (list | |
1179 | (symbol '2') |
|
1179 | (symbol '2') | |
1180 | (symbol '3'))) |
|
1180 | (symbol '3'))) | |
1181 | (symbol 'date')))) |
|
1181 | (symbol 'date')))) | |
1182 | * set: |
|
1182 | * set: | |
1183 | <baseset [3, 2]> |
|
1183 | <baseset [3, 2]> | |
1184 | 3 |
|
1184 | 3 | |
1185 | 2 |
|
1185 | 2 | |
1186 | $ try 'rs()' |
|
1186 | $ try 'rs()' | |
1187 | (func |
|
1187 | (func | |
1188 | (symbol 'rs') |
|
1188 | (symbol 'rs') | |
1189 | None) |
|
1189 | None) | |
1190 | hg: parse error: invalid number of arguments: 0 |
|
1190 | hg: parse error: invalid number of arguments: 0 | |
1191 | [255] |
|
1191 | [255] | |
1192 | $ try 'rs(2)' |
|
1192 | $ try 'rs(2)' | |
1193 | (func |
|
1193 | (func | |
1194 | (symbol 'rs') |
|
1194 | (symbol 'rs') | |
1195 | (symbol '2')) |
|
1195 | (symbol '2')) | |
1196 | hg: parse error: invalid number of arguments: 1 |
|
1196 | hg: parse error: invalid number of arguments: 1 | |
1197 | [255] |
|
1197 | [255] | |
1198 | $ try 'rs(2, data, 7)' |
|
1198 | $ try 'rs(2, data, 7)' | |
1199 | (func |
|
1199 | (func | |
1200 | (symbol 'rs') |
|
1200 | (symbol 'rs') | |
1201 | (list |
|
1201 | (list | |
1202 | (symbol '2') |
|
1202 | (symbol '2') | |
1203 | (symbol 'data') |
|
1203 | (symbol 'data') | |
1204 | (symbol '7'))) |
|
1204 | (symbol '7'))) | |
1205 | hg: parse error: invalid number of arguments: 3 |
|
1205 | hg: parse error: invalid number of arguments: 3 | |
1206 | [255] |
|
1206 | [255] | |
1207 | $ try 'rs4(2 or 3, x, x, date)' |
|
1207 | $ try 'rs4(2 or 3, x, x, date)' | |
1208 | (func |
|
1208 | (func | |
1209 | (symbol 'rs4') |
|
1209 | (symbol 'rs4') | |
1210 | (list |
|
1210 | (list | |
1211 | (or |
|
1211 | (or | |
1212 | (list |
|
1212 | (list | |
1213 | (symbol '2') |
|
1213 | (symbol '2') | |
1214 | (symbol '3'))) |
|
1214 | (symbol '3'))) | |
1215 | (symbol 'x') |
|
1215 | (symbol 'x') | |
1216 | (symbol 'x') |
|
1216 | (symbol 'x') | |
1217 | (symbol 'date'))) |
|
1217 | (symbol 'date'))) | |
1218 | * expanded: |
|
1218 | * expanded: | |
1219 | (func |
|
1219 | (func | |
1220 | (symbol 'reverse') |
|
1220 | (symbol 'reverse') | |
1221 | (func |
|
1221 | (func | |
1222 | (symbol 'sort') |
|
1222 | (symbol 'sort') | |
1223 | (list |
|
1223 | (list | |
1224 | (or |
|
1224 | (or | |
1225 | (list |
|
1225 | (list | |
1226 | (symbol '2') |
|
1226 | (symbol '2') | |
1227 | (symbol '3'))) |
|
1227 | (symbol '3'))) | |
1228 | (symbol 'date')))) |
|
1228 | (symbol 'date')))) | |
1229 | * set: |
|
1229 | * set: | |
1230 | <baseset [3, 2]> |
|
1230 | <baseset [3, 2]> | |
1231 | 3 |
|
1231 | 3 | |
1232 | 2 |
|
1232 | 2 | |
1233 |
|
1233 | |||
1234 | issue4553: check that revset aliases override existing hash prefix |
|
1234 | issue4553: check that revset aliases override existing hash prefix | |
1235 |
|
1235 | |||
1236 | $ hg log -qr e |
|
1236 | $ hg log -qr e | |
1237 | 6:e0cc66ef77e8 |
|
1237 | 6:e0cc66ef77e8 | |
1238 |
|
1238 | |||
1239 | $ hg log -qr e --config revsetalias.e="all()" |
|
1239 | $ hg log -qr e --config revsetalias.e="all()" | |
1240 | 0:2785f51eece5 |
|
1240 | 0:2785f51eece5 | |
1241 | 1:d75937da8da0 |
|
1241 | 1:d75937da8da0 | |
1242 | 2:5ed5505e9f1c |
|
1242 | 2:5ed5505e9f1c | |
1243 | 3:8528aa5637f2 |
|
1243 | 3:8528aa5637f2 | |
1244 | 4:2326846efdab |
|
1244 | 4:2326846efdab | |
1245 | 5:904fa392b941 |
|
1245 | 5:904fa392b941 | |
1246 | 6:e0cc66ef77e8 |
|
1246 | 6:e0cc66ef77e8 | |
1247 | 7:013af1973af4 |
|
1247 | 7:013af1973af4 | |
1248 | 8:d5d0dcbdc4d9 |
|
1248 | 8:d5d0dcbdc4d9 | |
1249 | 9:24286f4ae135 |
|
1249 | 9:24286f4ae135 | |
1250 |
|
1250 | |||
1251 | $ hg log -qr e: --config revsetalias.e="0" |
|
1251 | $ hg log -qr e: --config revsetalias.e="0" | |
1252 | 0:2785f51eece5 |
|
1252 | 0:2785f51eece5 | |
1253 | 1:d75937da8da0 |
|
1253 | 1:d75937da8da0 | |
1254 | 2:5ed5505e9f1c |
|
1254 | 2:5ed5505e9f1c | |
1255 | 3:8528aa5637f2 |
|
1255 | 3:8528aa5637f2 | |
1256 | 4:2326846efdab |
|
1256 | 4:2326846efdab | |
1257 | 5:904fa392b941 |
|
1257 | 5:904fa392b941 | |
1258 | 6:e0cc66ef77e8 |
|
1258 | 6:e0cc66ef77e8 | |
1259 | 7:013af1973af4 |
|
1259 | 7:013af1973af4 | |
1260 | 8:d5d0dcbdc4d9 |
|
1260 | 8:d5d0dcbdc4d9 | |
1261 | 9:24286f4ae135 |
|
1261 | 9:24286f4ae135 | |
1262 |
|
1262 | |||
1263 | $ hg log -qr :e --config revsetalias.e="9" |
|
1263 | $ hg log -qr :e --config revsetalias.e="9" | |
1264 | 0:2785f51eece5 |
|
1264 | 0:2785f51eece5 | |
1265 | 1:d75937da8da0 |
|
1265 | 1:d75937da8da0 | |
1266 | 2:5ed5505e9f1c |
|
1266 | 2:5ed5505e9f1c | |
1267 | 3:8528aa5637f2 |
|
1267 | 3:8528aa5637f2 | |
1268 | 4:2326846efdab |
|
1268 | 4:2326846efdab | |
1269 | 5:904fa392b941 |
|
1269 | 5:904fa392b941 | |
1270 | 6:e0cc66ef77e8 |
|
1270 | 6:e0cc66ef77e8 | |
1271 | 7:013af1973af4 |
|
1271 | 7:013af1973af4 | |
1272 | 8:d5d0dcbdc4d9 |
|
1272 | 8:d5d0dcbdc4d9 | |
1273 | 9:24286f4ae135 |
|
1273 | 9:24286f4ae135 | |
1274 |
|
1274 | |||
1275 | $ hg log -qr e: |
|
1275 | $ hg log -qr e: | |
1276 | 6:e0cc66ef77e8 |
|
1276 | 6:e0cc66ef77e8 | |
1277 | 7:013af1973af4 |
|
1277 | 7:013af1973af4 | |
1278 | 8:d5d0dcbdc4d9 |
|
1278 | 8:d5d0dcbdc4d9 | |
1279 | 9:24286f4ae135 |
|
1279 | 9:24286f4ae135 | |
1280 |
|
1280 | |||
1281 | $ hg log -qr :e |
|
1281 | $ hg log -qr :e | |
1282 | 0:2785f51eece5 |
|
1282 | 0:2785f51eece5 | |
1283 | 1:d75937da8da0 |
|
1283 | 1:d75937da8da0 | |
1284 | 2:5ed5505e9f1c |
|
1284 | 2:5ed5505e9f1c | |
1285 | 3:8528aa5637f2 |
|
1285 | 3:8528aa5637f2 | |
1286 | 4:2326846efdab |
|
1286 | 4:2326846efdab | |
1287 | 5:904fa392b941 |
|
1287 | 5:904fa392b941 | |
1288 | 6:e0cc66ef77e8 |
|
1288 | 6:e0cc66ef77e8 | |
1289 |
|
1289 | |||
1290 | issue2549 - correct optimizations |
|
1290 | issue2549 - correct optimizations | |
1291 |
|
1291 | |||
1292 | $ try 'limit(1 or 2 or 3, 2) and not 2' |
|
1292 | $ try 'limit(1 or 2 or 3, 2) and not 2' | |
1293 | (and |
|
1293 | (and | |
1294 | (func |
|
1294 | (func | |
1295 | (symbol 'limit') |
|
1295 | (symbol 'limit') | |
1296 | (list |
|
1296 | (list | |
1297 | (or |
|
1297 | (or | |
1298 | (list |
|
1298 | (list | |
1299 | (symbol '1') |
|
1299 | (symbol '1') | |
1300 | (symbol '2') |
|
1300 | (symbol '2') | |
1301 | (symbol '3'))) |
|
1301 | (symbol '3'))) | |
1302 | (symbol '2'))) |
|
1302 | (symbol '2'))) | |
1303 | (not |
|
1303 | (not | |
1304 | (symbol '2'))) |
|
1304 | (symbol '2'))) | |
1305 | * set: |
|
1305 | * set: | |
1306 | <filteredset |
|
1306 | <filteredset | |
1307 | <baseset [1, 2]>, |
|
1307 | <baseset [1, 2]>, | |
1308 | <not |
|
1308 | <not | |
1309 | <baseset [2]>>> |
|
1309 | <baseset [2]>>> | |
1310 | 1 |
|
1310 | 1 | |
1311 | $ try 'max(1 or 2) and not 2' |
|
1311 | $ try 'max(1 or 2) and not 2' | |
1312 | (and |
|
1312 | (and | |
1313 | (func |
|
1313 | (func | |
1314 | (symbol 'max') |
|
1314 | (symbol 'max') | |
1315 | (or |
|
1315 | (or | |
1316 | (list |
|
1316 | (list | |
1317 | (symbol '1') |
|
1317 | (symbol '1') | |
1318 | (symbol '2')))) |
|
1318 | (symbol '2')))) | |
1319 | (not |
|
1319 | (not | |
1320 | (symbol '2'))) |
|
1320 | (symbol '2'))) | |
1321 | * set: |
|
1321 | * set: | |
1322 | <filteredset |
|
1322 | <filteredset | |
1323 | <baseset |
|
1323 | <baseset | |
1324 | <max |
|
1324 | <max | |
1325 | <fullreposet+ 0:10>, |
|
1325 | <fullreposet+ 0:10>, | |
1326 | <baseset [1, 2]>>>, |
|
1326 | <baseset [1, 2]>>>, | |
1327 | <not |
|
1327 | <not | |
1328 | <baseset [2]>>> |
|
1328 | <baseset [2]>>> | |
1329 | $ try 'min(1 or 2) and not 1' |
|
1329 | $ try 'min(1 or 2) and not 1' | |
1330 | (and |
|
1330 | (and | |
1331 | (func |
|
1331 | (func | |
1332 | (symbol 'min') |
|
1332 | (symbol 'min') | |
1333 | (or |
|
1333 | (or | |
1334 | (list |
|
1334 | (list | |
1335 | (symbol '1') |
|
1335 | (symbol '1') | |
1336 | (symbol '2')))) |
|
1336 | (symbol '2')))) | |
1337 | (not |
|
1337 | (not | |
1338 | (symbol '1'))) |
|
1338 | (symbol '1'))) | |
1339 | * set: |
|
1339 | * set: | |
1340 | <filteredset |
|
1340 | <filteredset | |
1341 | <baseset |
|
1341 | <baseset | |
1342 | <min |
|
1342 | <min | |
1343 | <fullreposet+ 0:10>, |
|
1343 | <fullreposet+ 0:10>, | |
1344 | <baseset [1, 2]>>>, |
|
1344 | <baseset [1, 2]>>>, | |
1345 | <not |
|
1345 | <not | |
1346 | <baseset [1]>>> |
|
1346 | <baseset [1]>>> | |
1347 | $ try 'last(1 or 2, 1) and not 2' |
|
1347 | $ try 'last(1 or 2, 1) and not 2' | |
1348 | (and |
|
1348 | (and | |
1349 | (func |
|
1349 | (func | |
1350 | (symbol 'last') |
|
1350 | (symbol 'last') | |
1351 | (list |
|
1351 | (list | |
1352 | (or |
|
1352 | (or | |
1353 | (list |
|
1353 | (list | |
1354 | (symbol '1') |
|
1354 | (symbol '1') | |
1355 | (symbol '2'))) |
|
1355 | (symbol '2'))) | |
1356 | (symbol '1'))) |
|
1356 | (symbol '1'))) | |
1357 | (not |
|
1357 | (not | |
1358 | (symbol '2'))) |
|
1358 | (symbol '2'))) | |
1359 | * set: |
|
1359 | * set: | |
1360 | <filteredset |
|
1360 | <filteredset | |
1361 | <baseset [2]>, |
|
1361 | <baseset [2]>, | |
1362 | <not |
|
1362 | <not | |
1363 | <baseset [2]>>> |
|
1363 | <baseset [2]>>> | |
1364 |
|
1364 | |||
1365 | issue4289 - ordering of built-ins |
|
1365 | issue4289 - ordering of built-ins | |
1366 | $ hg log -M -q -r 3:2 |
|
1366 | $ hg log -M -q -r 3:2 | |
1367 | 3:8528aa5637f2 |
|
1367 | 3:8528aa5637f2 | |
1368 | 2:5ed5505e9f1c |
|
1368 | 2:5ed5505e9f1c | |
1369 |
|
1369 | |||
1370 | test revsets started with 40-chars hash (issue3669) |
|
1370 | test revsets started with 40-chars hash (issue3669) | |
1371 |
|
1371 | |||
1372 | $ ISSUE3669_TIP=`hg tip --template '{node}'` |
|
1372 | $ ISSUE3669_TIP=`hg tip --template '{node}'` | |
1373 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' |
|
1373 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' | |
1374 | 9 |
|
1374 | 9 | |
1375 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' |
|
1375 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' | |
1376 | 8 |
|
1376 | 8 | |
1377 |
|
1377 | |||
1378 | test or-ed indirect predicates (issue3775) |
|
1378 | test or-ed indirect predicates (issue3775) | |
1379 |
|
1379 | |||
1380 | $ log '6 or 6^1' | sort |
|
1380 | $ log '6 or 6^1' | sort | |
1381 | 5 |
|
1381 | 5 | |
1382 | 6 |
|
1382 | 6 | |
1383 | $ log '6^1 or 6' | sort |
|
1383 | $ log '6^1 or 6' | sort | |
1384 | 5 |
|
1384 | 5 | |
1385 | 6 |
|
1385 | 6 | |
1386 | $ log '4 or 4~1' | sort |
|
1386 | $ log '4 or 4~1' | sort | |
1387 | 2 |
|
1387 | 2 | |
1388 | 4 |
|
1388 | 4 | |
1389 | $ log '4~1 or 4' | sort |
|
1389 | $ log '4~1 or 4' | sort | |
1390 | 2 |
|
1390 | 2 | |
1391 | 4 |
|
1391 | 4 | |
1392 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort |
|
1392 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort | |
1393 | 0 |
|
1393 | 0 | |
1394 | 1 |
|
1394 | 1 | |
1395 | 2 |
|
1395 | 2 | |
1396 | 3 |
|
1396 | 3 | |
1397 | 4 |
|
1397 | 4 | |
1398 | 5 |
|
1398 | 5 | |
1399 | 6 |
|
1399 | 6 | |
1400 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort |
|
1400 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort | |
1401 | 0 |
|
1401 | 0 | |
1402 | 1 |
|
1402 | 1 | |
1403 | 2 |
|
1403 | 2 | |
1404 | 3 |
|
1404 | 3 | |
1405 | 4 |
|
1405 | 4 | |
1406 | 5 |
|
1406 | 5 | |
1407 | 6 |
|
1407 | 6 | |
1408 |
|
1408 | |||
1409 | tests for 'remote()' predicate: |
|
1409 | tests for 'remote()' predicate: | |
1410 | #. (csets in remote) (id) (remote) |
|
1410 | #. (csets in remote) (id) (remote) | |
1411 | 1. less than local current branch "default" |
|
1411 | 1. less than local current branch "default" | |
1412 | 2. same with local specified "default" |
|
1412 | 2. same with local specified "default" | |
1413 | 3. more than local specified specified |
|
1413 | 3. more than local specified specified | |
1414 |
|
1414 | |||
1415 | $ hg clone --quiet -U . ../remote3 |
|
1415 | $ hg clone --quiet -U . ../remote3 | |
1416 | $ cd ../remote3 |
|
1416 | $ cd ../remote3 | |
1417 | $ hg update -q 7 |
|
1417 | $ hg update -q 7 | |
1418 | $ echo r > r |
|
1418 | $ echo r > r | |
1419 | $ hg ci -Aqm 10 |
|
1419 | $ hg ci -Aqm 10 | |
1420 | $ log 'remote()' |
|
1420 | $ log 'remote()' | |
1421 | 7 |
|
1421 | 7 | |
1422 | $ log 'remote("a-b-c-")' |
|
1422 | $ log 'remote("a-b-c-")' | |
1423 | 2 |
|
1423 | 2 | |
1424 | $ cd ../repo |
|
1424 | $ cd ../repo | |
1425 | $ log 'remote(".a.b.c.", "../remote3")' |
|
1425 | $ log 'remote(".a.b.c.", "../remote3")' | |
1426 |
|
1426 | |||
1427 | tests for concatenation of strings/symbols by "##" |
|
1427 | tests for concatenation of strings/symbols by "##" | |
1428 |
|
1428 | |||
1429 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" |
|
1429 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" | |
1430 | (_concat |
|
1430 | (_concat | |
1431 | (_concat |
|
1431 | (_concat | |
1432 | (_concat |
|
1432 | (_concat | |
1433 | (symbol '278') |
|
1433 | (symbol '278') | |
1434 | (string '5f5')) |
|
1434 | (string '5f5')) | |
1435 | (symbol '1ee')) |
|
1435 | (symbol '1ee')) | |
1436 | (string 'ce5')) |
|
1436 | (string 'ce5')) | |
1437 | * concatenated: |
|
1437 | * concatenated: | |
1438 | (string '2785f51eece5') |
|
1438 | (string '2785f51eece5') | |
1439 | * set: |
|
1439 | * set: | |
1440 | <baseset [0]> |
|
1440 | <baseset [0]> | |
1441 | 0 |
|
1441 | 0 | |
1442 |
|
1442 | |||
1443 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc |
|
1443 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc | |
1444 | $ try "cat4(278, '5f5', 1ee, 'ce5')" |
|
1444 | $ try "cat4(278, '5f5', 1ee, 'ce5')" | |
1445 | (func |
|
1445 | (func | |
1446 | (symbol 'cat4') |
|
1446 | (symbol 'cat4') | |
1447 | (list |
|
1447 | (list | |
1448 | (symbol '278') |
|
1448 | (symbol '278') | |
1449 | (string '5f5') |
|
1449 | (string '5f5') | |
1450 | (symbol '1ee') |
|
1450 | (symbol '1ee') | |
1451 | (string 'ce5'))) |
|
1451 | (string 'ce5'))) | |
1452 | * expanded: |
|
1452 | * expanded: | |
1453 | (_concat |
|
1453 | (_concat | |
1454 | (_concat |
|
1454 | (_concat | |
1455 | (_concat |
|
1455 | (_concat | |
1456 | (symbol '278') |
|
1456 | (symbol '278') | |
1457 | (string '5f5')) |
|
1457 | (string '5f5')) | |
1458 | (symbol '1ee')) |
|
1458 | (symbol '1ee')) | |
1459 | (string 'ce5')) |
|
1459 | (string 'ce5')) | |
1460 | * concatenated: |
|
1460 | * concatenated: | |
1461 | (string '2785f51eece5') |
|
1461 | (string '2785f51eece5') | |
1462 | * set: |
|
1462 | * set: | |
1463 | <baseset [0]> |
|
1463 | <baseset [0]> | |
1464 | 0 |
|
1464 | 0 | |
1465 |
|
1465 | |||
1466 | (check concatenation in alias nesting) |
|
1466 | (check concatenation in alias nesting) | |
1467 |
|
1467 | |||
1468 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc |
|
1468 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc | |
1469 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc |
|
1469 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc | |
1470 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" |
|
1470 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" | |
1471 | 0 |
|
1471 | 0 | |
1472 |
|
1472 | |||
1473 | (check operator priority) |
|
1473 | (check operator priority) | |
1474 |
|
1474 | |||
1475 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc |
|
1475 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc | |
1476 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" |
|
1476 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" | |
1477 | 0 |
|
1477 | 0 | |
1478 | 4 |
|
1478 | 4 | |
1479 |
|
1479 | |||
1480 | $ cd .. |
|
1480 | $ cd .. | |
1481 |
|
1481 | |||
1482 | prepare repository that has "default" branches of multiple roots |
|
1482 | prepare repository that has "default" branches of multiple roots | |
1483 |
|
1483 | |||
1484 | $ hg init namedbranch |
|
1484 | $ hg init namedbranch | |
1485 | $ cd namedbranch |
|
1485 | $ cd namedbranch | |
1486 |
|
1486 | |||
1487 | $ echo default0 >> a |
|
1487 | $ echo default0 >> a | |
1488 | $ hg ci -Aqm0 |
|
1488 | $ hg ci -Aqm0 | |
1489 | $ echo default1 >> a |
|
1489 | $ echo default1 >> a | |
1490 | $ hg ci -m1 |
|
1490 | $ hg ci -m1 | |
1491 |
|
1491 | |||
1492 | $ hg branch -q stable |
|
1492 | $ hg branch -q stable | |
1493 | $ echo stable2 >> a |
|
1493 | $ echo stable2 >> a | |
1494 | $ hg ci -m2 |
|
1494 | $ hg ci -m2 | |
1495 | $ echo stable3 >> a |
|
1495 | $ echo stable3 >> a | |
1496 | $ hg ci -m3 |
|
1496 | $ hg ci -m3 | |
1497 |
|
1497 | |||
1498 | $ hg update -q null |
|
1498 | $ hg update -q null | |
1499 | $ echo default4 >> a |
|
1499 | $ echo default4 >> a | |
1500 | $ hg ci -Aqm4 |
|
1500 | $ hg ci -Aqm4 | |
1501 | $ echo default5 >> a |
|
1501 | $ echo default5 >> a | |
1502 | $ hg ci -m5 |
|
1502 | $ hg ci -m5 | |
1503 |
|
1503 | |||
1504 | "null" revision belongs to "default" branch (issue4683) |
|
1504 | "null" revision belongs to "default" branch (issue4683) | |
1505 |
|
1505 | |||
1506 | $ log 'branch(null)' |
|
1506 | $ log 'branch(null)' | |
1507 | 0 |
|
1507 | 0 | |
1508 | 1 |
|
1508 | 1 | |
1509 | 4 |
|
1509 | 4 | |
1510 | 5 |
|
1510 | 5 | |
1511 |
|
1511 | |||
1512 | "null" revision belongs to "default" branch, but it shouldn't appear in set |
|
1512 | "null" revision belongs to "default" branch, but it shouldn't appear in set | |
1513 | unless explicitly specified (issue4682) |
|
1513 | unless explicitly specified (issue4682) | |
1514 |
|
1514 | |||
1515 | $ log 'children(branch(default))' |
|
1515 | $ log 'children(branch(default))' | |
1516 | 1 |
|
1516 | 1 | |
1517 | 2 |
|
1517 | 2 | |
1518 | 5 |
|
1518 | 5 | |
1519 |
|
1519 | |||
1520 | $ cd .. |
|
1520 | $ cd .. | |
1521 |
|
1521 | |||
1522 | test author/desc/keyword in problematic encoding |
|
1522 | test author/desc/keyword in problematic encoding | |
1523 | # unicode: cp932: |
|
1523 | # unicode: cp932: | |
1524 | # u30A2 0x83 0x41(= 'A') |
|
1524 | # u30A2 0x83 0x41(= 'A') | |
1525 | # u30C2 0x83 0x61(= 'a') |
|
1525 | # u30C2 0x83 0x61(= 'a') | |
1526 |
|
1526 | |||
1527 | $ hg init problematicencoding |
|
1527 | $ hg init problematicencoding | |
1528 | $ cd problematicencoding |
|
1528 | $ cd problematicencoding | |
1529 |
|
1529 | |||
1530 | $ "$PYTHON" > setup.sh <<EOF |
|
1530 | $ "$PYTHON" > setup.sh <<EOF | |
1531 |
> print |
|
1531 | > print(u''' | |
1532 | > echo a > text |
|
1532 | > echo a > text | |
1533 | > hg add text |
|
1533 | > hg add text | |
1534 | > hg --encoding utf-8 commit -u '\u30A2' -m none |
|
1534 | > hg --encoding utf-8 commit -u '\u30A2' -m none | |
1535 | > echo b > text |
|
1535 | > echo b > text | |
1536 | > hg --encoding utf-8 commit -u '\u30C2' -m none |
|
1536 | > hg --encoding utf-8 commit -u '\u30C2' -m none | |
1537 | > echo c > text |
|
1537 | > echo c > text | |
1538 | > hg --encoding utf-8 commit -u none -m '\u30A2' |
|
1538 | > hg --encoding utf-8 commit -u none -m '\u30A2' | |
1539 | > echo d > text |
|
1539 | > echo d > text | |
1540 | > hg --encoding utf-8 commit -u none -m '\u30C2' |
|
1540 | > hg --encoding utf-8 commit -u none -m '\u30C2' | |
1541 | > '''.encode('utf-8') |
|
1541 | > '''.encode('utf-8')) | |
1542 | > EOF |
|
1542 | > EOF | |
1543 | $ sh < setup.sh |
|
1543 | $ sh < setup.sh | |
1544 |
|
1544 | |||
1545 | test in problematic encoding |
|
1545 | test in problematic encoding | |
1546 | $ "$PYTHON" > test.sh <<EOF |
|
1546 | $ "$PYTHON" > test.sh <<EOF | |
1547 |
> print |
|
1547 | > print(u''' | |
1548 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' |
|
1548 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' | |
1549 | > echo ==== |
|
1549 | > echo ==== | |
1550 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' |
|
1550 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' | |
1551 | > echo ==== |
|
1551 | > echo ==== | |
1552 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' |
|
1552 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' | |
1553 | > echo ==== |
|
1553 | > echo ==== | |
1554 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' |
|
1554 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' | |
1555 | > echo ==== |
|
1555 | > echo ==== | |
1556 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' |
|
1556 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' | |
1557 | > echo ==== |
|
1557 | > echo ==== | |
1558 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' |
|
1558 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' | |
1559 | > '''.encode('cp932') |
|
1559 | > '''.encode('cp932')) | |
1560 | > EOF |
|
1560 | > EOF | |
1561 | $ sh < test.sh |
|
1561 | $ sh < test.sh | |
1562 | 0 |
|
1562 | 0 | |
1563 | ==== |
|
1563 | ==== | |
1564 | 1 |
|
1564 | 1 | |
1565 | ==== |
|
1565 | ==== | |
1566 | 2 |
|
1566 | 2 | |
1567 | ==== |
|
1567 | ==== | |
1568 | 3 |
|
1568 | 3 | |
1569 | ==== |
|
1569 | ==== | |
1570 | 0 |
|
1570 | 0 | |
1571 | 2 |
|
1571 | 2 | |
1572 | ==== |
|
1572 | ==== | |
1573 | 1 |
|
1573 | 1 | |
1574 | 3 |
|
1574 | 3 | |
1575 |
|
1575 | |||
1576 | test error message of bad revset |
|
1576 | test error message of bad revset | |
1577 | $ hg log -r 'foo\\' |
|
1577 | $ hg log -r 'foo\\' | |
1578 | hg: parse error at 3: syntax error in revset 'foo\\' |
|
1578 | hg: parse error at 3: syntax error in revset 'foo\\' | |
1579 | (foo\\ |
|
1579 | (foo\\ | |
1580 | ^ here) |
|
1580 | ^ here) | |
1581 | [255] |
|
1581 | [255] | |
1582 |
|
1582 | |||
1583 | $ cd .. |
|
1583 | $ cd .. | |
1584 |
|
1584 | |||
1585 | Test that revset predicate of extension isn't loaded at failure of |
|
1585 | Test that revset predicate of extension isn't loaded at failure of | |
1586 | loading it |
|
1586 | loading it | |
1587 |
|
1587 | |||
1588 | $ cd repo |
|
1588 | $ cd repo | |
1589 |
|
1589 | |||
1590 | $ cat <<EOF > $TESTTMP/custompredicate.py |
|
1590 | $ cat <<EOF > $TESTTMP/custompredicate.py | |
1591 | > from mercurial import error, registrar, revset |
|
1591 | > from mercurial import error, registrar, revset | |
1592 | > |
|
1592 | > | |
1593 | > revsetpredicate = registrar.revsetpredicate() |
|
1593 | > revsetpredicate = registrar.revsetpredicate() | |
1594 | > |
|
1594 | > | |
1595 | > @revsetpredicate(b'custom1()') |
|
1595 | > @revsetpredicate(b'custom1()') | |
1596 | > def custom1(repo, subset, x): |
|
1596 | > def custom1(repo, subset, x): | |
1597 | > return revset.baseset([1]) |
|
1597 | > return revset.baseset([1]) | |
1598 | > |
|
1598 | > | |
1599 | > raise error.Abort(b'intentional failure of loading extension') |
|
1599 | > raise error.Abort(b'intentional failure of loading extension') | |
1600 | > EOF |
|
1600 | > EOF | |
1601 | $ cat <<EOF > .hg/hgrc |
|
1601 | $ cat <<EOF > .hg/hgrc | |
1602 | > [extensions] |
|
1602 | > [extensions] | |
1603 | > custompredicate = $TESTTMP/custompredicate.py |
|
1603 | > custompredicate = $TESTTMP/custompredicate.py | |
1604 | > EOF |
|
1604 | > EOF | |
1605 |
|
1605 | |||
1606 | $ hg debugrevspec "custom1()" |
|
1606 | $ hg debugrevspec "custom1()" | |
1607 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension |
|
1607 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension | |
1608 | hg: parse error: unknown identifier: custom1 |
|
1608 | hg: parse error: unknown identifier: custom1 | |
1609 | [255] |
|
1609 | [255] | |
1610 |
|
1610 | |||
1611 | Test repo.anyrevs with customized revset overrides |
|
1611 | Test repo.anyrevs with customized revset overrides | |
1612 |
|
1612 | |||
1613 | $ cat > $TESTTMP/printprevset.py <<EOF |
|
1613 | $ cat > $TESTTMP/printprevset.py <<EOF | |
1614 | > from mercurial import encoding, registrar |
|
1614 | > from mercurial import encoding, registrar | |
1615 | > cmdtable = {} |
|
1615 | > cmdtable = {} | |
1616 | > command = registrar.command(cmdtable) |
|
1616 | > command = registrar.command(cmdtable) | |
1617 | > @command(b'printprevset') |
|
1617 | > @command(b'printprevset') | |
1618 | > def printprevset(ui, repo): |
|
1618 | > def printprevset(ui, repo): | |
1619 | > alias = {} |
|
1619 | > alias = {} | |
1620 | > p = encoding.environ.get(b'P') |
|
1620 | > p = encoding.environ.get(b'P') | |
1621 | > if p: |
|
1621 | > if p: | |
1622 | > alias[b'P'] = p |
|
1622 | > alias[b'P'] = p | |
1623 | > revs = repo.anyrevs([b'P'], user=True, localalias=alias) |
|
1623 | > revs = repo.anyrevs([b'P'], user=True, localalias=alias) | |
1624 | > ui.write(b'P=%r\n' % list(revs)) |
|
1624 | > ui.write(b'P=%r\n' % list(revs)) | |
1625 | > EOF |
|
1625 | > EOF | |
1626 |
|
1626 | |||
1627 | $ cat >> .hg/hgrc <<EOF |
|
1627 | $ cat >> .hg/hgrc <<EOF | |
1628 | > custompredicate = ! |
|
1628 | > custompredicate = ! | |
1629 | > printprevset = $TESTTMP/printprevset.py |
|
1629 | > printprevset = $TESTTMP/printprevset.py | |
1630 | > EOF |
|
1630 | > EOF | |
1631 |
|
1631 | |||
1632 | $ hg --config revsetalias.P=1 printprevset |
|
1632 | $ hg --config revsetalias.P=1 printprevset | |
1633 | P=[1] |
|
1633 | P=[1] | |
1634 | $ P=3 hg --config revsetalias.P=2 printprevset |
|
1634 | $ P=3 hg --config revsetalias.P=2 printprevset | |
1635 | P=[3] |
|
1635 | P=[3] | |
1636 |
|
1636 | |||
1637 | $ cd .. |
|
1637 | $ cd .. | |
1638 |
|
1638 | |||
1639 | Test obsstore related revsets |
|
1639 | Test obsstore related revsets | |
1640 |
|
1640 | |||
1641 | $ hg init repo1 |
|
1641 | $ hg init repo1 | |
1642 | $ cd repo1 |
|
1642 | $ cd repo1 | |
1643 | $ cat <<EOF >> .hg/hgrc |
|
1643 | $ cat <<EOF >> .hg/hgrc | |
1644 | > [experimental] |
|
1644 | > [experimental] | |
1645 | > evolution.createmarkers=True |
|
1645 | > evolution.createmarkers=True | |
1646 | > EOF |
|
1646 | > EOF | |
1647 |
|
1647 | |||
1648 | $ hg debugdrawdag <<'EOS' |
|
1648 | $ hg debugdrawdag <<'EOS' | |
1649 | > F G |
|
1649 | > F G | |
1650 | > |/ # split: B -> E, F |
|
1650 | > |/ # split: B -> E, F | |
1651 | > B C D E # amend: B -> C -> D |
|
1651 | > B C D E # amend: B -> C -> D | |
1652 | > \|/ | # amend: F -> G |
|
1652 | > \|/ | # amend: F -> G | |
1653 | > A A Z # amend: A -> Z |
|
1653 | > A A Z # amend: A -> Z | |
1654 | > EOS |
|
1654 | > EOS | |
1655 | 3 new orphan changesets |
|
1655 | 3 new orphan changesets | |
1656 | 3 new content-divergent changesets |
|
1656 | 3 new content-divergent changesets | |
1657 |
|
1657 | |||
1658 | $ hg log -r 'successors(Z)' -T '{desc}\n' |
|
1658 | $ hg log -r 'successors(Z)' -T '{desc}\n' | |
1659 | Z |
|
1659 | Z | |
1660 |
|
1660 | |||
1661 | $ hg log -r 'successors(F)' -T '{desc}\n' |
|
1661 | $ hg log -r 'successors(F)' -T '{desc}\n' | |
1662 | F |
|
1662 | F | |
1663 | G |
|
1663 | G | |
1664 |
|
1664 | |||
1665 | $ hg tag --remove --local C D E F G |
|
1665 | $ hg tag --remove --local C D E F G | |
1666 |
|
1666 | |||
1667 | $ hg log -r 'successors(B)' -T '{desc}\n' |
|
1667 | $ hg log -r 'successors(B)' -T '{desc}\n' | |
1668 | B |
|
1668 | B | |
1669 | D |
|
1669 | D | |
1670 | E |
|
1670 | E | |
1671 | G |
|
1671 | G | |
1672 |
|
1672 | |||
1673 | $ hg log -r 'successors(B)' -T '{desc}\n' --hidden |
|
1673 | $ hg log -r 'successors(B)' -T '{desc}\n' --hidden | |
1674 | B |
|
1674 | B | |
1675 | C |
|
1675 | C | |
1676 | D |
|
1676 | D | |
1677 | E |
|
1677 | E | |
1678 | F |
|
1678 | F | |
1679 | G |
|
1679 | G | |
1680 |
|
1680 | |||
1681 | $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden |
|
1681 | $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden | |
1682 | D |
|
1682 | D | |
1683 | E |
|
1683 | E | |
1684 | G |
|
1684 | G | |
1685 |
|
1685 | |||
1686 | $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' |
|
1686 | $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' | |
1687 | A |
|
1687 | A | |
1688 | Z |
|
1688 | Z | |
1689 | B |
|
1689 | B | |
1690 |
|
1690 | |||
1691 | $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' |
|
1691 | $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' | |
1692 | Z |
|
1692 | Z | |
1693 |
|
1693 | |||
1694 | Test `draft() & ::x` optimization |
|
1694 | Test `draft() & ::x` optimization | |
1695 |
|
1695 | |||
1696 | $ hg init $TESTTMP/repo2 |
|
1696 | $ hg init $TESTTMP/repo2 | |
1697 | $ cd $TESTTMP/repo2 |
|
1697 | $ cd $TESTTMP/repo2 | |
1698 | $ hg debugdrawdag <<'EOS' |
|
1698 | $ hg debugdrawdag <<'EOS' | |
1699 | > P5 S1 |
|
1699 | > P5 S1 | |
1700 | > | | |
|
1700 | > | | | |
1701 | > S2 | D3 |
|
1701 | > S2 | D3 | |
1702 | > \|/ |
|
1702 | > \|/ | |
1703 | > P4 |
|
1703 | > P4 | |
1704 | > | |
|
1704 | > | | |
1705 | > P3 D2 |
|
1705 | > P3 D2 | |
1706 | > | | |
|
1706 | > | | | |
1707 | > P2 D1 |
|
1707 | > P2 D1 | |
1708 | > |/ |
|
1708 | > |/ | |
1709 | > P1 |
|
1709 | > P1 | |
1710 | > | |
|
1710 | > | | |
1711 | > P0 |
|
1711 | > P0 | |
1712 | > EOS |
|
1712 | > EOS | |
1713 | $ hg phase --public -r P5 |
|
1713 | $ hg phase --public -r P5 | |
1714 | $ hg phase --force --secret -r S1+S2 |
|
1714 | $ hg phase --force --secret -r S1+S2 | |
1715 | $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' |
|
1715 | $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' | |
1716 | o 8 P5 public |
|
1716 | o 8 P5 public | |
1717 | | |
|
1717 | | | |
1718 | | o 10 S1 secret |
|
1718 | | o 10 S1 secret | |
1719 | | | |
|
1719 | | | | |
1720 | | o 7 D3 draft |
|
1720 | | o 7 D3 draft | |
1721 | |/ |
|
1721 | |/ | |
1722 | | o 9 S2 secret |
|
1722 | | o 9 S2 secret | |
1723 | |/ |
|
1723 | |/ | |
1724 | o 6 P4 public |
|
1724 | o 6 P4 public | |
1725 | | |
|
1725 | | | |
1726 | o 5 P3 public |
|
1726 | o 5 P3 public | |
1727 | | |
|
1727 | | | |
1728 | o 3 P2 public |
|
1728 | o 3 P2 public | |
1729 | | |
|
1729 | | | |
1730 | | o 4 D2 draft |
|
1730 | | o 4 D2 draft | |
1731 | | | |
|
1731 | | | | |
1732 | | o 2 D1 draft |
|
1732 | | o 2 D1 draft | |
1733 | |/ |
|
1733 | |/ | |
1734 | o 1 P1 public |
|
1734 | o 1 P1 public | |
1735 | | |
|
1735 | | | |
1736 | o 0 P0 public |
|
1736 | o 0 P0 public | |
1737 |
|
1737 | |||
1738 | $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' |
|
1738 | $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' | |
1739 | * analyzed: |
|
1739 | * analyzed: | |
1740 | (and |
|
1740 | (and | |
1741 | (func |
|
1741 | (func | |
1742 | (symbol 'draft') |
|
1742 | (symbol 'draft') | |
1743 | None) |
|
1743 | None) | |
1744 | (func |
|
1744 | (func | |
1745 | (symbol 'ancestors') |
|
1745 | (symbol 'ancestors') | |
1746 | (or |
|
1746 | (or | |
1747 | (list |
|
1747 | (list | |
1748 | (and |
|
1748 | (and | |
1749 | (or |
|
1749 | (or | |
1750 | (list |
|
1750 | (list | |
1751 | (symbol 'S1') |
|
1751 | (symbol 'S1') | |
1752 | (symbol 'D1') |
|
1752 | (symbol 'D1') | |
1753 | (symbol 'P5'))) |
|
1753 | (symbol 'P5'))) | |
1754 | (not |
|
1754 | (not | |
1755 | (symbol 'D3'))) |
|
1755 | (symbol 'D3'))) | |
1756 | (symbol 'S2'))))) |
|
1756 | (symbol 'S2'))))) | |
1757 | * optimized: |
|
1757 | * optimized: | |
1758 | (func |
|
1758 | (func | |
1759 | (symbol '_phaseandancestors') |
|
1759 | (symbol '_phaseandancestors') | |
1760 | (list |
|
1760 | (list | |
1761 | (symbol 'draft') |
|
1761 | (symbol 'draft') | |
1762 | (or |
|
1762 | (or | |
1763 | (list |
|
1763 | (list | |
1764 | (difference |
|
1764 | (difference | |
1765 | (func |
|
1765 | (func | |
1766 | (symbol '_list') |
|
1766 | (symbol '_list') | |
1767 | (string 'S1\x00D1\x00P5')) |
|
1767 | (string 'S1\x00D1\x00P5')) | |
1768 | (symbol 'D3')) |
|
1768 | (symbol 'D3')) | |
1769 | (symbol 'S2'))))) |
|
1769 | (symbol 'S2'))))) | |
1770 | $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' |
|
1770 | $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' | |
1771 | * analyzed: |
|
1771 | * analyzed: | |
1772 | (and |
|
1772 | (and | |
1773 | (func |
|
1773 | (func | |
1774 | (symbol 'secret') |
|
1774 | (symbol 'secret') | |
1775 | None) |
|
1775 | None) | |
1776 | (func |
|
1776 | (func | |
1777 | (symbol 'ancestors') |
|
1777 | (symbol 'ancestors') | |
1778 | (symbol '9'))) |
|
1778 | (symbol '9'))) | |
1779 | * optimized: |
|
1779 | * optimized: | |
1780 | (func |
|
1780 | (func | |
1781 | (symbol '_phaseandancestors') |
|
1781 | (symbol '_phaseandancestors') | |
1782 | (list |
|
1782 | (list | |
1783 | (symbol 'secret') |
|
1783 | (symbol 'secret') | |
1784 | (symbol '9'))) |
|
1784 | (symbol '9'))) | |
1785 | $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' |
|
1785 | $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' | |
1786 | * analyzed: |
|
1786 | * analyzed: | |
1787 | (and |
|
1787 | (and | |
1788 | (symbol '7') |
|
1788 | (symbol '7') | |
1789 | (and |
|
1789 | (and | |
1790 | (not |
|
1790 | (not | |
1791 | (func |
|
1791 | (func | |
1792 | (symbol 'public') |
|
1792 | (symbol 'public') | |
1793 | None)) |
|
1793 | None)) | |
1794 | (func |
|
1794 | (func | |
1795 | (symbol 'ancestors') |
|
1795 | (symbol 'ancestors') | |
1796 | (func |
|
1796 | (func | |
1797 | (symbol 'tag') |
|
1797 | (symbol 'tag') | |
1798 | None)))) |
|
1798 | None)))) | |
1799 | * optimized: |
|
1799 | * optimized: | |
1800 | (and |
|
1800 | (and | |
1801 | (symbol '7') |
|
1801 | (symbol '7') | |
1802 | (func |
|
1802 | (func | |
1803 | (symbol '_phaseandancestors') |
|
1803 | (symbol '_phaseandancestors') | |
1804 | (list |
|
1804 | (list | |
1805 | (symbol '_notpublic') |
|
1805 | (symbol '_notpublic') | |
1806 | (func |
|
1806 | (func | |
1807 | (symbol 'tag') |
|
1807 | (symbol 'tag') | |
1808 | None)))) |
|
1808 | None)))) | |
1809 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' |
|
1809 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' | |
1810 | * optimized: |
|
1810 | * optimized: | |
1811 | (and |
|
1811 | (and | |
1812 | (func |
|
1812 | (func | |
1813 | (symbol '_notpublic') |
|
1813 | (symbol '_notpublic') | |
1814 | None) |
|
1814 | None) | |
1815 | (func |
|
1815 | (func | |
1816 | (symbol 'ancestors') |
|
1816 | (symbol 'ancestors') | |
1817 | (list |
|
1817 | (list | |
1818 | (func |
|
1818 | (func | |
1819 | (symbol '_list') |
|
1819 | (symbol '_list') | |
1820 | (string 'S1\x00D2\x00P5')) |
|
1820 | (string 'S1\x00D2\x00P5')) | |
1821 | (symbol '1')))) |
|
1821 | (symbol '1')))) | |
1822 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' |
|
1822 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' | |
1823 | * optimized: |
|
1823 | * optimized: | |
1824 | (and |
|
1824 | (and | |
1825 | (func |
|
1825 | (func | |
1826 | (symbol '_notpublic') |
|
1826 | (symbol '_notpublic') | |
1827 | None) |
|
1827 | None) | |
1828 | (func |
|
1828 | (func | |
1829 | (symbol 'ancestors') |
|
1829 | (symbol 'ancestors') | |
1830 | (list |
|
1830 | (list | |
1831 | (func |
|
1831 | (func | |
1832 | (symbol '_list') |
|
1832 | (symbol '_list') | |
1833 | (string 'S1\x00D2\x00P5')) |
|
1833 | (string 'S1\x00D2\x00P5')) | |
1834 | (keyvalue |
|
1834 | (keyvalue | |
1835 | (symbol 'depth') |
|
1835 | (symbol 'depth') | |
1836 | (symbol '1'))))) |
|
1836 | (symbol '1'))))) | |
1837 |
|
1837 | |||
1838 | test commonancestors and its optimization |
|
1838 | test commonancestors and its optimization | |
1839 |
|
1839 | |||
1840 | $ hg debugrevspec --verify -p analyzed -p optimized 'heads(commonancestors(head()))' |
|
1840 | $ hg debugrevspec --verify -p analyzed -p optimized 'heads(commonancestors(head()))' | |
1841 | * analyzed: |
|
1841 | * analyzed: | |
1842 | (func |
|
1842 | (func | |
1843 | (symbol 'heads') |
|
1843 | (symbol 'heads') | |
1844 | (func |
|
1844 | (func | |
1845 | (symbol 'commonancestors') |
|
1845 | (symbol 'commonancestors') | |
1846 | (func |
|
1846 | (func | |
1847 | (symbol 'head') |
|
1847 | (symbol 'head') | |
1848 | None))) |
|
1848 | None))) | |
1849 | * optimized: |
|
1849 | * optimized: | |
1850 | (func |
|
1850 | (func | |
1851 | (symbol '_commonancestorheads') |
|
1851 | (symbol '_commonancestorheads') | |
1852 | (func |
|
1852 | (func | |
1853 | (symbol 'head') |
|
1853 | (symbol 'head') | |
1854 | None)) |
|
1854 | None)) |
General Comments 0
You need to be logged in to leave comments.
Login now