##// END OF EJS Templates
py3: suppress the output from .write() calls in the remaining tests
Matt Harbison -
r40242:803b7569 default
parent child Browse files
Show More
@@ -1,257 +1,257 b''
1 1 #require icasefs
2 2
3 3 $ hg debugfs | grep 'case-sensitive:'
4 4 case-sensitive: no
5 5
6 6 test file addition with bad case
7 7
8 8 $ hg init repo1
9 9 $ cd repo1
10 10 $ echo a > a
11 11 $ hg add A
12 12 $ hg st
13 13 A a
14 14 $ hg ci -m adda
15 15 $ hg manifest
16 16 a
17 17 $ cd ..
18 18
19 19 test case collision on rename (issue750)
20 20
21 21 $ hg init repo2
22 22 $ cd repo2
23 23 $ echo a > a
24 24 $ hg --debug ci -Am adda
25 25 adding a
26 26 committing files:
27 27 a
28 28 committing manifest
29 29 committing changelog
30 30 updating the branch cache
31 31 committed changeset 0:07f4944404050f47db2e5c5071e0e84e7a27bba9
32 32
33 33 Case-changing renames should work:
34 34
35 35 $ hg mv a A
36 36 $ hg mv A a
37 37 $ hg st
38 38
39 39 addremove after case-changing rename has no effect (issue4590)
40 40
41 41 $ hg mv a A
42 42 $ hg addremove
43 43 recording removal of a as rename to A (100% similar)
44 44 $ hg revert --all
45 45 forgetting A
46 46 undeleting a
47 47
48 48 test changing case of path components
49 49
50 50 $ mkdir D
51 51 $ echo b > D/b
52 52 $ hg ci -Am addb D/b
53 53 $ hg mv D/b d/b
54 54 D/b: not overwriting - file already committed
55 55 ('hg rename --force' to replace the file by recording a rename)
56 56 [1]
57 57 $ hg mv D/b d/c
58 58 $ hg st
59 59 A D/c
60 60 R D/b
61 61 $ mv D temp
62 62 $ mv temp d
63 63 $ hg st
64 64 A D/c
65 65 R D/b
66 66 $ hg revert -aq
67 67 $ rm d/c
68 68 $ echo c > D/c
69 69 $ hg add D/c
70 70 $ hg st
71 71 A D/c
72 72 $ hg ci -m addc D/c
73 73 $ hg mv d/b d/e
74 74 $ hg st
75 75 A D/e
76 76 R D/b
77 77 $ hg revert -aq
78 78 $ rm d/e
79 79 $ hg mv d/b D/B
80 80 $ hg st
81 81 A D/B
82 82 R D/b
83 83 $ cd ..
84 84
85 85 test case collision between revisions (issue912)
86 86
87 87 $ hg init repo3
88 88 $ cd repo3
89 89 $ echo a > a
90 90 $ hg ci -Am adda
91 91 adding a
92 92 $ hg rm a
93 93 $ hg ci -Am removea
94 94 $ echo A > A
95 95
96 96 on linux hfs keeps the old case stored, force it
97 97
98 98 $ mv a aa
99 99 $ mv aa A
100 100 $ hg ci -Am addA
101 101 adding A
102 102
103 103 used to fail under case insensitive fs
104 104
105 105 $ hg up -C 0
106 106 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
107 107 $ hg up -C
108 108 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
109 109
110 110 no clobbering of untracked files with wrong casing
111 111
112 112 $ hg up -r null
113 113 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
114 114 $ echo gold > a
115 115 $ hg up
116 116 A: untracked file differs
117 117 abort: untracked files in working directory differ from files in requested revision
118 118 [255]
119 119 $ cat a
120 120 gold
121 121 $ rm a
122 122
123 123 test that normal file in different case on target context is not
124 124 unlinked by largefiles extension.
125 125
126 126 $ cat >> .hg/hgrc <<EOF
127 127 > [extensions]
128 128 > largefiles=
129 129 > EOF
130 130 $ hg update -q -C 1
131 131 $ hg status -A
132 132 $ echo 'A as largefiles' > A
133 133 $ hg add --large A
134 134 $ hg commit -m '#3'
135 135 created new head
136 136 $ hg manifest -r 3
137 137 .hglf/A
138 138 $ hg manifest -r 0
139 139 a
140 140 $ hg update -q -C 0
141 141 $ hg status -A
142 142 C a
143 143 $ hg update -q -C 3
144 144 $ hg update -q 0
145 145
146 146 $ hg up -C -r 2
147 147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 148 $ hg mv A a
149 149 $ hg diff -g > rename.diff
150 150 $ hg ci -m 'A -> a'
151 151 $ hg up -q '.^'
152 152 $ hg import rename.diff -m "import rename A -> a"
153 153 applying rename.diff
154 154 $ hg st
155 155 ? rename.diff
156 156 $ hg files
157 157 a
158 158 $ find * | sort
159 159 a
160 160 rename.diff
161 161
162 162 $ rm rename.diff
163 163
164 164 $ cd ..
165 165
166 166 issue 3342: file in nested directory causes unexpected abort
167 167
168 168 $ hg init issue3342
169 169 $ cd issue3342
170 170
171 171 $ mkdir -p a/B/c/D
172 172 $ echo e > a/B/c/D/e
173 173 $ hg add a/B/c/D/e
174 174 $ hg ci -m 'add e'
175 175
176 176 issue 4481: revert across case only renames
177 177 $ hg mv a/B/c/D/e a/B/c/d/E
178 178 $ hg ci -m "uppercase E"
179 179 $ echo 'foo' > a/B/c/D/E
180 180 $ hg ci -m 'e content change'
181 181 $ hg revert --all -r 0
182 182 removing a/B/c/D/E
183 183 adding a/B/c/D/e
184 184 $ find * | sort
185 185 a
186 186 a/B
187 187 a/B/c
188 188 a/B/c/D
189 189 a/B/c/D/e
190 190 a/B/c/D/e.orig
191 191
192 192 $ cd ..
193 193
194 194 issue 3340: mq does not handle case changes correctly
195 195
196 196 in addition to reported case, 'hg qrefresh' is also tested against
197 197 case changes.
198 198
199 199 $ echo "[extensions]" >> $HGRCPATH
200 200 $ echo "mq=" >> $HGRCPATH
201 201
202 202 $ hg init issue3340
203 203 $ cd issue3340
204 204
205 205 $ echo a > mIxEdCaSe
206 206 $ hg add mIxEdCaSe
207 207 $ hg commit -m '#0'
208 208 $ hg rename mIxEdCaSe tmp
209 209 $ hg rename tmp MiXeDcAsE
210 210 $ hg status -A
211 211 A MiXeDcAsE
212 212 mIxEdCaSe
213 213 R mIxEdCaSe
214 214 $ hg qnew changecase
215 215 $ hg status -A
216 216 C MiXeDcAsE
217 217
218 218 $ hg qpop -a
219 219 popping changecase
220 220 patch queue now empty
221 221 $ hg qnew refresh-casechange
222 222 $ hg status -A
223 223 C mIxEdCaSe
224 224 $ hg rename mIxEdCaSe tmp
225 225 $ hg rename tmp MiXeDcAsE
226 226 $ hg status -A
227 227 A MiXeDcAsE
228 228 mIxEdCaSe
229 229 R mIxEdCaSe
230 230 $ hg qrefresh
231 231 $ hg status -A
232 232 C MiXeDcAsE
233 233
234 234 $ hg qpop -a
235 235 popping refresh-casechange
236 236 patch queue now empty
237 237 $ hg qnew refresh-pattern
238 238 $ hg status
239 239 $ echo A > A
240 240 $ hg add
241 241 adding A
242 242 $ hg qrefresh a # issue 3271, qrefresh with file handled case wrong
243 243 $ hg status # empty status means the qrefresh worked
244 244
245 245 #if osx
246 246
247 247 We assume anyone running the tests on a case-insensitive volume on OS
248 248 X will be using HFS+. If that's not true, this test will fail.
249 249
250 250 $ rm A
251 >>> open(u'a\u200c'.encode('utf-8'), 'w').write('unicode is fun')
251 >>> open(u'a\u200c'.encode('utf-8'), 'w').write('unicode is fun') and None
252 252 $ hg status
253 253 M A
254 254
255 255 #endif
256 256
257 257 $ cd ..
@@ -1,2219 +1,2219 b''
1 1 #require serve
2 2
3 3 $ request() {
4 4 > get-with-headers.py --json localhost:$HGPORT "$1"
5 5 > }
6 6
7 7 $ hg init test
8 8 $ cd test
9 9 $ mkdir da
10 10 $ echo foo > da/foo
11 11 $ echo foo > foo
12 12 $ hg -q ci -A -m initial
13 13 $ echo bar > foo
14 14 $ hg ci -m 'modify foo'
15 15 $ echo bar > da/foo
16 16 $ hg ci -m 'modify da/foo'
17 17 $ hg bookmark bookmark1
18 18 $ hg up default
19 19 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 20 (leaving bookmark bookmark1)
21 21 $ hg mv foo foo-new
22 22 $ hg commit -m 'move foo'
23 23 $ hg tag -m 'create tag' tag1
24 24 $ hg phase --public -r .
25 25 $ echo baz > da/foo
26 26 $ hg commit -m 'another commit to da/foo'
27 27 $ hg tag -m 'create tag2' tag2
28 28 $ hg bookmark bookmark2
29 29 $ hg -q up -r 0
30 30 $ hg -q branch test-branch
31 31 $ echo branch > foo
32 32 $ hg commit -m 'create test branch'
33 33 $ echo branch_commit_2 > foo
34 34 $ hg commit -m 'another commit in test-branch'
35 35 $ hg -q up default
36 36 $ hg merge --tool :local test-branch
37 37 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
38 38 (branch merge, don't forget to commit)
39 39 $ hg commit -m 'merge test-branch into default'
40 40
41 41 $ hg log -G
42 42 @ changeset: 9:cc725e08502a
43 43 |\ tag: tip
44 44 | | parent: 6:ceed296fe500
45 45 | | parent: 8:ed66c30e87eb
46 46 | | user: test
47 47 | | date: Thu Jan 01 00:00:00 1970 +0000
48 48 | | summary: merge test-branch into default
49 49 | |
50 50 | o changeset: 8:ed66c30e87eb
51 51 | | branch: test-branch
52 52 | | user: test
53 53 | | date: Thu Jan 01 00:00:00 1970 +0000
54 54 | | summary: another commit in test-branch
55 55 | |
56 56 | o changeset: 7:6ab967a8ab34
57 57 | | branch: test-branch
58 58 | | parent: 0:06e557f3edf6
59 59 | | user: test
60 60 | | date: Thu Jan 01 00:00:00 1970 +0000
61 61 | | summary: create test branch
62 62 | |
63 63 o | changeset: 6:ceed296fe500
64 64 | | bookmark: bookmark2
65 65 | | user: test
66 66 | | date: Thu Jan 01 00:00:00 1970 +0000
67 67 | | summary: create tag2
68 68 | |
69 69 o | changeset: 5:f2890a05fea4
70 70 | | tag: tag2
71 71 | | user: test
72 72 | | date: Thu Jan 01 00:00:00 1970 +0000
73 73 | | summary: another commit to da/foo
74 74 | |
75 75 o | changeset: 4:93a8ce14f891
76 76 | | user: test
77 77 | | date: Thu Jan 01 00:00:00 1970 +0000
78 78 | | summary: create tag
79 79 | |
80 80 o | changeset: 3:78896eb0e102
81 81 | | tag: tag1
82 82 | | user: test
83 83 | | date: Thu Jan 01 00:00:00 1970 +0000
84 84 | | summary: move foo
85 85 | |
86 86 o | changeset: 2:8d7c456572ac
87 87 | | bookmark: bookmark1
88 88 | | user: test
89 89 | | date: Thu Jan 01 00:00:00 1970 +0000
90 90 | | summary: modify da/foo
91 91 | |
92 92 o | changeset: 1:f8bbb9024b10
93 93 |/ user: test
94 94 | date: Thu Jan 01 00:00:00 1970 +0000
95 95 | summary: modify foo
96 96 |
97 97 o changeset: 0:06e557f3edf6
98 98 user: test
99 99 date: Thu Jan 01 00:00:00 1970 +0000
100 100 summary: initial
101 101
102 102
103 103 $ echo '[web]' >> .hg/hgrc
104 104 $ echo 'allow-archive = bz2' >> .hg/hgrc
105 105 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
106 106 $ cat hg.pid >> $DAEMON_PIDS
107 107
108 108 (Try to keep these in roughly the order they are defined in webcommands.py)
109 109
110 110 (log is handled by filelog/ and changelog/ - ignore it)
111 111
112 112 (rawfile/ doesn't use templating - nothing to test)
113 113
114 114 file/{revision}/{path} shows file revision
115 115
116 116 $ request json-file/78896eb0e102/foo-new
117 117 200 Script output follows
118 118
119 119 {
120 120 "bookmarks": [],
121 121 "branch": "default",
122 122 "date": [
123 123 0.0,
124 124 0
125 125 ],
126 126 "desc": "move foo",
127 127 "lines": [
128 128 {
129 129 "line": "bar\n"
130 130 }
131 131 ],
132 132 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
133 133 "parents": [
134 134 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
135 135 ],
136 136 "path": "foo-new",
137 137 "phase": "public",
138 138 "tags": [
139 139 "tag1"
140 140 ],
141 141 "user": "test"
142 142 }
143 143
144 144 file/{revision} shows root directory info
145 145
146 146 $ request json-file/cc725e08502a
147 147 200 Script output follows
148 148
149 149 {
150 150 "abspath": "/",
151 151 "bookmarks": [],
152 152 "directories": [
153 153 {
154 154 "abspath": "/da",
155 155 "basename": "da",
156 156 "emptydirs": ""
157 157 }
158 158 ],
159 159 "files": [
160 160 {
161 161 "abspath": ".hgtags",
162 162 "basename": ".hgtags",
163 163 "date": [
164 164 0.0,
165 165 0
166 166 ],
167 167 "flags": "",
168 168 "size": 92
169 169 },
170 170 {
171 171 "abspath": "foo-new",
172 172 "basename": "foo-new",
173 173 "date": [
174 174 0.0,
175 175 0
176 176 ],
177 177 "flags": "",
178 178 "size": 4
179 179 }
180 180 ],
181 181 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
182 182 "tags": [
183 183 "tip"
184 184 ]
185 185 }
186 186
187 187 changelog/ shows information about several changesets
188 188
189 189 $ request json-changelog
190 190 200 Script output follows
191 191
192 192 {
193 193 "changeset_count": 10,
194 194 "changesets": [
195 195 {
196 196 "bookmarks": [],
197 197 "branch": "default",
198 198 "date": [
199 199 0.0,
200 200 0
201 201 ],
202 202 "desc": "merge test-branch into default",
203 203 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
204 204 "parents": [
205 205 "ceed296fe500c3fac9541e31dad860cb49c89e45",
206 206 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
207 207 ],
208 208 "phase": "draft",
209 209 "tags": [
210 210 "tip"
211 211 ],
212 212 "user": "test"
213 213 },
214 214 {
215 215 "bookmarks": [],
216 216 "branch": "test-branch",
217 217 "date": [
218 218 0.0,
219 219 0
220 220 ],
221 221 "desc": "another commit in test-branch",
222 222 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
223 223 "parents": [
224 224 "6ab967a8ab3489227a83f80e920faa039a71819f"
225 225 ],
226 226 "phase": "draft",
227 227 "tags": [],
228 228 "user": "test"
229 229 },
230 230 {
231 231 "bookmarks": [],
232 232 "branch": "test-branch",
233 233 "date": [
234 234 0.0,
235 235 0
236 236 ],
237 237 "desc": "create test branch",
238 238 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
239 239 "parents": [
240 240 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
241 241 ],
242 242 "phase": "draft",
243 243 "tags": [],
244 244 "user": "test"
245 245 },
246 246 {
247 247 "bookmarks": [
248 248 "bookmark2"
249 249 ],
250 250 "branch": "default",
251 251 "date": [
252 252 0.0,
253 253 0
254 254 ],
255 255 "desc": "create tag2",
256 256 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
257 257 "parents": [
258 258 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
259 259 ],
260 260 "phase": "draft",
261 261 "tags": [],
262 262 "user": "test"
263 263 },
264 264 {
265 265 "bookmarks": [],
266 266 "branch": "default",
267 267 "date": [
268 268 0.0,
269 269 0
270 270 ],
271 271 "desc": "another commit to da/foo",
272 272 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
273 273 "parents": [
274 274 "93a8ce14f89156426b7fa981af8042da53f03aa0"
275 275 ],
276 276 "phase": "draft",
277 277 "tags": [
278 278 "tag2"
279 279 ],
280 280 "user": "test"
281 281 },
282 282 {
283 283 "bookmarks": [],
284 284 "branch": "default",
285 285 "date": [
286 286 0.0,
287 287 0
288 288 ],
289 289 "desc": "create tag",
290 290 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
291 291 "parents": [
292 292 "78896eb0e102174ce9278438a95e12543e4367a7"
293 293 ],
294 294 "phase": "public",
295 295 "tags": [],
296 296 "user": "test"
297 297 },
298 298 {
299 299 "bookmarks": [],
300 300 "branch": "default",
301 301 "date": [
302 302 0.0,
303 303 0
304 304 ],
305 305 "desc": "move foo",
306 306 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
307 307 "parents": [
308 308 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
309 309 ],
310 310 "phase": "public",
311 311 "tags": [
312 312 "tag1"
313 313 ],
314 314 "user": "test"
315 315 },
316 316 {
317 317 "bookmarks": [
318 318 "bookmark1"
319 319 ],
320 320 "branch": "default",
321 321 "date": [
322 322 0.0,
323 323 0
324 324 ],
325 325 "desc": "modify da/foo",
326 326 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
327 327 "parents": [
328 328 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
329 329 ],
330 330 "phase": "public",
331 331 "tags": [],
332 332 "user": "test"
333 333 },
334 334 {
335 335 "bookmarks": [],
336 336 "branch": "default",
337 337 "date": [
338 338 0.0,
339 339 0
340 340 ],
341 341 "desc": "modify foo",
342 342 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
343 343 "parents": [
344 344 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
345 345 ],
346 346 "phase": "public",
347 347 "tags": [],
348 348 "user": "test"
349 349 },
350 350 {
351 351 "bookmarks": [],
352 352 "branch": "default",
353 353 "date": [
354 354 0.0,
355 355 0
356 356 ],
357 357 "desc": "initial",
358 358 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
359 359 "parents": [],
360 360 "phase": "public",
361 361 "tags": [],
362 362 "user": "test"
363 363 }
364 364 ],
365 365 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
366 366 }
367 367
368 368 changelog/{revision} shows information starting at a specific changeset
369 369
370 370 $ request json-changelog/f8bbb9024b10
371 371 200 Script output follows
372 372
373 373 {
374 374 "changeset_count": 10,
375 375 "changesets": [
376 376 {
377 377 "bookmarks": [],
378 378 "branch": "default",
379 379 "date": [
380 380 0.0,
381 381 0
382 382 ],
383 383 "desc": "modify foo",
384 384 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
385 385 "parents": [
386 386 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
387 387 ],
388 388 "phase": "public",
389 389 "tags": [],
390 390 "user": "test"
391 391 },
392 392 {
393 393 "bookmarks": [],
394 394 "branch": "default",
395 395 "date": [
396 396 0.0,
397 397 0
398 398 ],
399 399 "desc": "initial",
400 400 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
401 401 "parents": [],
402 402 "phase": "public",
403 403 "tags": [],
404 404 "user": "test"
405 405 }
406 406 ],
407 407 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
408 408 }
409 409
410 410 shortlog/ shows information about a set of changesets
411 411
412 412 $ request json-shortlog
413 413 200 Script output follows
414 414
415 415 {
416 416 "changeset_count": 10,
417 417 "changesets": [
418 418 {
419 419 "bookmarks": [],
420 420 "branch": "default",
421 421 "date": [
422 422 0.0,
423 423 0
424 424 ],
425 425 "desc": "merge test-branch into default",
426 426 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
427 427 "parents": [
428 428 "ceed296fe500c3fac9541e31dad860cb49c89e45",
429 429 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
430 430 ],
431 431 "phase": "draft",
432 432 "tags": [
433 433 "tip"
434 434 ],
435 435 "user": "test"
436 436 },
437 437 {
438 438 "bookmarks": [],
439 439 "branch": "test-branch",
440 440 "date": [
441 441 0.0,
442 442 0
443 443 ],
444 444 "desc": "another commit in test-branch",
445 445 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
446 446 "parents": [
447 447 "6ab967a8ab3489227a83f80e920faa039a71819f"
448 448 ],
449 449 "phase": "draft",
450 450 "tags": [],
451 451 "user": "test"
452 452 },
453 453 {
454 454 "bookmarks": [],
455 455 "branch": "test-branch",
456 456 "date": [
457 457 0.0,
458 458 0
459 459 ],
460 460 "desc": "create test branch",
461 461 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
462 462 "parents": [
463 463 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
464 464 ],
465 465 "phase": "draft",
466 466 "tags": [],
467 467 "user": "test"
468 468 },
469 469 {
470 470 "bookmarks": [
471 471 "bookmark2"
472 472 ],
473 473 "branch": "default",
474 474 "date": [
475 475 0.0,
476 476 0
477 477 ],
478 478 "desc": "create tag2",
479 479 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
480 480 "parents": [
481 481 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
482 482 ],
483 483 "phase": "draft",
484 484 "tags": [],
485 485 "user": "test"
486 486 },
487 487 {
488 488 "bookmarks": [],
489 489 "branch": "default",
490 490 "date": [
491 491 0.0,
492 492 0
493 493 ],
494 494 "desc": "another commit to da/foo",
495 495 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
496 496 "parents": [
497 497 "93a8ce14f89156426b7fa981af8042da53f03aa0"
498 498 ],
499 499 "phase": "draft",
500 500 "tags": [
501 501 "tag2"
502 502 ],
503 503 "user": "test"
504 504 },
505 505 {
506 506 "bookmarks": [],
507 507 "branch": "default",
508 508 "date": [
509 509 0.0,
510 510 0
511 511 ],
512 512 "desc": "create tag",
513 513 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
514 514 "parents": [
515 515 "78896eb0e102174ce9278438a95e12543e4367a7"
516 516 ],
517 517 "phase": "public",
518 518 "tags": [],
519 519 "user": "test"
520 520 },
521 521 {
522 522 "bookmarks": [],
523 523 "branch": "default",
524 524 "date": [
525 525 0.0,
526 526 0
527 527 ],
528 528 "desc": "move foo",
529 529 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
530 530 "parents": [
531 531 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
532 532 ],
533 533 "phase": "public",
534 534 "tags": [
535 535 "tag1"
536 536 ],
537 537 "user": "test"
538 538 },
539 539 {
540 540 "bookmarks": [
541 541 "bookmark1"
542 542 ],
543 543 "branch": "default",
544 544 "date": [
545 545 0.0,
546 546 0
547 547 ],
548 548 "desc": "modify da/foo",
549 549 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
550 550 "parents": [
551 551 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
552 552 ],
553 553 "phase": "public",
554 554 "tags": [],
555 555 "user": "test"
556 556 },
557 557 {
558 558 "bookmarks": [],
559 559 "branch": "default",
560 560 "date": [
561 561 0.0,
562 562 0
563 563 ],
564 564 "desc": "modify foo",
565 565 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
566 566 "parents": [
567 567 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
568 568 ],
569 569 "phase": "public",
570 570 "tags": [],
571 571 "user": "test"
572 572 },
573 573 {
574 574 "bookmarks": [],
575 575 "branch": "default",
576 576 "date": [
577 577 0.0,
578 578 0
579 579 ],
580 580 "desc": "initial",
581 581 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
582 582 "parents": [],
583 583 "phase": "public",
584 584 "tags": [],
585 585 "user": "test"
586 586 }
587 587 ],
588 588 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
589 589 }
590 590
591 591 shortlog is displayed by default (issue5978)
592 592
593 593 $ request '?style=json'
594 594 200 Script output follows
595 595
596 596 {
597 597 "changeset_count": 10,
598 598 "changesets": [
599 599 {
600 600 "bookmarks": [],
601 601 "branch": "default",
602 602 "date": [
603 603 0.0,
604 604 0
605 605 ],
606 606 "desc": "merge test-branch into default",
607 607 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
608 608 "parents": [
609 609 "ceed296fe500c3fac9541e31dad860cb49c89e45",
610 610 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
611 611 ],
612 612 "phase": "draft",
613 613 "tags": [
614 614 "tip"
615 615 ],
616 616 "user": "test"
617 617 },
618 618 {
619 619 "bookmarks": [],
620 620 "branch": "test-branch",
621 621 "date": [
622 622 0.0,
623 623 0
624 624 ],
625 625 "desc": "another commit in test-branch",
626 626 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
627 627 "parents": [
628 628 "6ab967a8ab3489227a83f80e920faa039a71819f"
629 629 ],
630 630 "phase": "draft",
631 631 "tags": [],
632 632 "user": "test"
633 633 },
634 634 {
635 635 "bookmarks": [],
636 636 "branch": "test-branch",
637 637 "date": [
638 638 0.0,
639 639 0
640 640 ],
641 641 "desc": "create test branch",
642 642 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
643 643 "parents": [
644 644 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
645 645 ],
646 646 "phase": "draft",
647 647 "tags": [],
648 648 "user": "test"
649 649 },
650 650 {
651 651 "bookmarks": [
652 652 "bookmark2"
653 653 ],
654 654 "branch": "default",
655 655 "date": [
656 656 0.0,
657 657 0
658 658 ],
659 659 "desc": "create tag2",
660 660 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
661 661 "parents": [
662 662 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
663 663 ],
664 664 "phase": "draft",
665 665 "tags": [],
666 666 "user": "test"
667 667 },
668 668 {
669 669 "bookmarks": [],
670 670 "branch": "default",
671 671 "date": [
672 672 0.0,
673 673 0
674 674 ],
675 675 "desc": "another commit to da/foo",
676 676 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
677 677 "parents": [
678 678 "93a8ce14f89156426b7fa981af8042da53f03aa0"
679 679 ],
680 680 "phase": "draft",
681 681 "tags": [
682 682 "tag2"
683 683 ],
684 684 "user": "test"
685 685 },
686 686 {
687 687 "bookmarks": [],
688 688 "branch": "default",
689 689 "date": [
690 690 0.0,
691 691 0
692 692 ],
693 693 "desc": "create tag",
694 694 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
695 695 "parents": [
696 696 "78896eb0e102174ce9278438a95e12543e4367a7"
697 697 ],
698 698 "phase": "public",
699 699 "tags": [],
700 700 "user": "test"
701 701 },
702 702 {
703 703 "bookmarks": [],
704 704 "branch": "default",
705 705 "date": [
706 706 0.0,
707 707 0
708 708 ],
709 709 "desc": "move foo",
710 710 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
711 711 "parents": [
712 712 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
713 713 ],
714 714 "phase": "public",
715 715 "tags": [
716 716 "tag1"
717 717 ],
718 718 "user": "test"
719 719 },
720 720 {
721 721 "bookmarks": [
722 722 "bookmark1"
723 723 ],
724 724 "branch": "default",
725 725 "date": [
726 726 0.0,
727 727 0
728 728 ],
729 729 "desc": "modify da/foo",
730 730 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
731 731 "parents": [
732 732 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
733 733 ],
734 734 "phase": "public",
735 735 "tags": [],
736 736 "user": "test"
737 737 },
738 738 {
739 739 "bookmarks": [],
740 740 "branch": "default",
741 741 "date": [
742 742 0.0,
743 743 0
744 744 ],
745 745 "desc": "modify foo",
746 746 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
747 747 "parents": [
748 748 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
749 749 ],
750 750 "phase": "public",
751 751 "tags": [],
752 752 "user": "test"
753 753 },
754 754 {
755 755 "bookmarks": [],
756 756 "branch": "default",
757 757 "date": [
758 758 0.0,
759 759 0
760 760 ],
761 761 "desc": "initial",
762 762 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
763 763 "parents": [],
764 764 "phase": "public",
765 765 "tags": [],
766 766 "user": "test"
767 767 }
768 768 ],
769 769 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
770 770 }
771 771
772 772 changeset/ renders the tip changeset
773 773
774 774 $ request json-rev
775 775 200 Script output follows
776 776
777 777 {
778 778 "bookmarks": [],
779 779 "branch": "default",
780 780 "date": [
781 781 0.0,
782 782 0
783 783 ],
784 784 "desc": "merge test-branch into default",
785 785 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
786 786 "parents": [
787 787 "ceed296fe500c3fac9541e31dad860cb49c89e45",
788 788 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
789 789 ],
790 790 "phase": "draft",
791 791 "tags": [
792 792 "tip"
793 793 ],
794 794 "user": "test"
795 795 }
796 796
797 797 changeset/{revision} shows tags
798 798
799 799 $ request json-rev/78896eb0e102
800 800 200 Script output follows
801 801
802 802 {
803 803 "bookmarks": [],
804 804 "branch": "default",
805 805 "date": [
806 806 0.0,
807 807 0
808 808 ],
809 809 "desc": "move foo",
810 810 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
811 811 "parents": [
812 812 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
813 813 ],
814 814 "phase": "public",
815 815 "tags": [
816 816 "tag1"
817 817 ],
818 818 "user": "test"
819 819 }
820 820
821 821 changeset/{revision} shows bookmarks
822 822
823 823 $ request json-rev/8d7c456572ac
824 824 200 Script output follows
825 825
826 826 {
827 827 "bookmarks": [
828 828 "bookmark1"
829 829 ],
830 830 "branch": "default",
831 831 "date": [
832 832 0.0,
833 833 0
834 834 ],
835 835 "desc": "modify da/foo",
836 836 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
837 837 "parents": [
838 838 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
839 839 ],
840 840 "phase": "public",
841 841 "tags": [],
842 842 "user": "test"
843 843 }
844 844
845 845 changeset/{revision} shows branches
846 846
847 847 $ request json-rev/6ab967a8ab34
848 848 200 Script output follows
849 849
850 850 {
851 851 "bookmarks": [],
852 852 "branch": "test-branch",
853 853 "date": [
854 854 0.0,
855 855 0
856 856 ],
857 857 "desc": "create test branch",
858 858 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
859 859 "parents": [
860 860 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
861 861 ],
862 862 "phase": "draft",
863 863 "tags": [],
864 864 "user": "test"
865 865 }
866 866
867 867 manifest/{revision}/{path} shows info about a directory at a revision
868 868
869 869 $ request json-manifest/06e557f3edf6/
870 870 200 Script output follows
871 871
872 872 {
873 873 "abspath": "/",
874 874 "bookmarks": [],
875 875 "directories": [
876 876 {
877 877 "abspath": "/da",
878 878 "basename": "da",
879 879 "emptydirs": ""
880 880 }
881 881 ],
882 882 "files": [
883 883 {
884 884 "abspath": "foo",
885 885 "basename": "foo",
886 886 "date": [
887 887 0.0,
888 888 0
889 889 ],
890 890 "flags": "",
891 891 "size": 4
892 892 }
893 893 ],
894 894 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
895 895 "tags": []
896 896 }
897 897
898 898 tags/ shows tags info
899 899
900 900 $ request json-tags
901 901 200 Script output follows
902 902
903 903 {
904 904 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
905 905 "tags": [
906 906 {
907 907 "date": [
908 908 0.0,
909 909 0
910 910 ],
911 911 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
912 912 "tag": "tag2"
913 913 },
914 914 {
915 915 "date": [
916 916 0.0,
917 917 0
918 918 ],
919 919 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
920 920 "tag": "tag1"
921 921 }
922 922 ]
923 923 }
924 924
925 925 bookmarks/ shows bookmarks info
926 926
927 927 $ request json-bookmarks
928 928 200 Script output follows
929 929
930 930 {
931 931 "bookmarks": [
932 932 {
933 933 "bookmark": "bookmark2",
934 934 "date": [
935 935 0.0,
936 936 0
937 937 ],
938 938 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
939 939 },
940 940 {
941 941 "bookmark": "bookmark1",
942 942 "date": [
943 943 0.0,
944 944 0
945 945 ],
946 946 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
947 947 }
948 948 ],
949 949 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
950 950 }
951 951
952 952 branches/ shows branches info
953 953
954 954 $ request json-branches
955 955 200 Script output follows
956 956
957 957 {
958 958 "branches": [
959 959 {
960 960 "branch": "default",
961 961 "date": [
962 962 0.0,
963 963 0
964 964 ],
965 965 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
966 966 "status": "open"
967 967 },
968 968 {
969 969 "branch": "test-branch",
970 970 "date": [
971 971 0.0,
972 972 0
973 973 ],
974 974 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
975 975 "status": "inactive"
976 976 }
977 977 ]
978 978 }
979 979
980 980 summary/ shows a summary of repository state
981 981
982 982 $ request json-summary
983 983 200 Script output follows
984 984
985 985 {
986 986 "archives": [
987 987 {
988 988 "extension": ".tar.bz2",
989 989 "node": "tip",
990 990 "type": "bz2",
991 991 "url": "http://*:$HGPORT/archive/tip.tar.bz2" (glob)
992 992 }
993 993 ],
994 994 "bookmarks": [
995 995 {
996 996 "bookmark": "bookmark2",
997 997 "date": [
998 998 0.0,
999 999 0
1000 1000 ],
1001 1001 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
1002 1002 },
1003 1003 {
1004 1004 "bookmark": "bookmark1",
1005 1005 "date": [
1006 1006 0.0,
1007 1007 0
1008 1008 ],
1009 1009 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1010 1010 }
1011 1011 ],
1012 1012 "branches": [
1013 1013 {
1014 1014 "branch": "default",
1015 1015 "date": [
1016 1016 0.0,
1017 1017 0
1018 1018 ],
1019 1019 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1020 1020 "status": "open"
1021 1021 },
1022 1022 {
1023 1023 "branch": "test-branch",
1024 1024 "date": [
1025 1025 0.0,
1026 1026 0
1027 1027 ],
1028 1028 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1029 1029 "status": "inactive"
1030 1030 }
1031 1031 ],
1032 1032 "labels": [],
1033 1033 "lastchange": [
1034 1034 0.0,
1035 1035 0
1036 1036 ],
1037 1037 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1038 1038 "shortlog": [
1039 1039 {
1040 1040 "bookmarks": [],
1041 1041 "branch": "default",
1042 1042 "date": [
1043 1043 0.0,
1044 1044 0
1045 1045 ],
1046 1046 "desc": "merge test-branch into default",
1047 1047 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1048 1048 "parents": [
1049 1049 "ceed296fe500c3fac9541e31dad860cb49c89e45",
1050 1050 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
1051 1051 ],
1052 1052 "phase": "draft",
1053 1053 "tags": [
1054 1054 "tip"
1055 1055 ],
1056 1056 "user": "test"
1057 1057 },
1058 1058 {
1059 1059 "bookmarks": [],
1060 1060 "branch": "test-branch",
1061 1061 "date": [
1062 1062 0.0,
1063 1063 0
1064 1064 ],
1065 1065 "desc": "another commit in test-branch",
1066 1066 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1067 1067 "parents": [
1068 1068 "6ab967a8ab3489227a83f80e920faa039a71819f"
1069 1069 ],
1070 1070 "phase": "draft",
1071 1071 "tags": [],
1072 1072 "user": "test"
1073 1073 },
1074 1074 {
1075 1075 "bookmarks": [],
1076 1076 "branch": "test-branch",
1077 1077 "date": [
1078 1078 0.0,
1079 1079 0
1080 1080 ],
1081 1081 "desc": "create test branch",
1082 1082 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1083 1083 "parents": [
1084 1084 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1085 1085 ],
1086 1086 "phase": "draft",
1087 1087 "tags": [],
1088 1088 "user": "test"
1089 1089 },
1090 1090 {
1091 1091 "bookmarks": [
1092 1092 "bookmark2"
1093 1093 ],
1094 1094 "branch": "default",
1095 1095 "date": [
1096 1096 0.0,
1097 1097 0
1098 1098 ],
1099 1099 "desc": "create tag2",
1100 1100 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1101 1101 "parents": [
1102 1102 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1103 1103 ],
1104 1104 "phase": "draft",
1105 1105 "tags": [],
1106 1106 "user": "test"
1107 1107 },
1108 1108 {
1109 1109 "bookmarks": [],
1110 1110 "branch": "default",
1111 1111 "date": [
1112 1112 0.0,
1113 1113 0
1114 1114 ],
1115 1115 "desc": "another commit to da/foo",
1116 1116 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1117 1117 "parents": [
1118 1118 "93a8ce14f89156426b7fa981af8042da53f03aa0"
1119 1119 ],
1120 1120 "phase": "draft",
1121 1121 "tags": [
1122 1122 "tag2"
1123 1123 ],
1124 1124 "user": "test"
1125 1125 },
1126 1126 {
1127 1127 "bookmarks": [],
1128 1128 "branch": "default",
1129 1129 "date": [
1130 1130 0.0,
1131 1131 0
1132 1132 ],
1133 1133 "desc": "create tag",
1134 1134 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1135 1135 "parents": [
1136 1136 "78896eb0e102174ce9278438a95e12543e4367a7"
1137 1137 ],
1138 1138 "phase": "public",
1139 1139 "tags": [],
1140 1140 "user": "test"
1141 1141 },
1142 1142 {
1143 1143 "bookmarks": [],
1144 1144 "branch": "default",
1145 1145 "date": [
1146 1146 0.0,
1147 1147 0
1148 1148 ],
1149 1149 "desc": "move foo",
1150 1150 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1151 1151 "parents": [
1152 1152 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1153 1153 ],
1154 1154 "phase": "public",
1155 1155 "tags": [
1156 1156 "tag1"
1157 1157 ],
1158 1158 "user": "test"
1159 1159 },
1160 1160 {
1161 1161 "bookmarks": [
1162 1162 "bookmark1"
1163 1163 ],
1164 1164 "branch": "default",
1165 1165 "date": [
1166 1166 0.0,
1167 1167 0
1168 1168 ],
1169 1169 "desc": "modify da/foo",
1170 1170 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1171 1171 "parents": [
1172 1172 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1173 1173 ],
1174 1174 "phase": "public",
1175 1175 "tags": [],
1176 1176 "user": "test"
1177 1177 },
1178 1178 {
1179 1179 "bookmarks": [],
1180 1180 "branch": "default",
1181 1181 "date": [
1182 1182 0.0,
1183 1183 0
1184 1184 ],
1185 1185 "desc": "modify foo",
1186 1186 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1187 1187 "parents": [
1188 1188 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1189 1189 ],
1190 1190 "phase": "public",
1191 1191 "tags": [],
1192 1192 "user": "test"
1193 1193 },
1194 1194 {
1195 1195 "bookmarks": [],
1196 1196 "branch": "default",
1197 1197 "date": [
1198 1198 0.0,
1199 1199 0
1200 1200 ],
1201 1201 "desc": "initial",
1202 1202 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1203 1203 "parents": [],
1204 1204 "phase": "public",
1205 1205 "tags": [],
1206 1206 "user": "test"
1207 1207 }
1208 1208 ],
1209 1209 "tags": [
1210 1210 {
1211 1211 "date": [
1212 1212 0.0,
1213 1213 0
1214 1214 ],
1215 1215 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1216 1216 "tag": "tag2"
1217 1217 },
1218 1218 {
1219 1219 "date": [
1220 1220 0.0,
1221 1221 0
1222 1222 ],
1223 1223 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1224 1224 "tag": "tag1"
1225 1225 }
1226 1226 ]
1227 1227 }
1228 1228
1229 1229 $ request json-changelog?rev=create
1230 1230 200 Script output follows
1231 1231
1232 1232 {
1233 1233 "entries": [
1234 1234 {
1235 1235 "bookmarks": [],
1236 1236 "branch": "test-branch",
1237 1237 "date": [
1238 1238 0.0,
1239 1239 0
1240 1240 ],
1241 1241 "desc": "create test branch",
1242 1242 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1243 1243 "parents": [
1244 1244 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1245 1245 ],
1246 1246 "phase": "draft",
1247 1247 "tags": [],
1248 1248 "user": "test"
1249 1249 },
1250 1250 {
1251 1251 "bookmarks": [
1252 1252 "bookmark2"
1253 1253 ],
1254 1254 "branch": "default",
1255 1255 "date": [
1256 1256 0.0,
1257 1257 0
1258 1258 ],
1259 1259 "desc": "create tag2",
1260 1260 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1261 1261 "parents": [
1262 1262 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1263 1263 ],
1264 1264 "phase": "draft",
1265 1265 "tags": [],
1266 1266 "user": "test"
1267 1267 },
1268 1268 {
1269 1269 "bookmarks": [],
1270 1270 "branch": "default",
1271 1271 "date": [
1272 1272 0.0,
1273 1273 0
1274 1274 ],
1275 1275 "desc": "create tag",
1276 1276 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1277 1277 "parents": [
1278 1278 "78896eb0e102174ce9278438a95e12543e4367a7"
1279 1279 ],
1280 1280 "phase": "public",
1281 1281 "tags": [],
1282 1282 "user": "test"
1283 1283 }
1284 1284 ],
1285 1285 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1286 1286 "query": "create"
1287 1287 }
1288 1288
1289 1289 filediff/{revision}/{path} shows changes to a file in a revision
1290 1290
1291 1291 $ request json-diff/f8bbb9024b10/foo
1292 1292 200 Script output follows
1293 1293
1294 1294 {
1295 1295 "author": "test",
1296 1296 "children": [],
1297 1297 "date": [
1298 1298 0.0,
1299 1299 0
1300 1300 ],
1301 1301 "desc": "modify foo",
1302 1302 "diff": [
1303 1303 {
1304 1304 "blockno": 1,
1305 1305 "lines": [
1306 1306 {
1307 1307 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1308 1308 "n": 1,
1309 1309 "t": "-"
1310 1310 },
1311 1311 {
1312 1312 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1313 1313 "n": 2,
1314 1314 "t": "+"
1315 1315 },
1316 1316 {
1317 1317 "l": "@@ -1,1 +1,1 @@\n",
1318 1318 "n": 3,
1319 1319 "t": "@"
1320 1320 },
1321 1321 {
1322 1322 "l": "-foo\n",
1323 1323 "n": 4,
1324 1324 "t": "-"
1325 1325 },
1326 1326 {
1327 1327 "l": "+bar\n",
1328 1328 "n": 5,
1329 1329 "t": "+"
1330 1330 }
1331 1331 ]
1332 1332 }
1333 1333 ],
1334 1334 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1335 1335 "parents": [
1336 1336 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1337 1337 ],
1338 1338 "path": "foo"
1339 1339 }
1340 1340
1341 1341 comparison/{revision}/{path} shows information about before and after for a file
1342 1342
1343 1343 $ request json-comparison/f8bbb9024b10/foo
1344 1344 200 Script output follows
1345 1345
1346 1346 {
1347 1347 "author": "test",
1348 1348 "children": [],
1349 1349 "comparison": [
1350 1350 {
1351 1351 "lines": [
1352 1352 {
1353 1353 "ll": "foo",
1354 1354 "ln": 1,
1355 1355 "rl": "bar",
1356 1356 "rn": 1,
1357 1357 "t": "replace"
1358 1358 }
1359 1359 ]
1360 1360 }
1361 1361 ],
1362 1362 "date": [
1363 1363 0.0,
1364 1364 0
1365 1365 ],
1366 1366 "desc": "modify foo",
1367 1367 "leftnode": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1368 1368 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1369 1369 "parents": [
1370 1370 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1371 1371 ],
1372 1372 "path": "foo",
1373 1373 "rightnode": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1374 1374 }
1375 1375
1376 1376 annotate/{revision}/{path} shows annotations for each line
1377 1377
1378 1378 $ request json-annotate/f8bbb9024b10/foo
1379 1379 200 Script output follows
1380 1380
1381 1381 {
1382 1382 "abspath": "foo",
1383 1383 "annotate": [
1384 1384 {
1385 1385 "abspath": "foo",
1386 1386 "author": "test",
1387 1387 "desc": "modify foo",
1388 1388 "line": "bar\n",
1389 1389 "lineno": 1,
1390 1390 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1391 1391 "revdate": [
1392 1392 0.0,
1393 1393 0
1394 1394 ],
1395 1395 "targetline": 1
1396 1396 }
1397 1397 ],
1398 1398 "author": "test",
1399 1399 "children": [],
1400 1400 "date": [
1401 1401 0.0,
1402 1402 0
1403 1403 ],
1404 1404 "desc": "modify foo",
1405 1405 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1406 1406 "parents": [
1407 1407 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1408 1408 ],
1409 1409 "permissions": ""
1410 1410 }
1411 1411
1412 1412 filelog/{revision}/{path} shows history of a single file
1413 1413
1414 1414 $ request json-filelog/f8bbb9024b10/foo
1415 1415 200 Script output follows
1416 1416
1417 1417 {
1418 1418 "entries": [
1419 1419 {
1420 1420 "bookmarks": [],
1421 1421 "branch": "default",
1422 1422 "date": [
1423 1423 0.0,
1424 1424 0
1425 1425 ],
1426 1426 "desc": "modify foo",
1427 1427 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1428 1428 "parents": [
1429 1429 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1430 1430 ],
1431 1431 "phase": "public",
1432 1432 "tags": [],
1433 1433 "user": "test"
1434 1434 },
1435 1435 {
1436 1436 "bookmarks": [],
1437 1437 "branch": "default",
1438 1438 "date": [
1439 1439 0.0,
1440 1440 0
1441 1441 ],
1442 1442 "desc": "initial",
1443 1443 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1444 1444 "parents": [],
1445 1445 "phase": "public",
1446 1446 "tags": [],
1447 1447 "user": "test"
1448 1448 }
1449 1449 ]
1450 1450 }
1451 1451
1452 1452 $ request json-filelog/cc725e08502a/da/foo
1453 1453 200 Script output follows
1454 1454
1455 1455 {
1456 1456 "entries": [
1457 1457 {
1458 1458 "bookmarks": [],
1459 1459 "branch": "default",
1460 1460 "date": [
1461 1461 0.0,
1462 1462 0
1463 1463 ],
1464 1464 "desc": "another commit to da/foo",
1465 1465 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1466 1466 "parents": [
1467 1467 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1468 1468 ],
1469 1469 "phase": "draft",
1470 1470 "tags": [
1471 1471 "tag2"
1472 1472 ],
1473 1473 "user": "test"
1474 1474 },
1475 1475 {
1476 1476 "bookmarks": [
1477 1477 "bookmark1"
1478 1478 ],
1479 1479 "branch": "default",
1480 1480 "date": [
1481 1481 0.0,
1482 1482 0
1483 1483 ],
1484 1484 "desc": "modify da/foo",
1485 1485 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1486 1486 "parents": [
1487 1487 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1488 1488 ],
1489 1489 "phase": "public",
1490 1490 "tags": [],
1491 1491 "user": "test"
1492 1492 },
1493 1493 {
1494 1494 "bookmarks": [],
1495 1495 "branch": "default",
1496 1496 "date": [
1497 1497 0.0,
1498 1498 0
1499 1499 ],
1500 1500 "desc": "initial",
1501 1501 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1502 1502 "parents": [],
1503 1503 "phase": "public",
1504 1504 "tags": [],
1505 1505 "user": "test"
1506 1506 }
1507 1507 ]
1508 1508 }
1509 1509
1510 1510 (archive/ doesn't use templating, so ignore it)
1511 1511
1512 1512 (static/ doesn't use templating, so ignore it)
1513 1513
1514 1514 graph/ shows information that can be used to render a graph of the DAG
1515 1515
1516 1516 $ request json-graph
1517 1517 200 Script output follows
1518 1518
1519 1519 {
1520 1520 "changeset_count": 10,
1521 1521 "changesets": [
1522 1522 {
1523 1523 "bookmarks": [],
1524 1524 "branch": "default",
1525 1525 "col": 0,
1526 1526 "color": 1,
1527 1527 "date": [
1528 1528 0.0,
1529 1529 0
1530 1530 ],
1531 1531 "desc": "merge test-branch into default",
1532 1532 "edges": [
1533 1533 {
1534 1534 "bcolor": "",
1535 1535 "col": 0,
1536 1536 "color": 1,
1537 1537 "nextcol": 0,
1538 1538 "width": -1
1539 1539 },
1540 1540 {
1541 1541 "bcolor": "",
1542 1542 "col": 0,
1543 1543 "color": 1,
1544 1544 "nextcol": 1,
1545 1545 "width": -1
1546 1546 }
1547 1547 ],
1548 1548 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1549 1549 "parents": [
1550 1550 "ceed296fe500c3fac9541e31dad860cb49c89e45",
1551 1551 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
1552 1552 ],
1553 1553 "phase": "draft",
1554 1554 "row": 0,
1555 1555 "tags": [
1556 1556 "tip"
1557 1557 ],
1558 1558 "user": "test"
1559 1559 },
1560 1560 {
1561 1561 "bookmarks": [],
1562 1562 "branch": "test-branch",
1563 1563 "col": 1,
1564 1564 "color": 2,
1565 1565 "date": [
1566 1566 0.0,
1567 1567 0
1568 1568 ],
1569 1569 "desc": "another commit in test-branch",
1570 1570 "edges": [
1571 1571 {
1572 1572 "bcolor": "",
1573 1573 "col": 0,
1574 1574 "color": 1,
1575 1575 "nextcol": 0,
1576 1576 "width": -1
1577 1577 },
1578 1578 {
1579 1579 "bcolor": "",
1580 1580 "col": 1,
1581 1581 "color": 2,
1582 1582 "nextcol": 1,
1583 1583 "width": -1
1584 1584 }
1585 1585 ],
1586 1586 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1587 1587 "parents": [
1588 1588 "6ab967a8ab3489227a83f80e920faa039a71819f"
1589 1589 ],
1590 1590 "phase": "draft",
1591 1591 "row": 1,
1592 1592 "tags": [],
1593 1593 "user": "test"
1594 1594 },
1595 1595 {
1596 1596 "bookmarks": [],
1597 1597 "branch": "test-branch",
1598 1598 "col": 1,
1599 1599 "color": 2,
1600 1600 "date": [
1601 1601 0.0,
1602 1602 0
1603 1603 ],
1604 1604 "desc": "create test branch",
1605 1605 "edges": [
1606 1606 {
1607 1607 "bcolor": "",
1608 1608 "col": 0,
1609 1609 "color": 1,
1610 1610 "nextcol": 0,
1611 1611 "width": -1
1612 1612 },
1613 1613 {
1614 1614 "bcolor": "",
1615 1615 "col": 1,
1616 1616 "color": 2,
1617 1617 "nextcol": 1,
1618 1618 "width": -1
1619 1619 }
1620 1620 ],
1621 1621 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1622 1622 "parents": [
1623 1623 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1624 1624 ],
1625 1625 "phase": "draft",
1626 1626 "row": 2,
1627 1627 "tags": [],
1628 1628 "user": "test"
1629 1629 },
1630 1630 {
1631 1631 "bookmarks": [
1632 1632 "bookmark2"
1633 1633 ],
1634 1634 "branch": "default",
1635 1635 "col": 0,
1636 1636 "color": 1,
1637 1637 "date": [
1638 1638 0.0,
1639 1639 0
1640 1640 ],
1641 1641 "desc": "create tag2",
1642 1642 "edges": [
1643 1643 {
1644 1644 "bcolor": "",
1645 1645 "col": 0,
1646 1646 "color": 1,
1647 1647 "nextcol": 0,
1648 1648 "width": -1
1649 1649 },
1650 1650 {
1651 1651 "bcolor": "",
1652 1652 "col": 1,
1653 1653 "color": 2,
1654 1654 "nextcol": 1,
1655 1655 "width": -1
1656 1656 }
1657 1657 ],
1658 1658 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1659 1659 "parents": [
1660 1660 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1661 1661 ],
1662 1662 "phase": "draft",
1663 1663 "row": 3,
1664 1664 "tags": [],
1665 1665 "user": "test"
1666 1666 },
1667 1667 {
1668 1668 "bookmarks": [],
1669 1669 "branch": "default",
1670 1670 "col": 0,
1671 1671 "color": 1,
1672 1672 "date": [
1673 1673 0.0,
1674 1674 0
1675 1675 ],
1676 1676 "desc": "another commit to da/foo",
1677 1677 "edges": [
1678 1678 {
1679 1679 "bcolor": "",
1680 1680 "col": 0,
1681 1681 "color": 1,
1682 1682 "nextcol": 0,
1683 1683 "width": -1
1684 1684 },
1685 1685 {
1686 1686 "bcolor": "",
1687 1687 "col": 1,
1688 1688 "color": 2,
1689 1689 "nextcol": 1,
1690 1690 "width": -1
1691 1691 }
1692 1692 ],
1693 1693 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1694 1694 "parents": [
1695 1695 "93a8ce14f89156426b7fa981af8042da53f03aa0"
1696 1696 ],
1697 1697 "phase": "draft",
1698 1698 "row": 4,
1699 1699 "tags": [
1700 1700 "tag2"
1701 1701 ],
1702 1702 "user": "test"
1703 1703 },
1704 1704 {
1705 1705 "bookmarks": [],
1706 1706 "branch": "default",
1707 1707 "col": 0,
1708 1708 "color": 1,
1709 1709 "date": [
1710 1710 0.0,
1711 1711 0
1712 1712 ],
1713 1713 "desc": "create tag",
1714 1714 "edges": [
1715 1715 {
1716 1716 "bcolor": "",
1717 1717 "col": 0,
1718 1718 "color": 1,
1719 1719 "nextcol": 0,
1720 1720 "width": -1
1721 1721 },
1722 1722 {
1723 1723 "bcolor": "",
1724 1724 "col": 1,
1725 1725 "color": 2,
1726 1726 "nextcol": 1,
1727 1727 "width": -1
1728 1728 }
1729 1729 ],
1730 1730 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1731 1731 "parents": [
1732 1732 "78896eb0e102174ce9278438a95e12543e4367a7"
1733 1733 ],
1734 1734 "phase": "public",
1735 1735 "row": 5,
1736 1736 "tags": [],
1737 1737 "user": "test"
1738 1738 },
1739 1739 {
1740 1740 "bookmarks": [],
1741 1741 "branch": "default",
1742 1742 "col": 0,
1743 1743 "color": 1,
1744 1744 "date": [
1745 1745 0.0,
1746 1746 0
1747 1747 ],
1748 1748 "desc": "move foo",
1749 1749 "edges": [
1750 1750 {
1751 1751 "bcolor": "",
1752 1752 "col": 0,
1753 1753 "color": 1,
1754 1754 "nextcol": 0,
1755 1755 "width": -1
1756 1756 },
1757 1757 {
1758 1758 "bcolor": "",
1759 1759 "col": 1,
1760 1760 "color": 2,
1761 1761 "nextcol": 1,
1762 1762 "width": -1
1763 1763 }
1764 1764 ],
1765 1765 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1766 1766 "parents": [
1767 1767 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1768 1768 ],
1769 1769 "phase": "public",
1770 1770 "row": 6,
1771 1771 "tags": [
1772 1772 "tag1"
1773 1773 ],
1774 1774 "user": "test"
1775 1775 },
1776 1776 {
1777 1777 "bookmarks": [
1778 1778 "bookmark1"
1779 1779 ],
1780 1780 "branch": "default",
1781 1781 "col": 0,
1782 1782 "color": 1,
1783 1783 "date": [
1784 1784 0.0,
1785 1785 0
1786 1786 ],
1787 1787 "desc": "modify da/foo",
1788 1788 "edges": [
1789 1789 {
1790 1790 "bcolor": "",
1791 1791 "col": 0,
1792 1792 "color": 1,
1793 1793 "nextcol": 0,
1794 1794 "width": -1
1795 1795 },
1796 1796 {
1797 1797 "bcolor": "",
1798 1798 "col": 1,
1799 1799 "color": 2,
1800 1800 "nextcol": 1,
1801 1801 "width": -1
1802 1802 }
1803 1803 ],
1804 1804 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1805 1805 "parents": [
1806 1806 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1807 1807 ],
1808 1808 "phase": "public",
1809 1809 "row": 7,
1810 1810 "tags": [],
1811 1811 "user": "test"
1812 1812 },
1813 1813 {
1814 1814 "bookmarks": [],
1815 1815 "branch": "default",
1816 1816 "col": 0,
1817 1817 "color": 1,
1818 1818 "date": [
1819 1819 0.0,
1820 1820 0
1821 1821 ],
1822 1822 "desc": "modify foo",
1823 1823 "edges": [
1824 1824 {
1825 1825 "bcolor": "",
1826 1826 "col": 0,
1827 1827 "color": 1,
1828 1828 "nextcol": 0,
1829 1829 "width": -1
1830 1830 },
1831 1831 {
1832 1832 "bcolor": "",
1833 1833 "col": 1,
1834 1834 "color": 2,
1835 1835 "nextcol": 0,
1836 1836 "width": -1
1837 1837 }
1838 1838 ],
1839 1839 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1840 1840 "parents": [
1841 1841 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1842 1842 ],
1843 1843 "phase": "public",
1844 1844 "row": 8,
1845 1845 "tags": [],
1846 1846 "user": "test"
1847 1847 },
1848 1848 {
1849 1849 "bookmarks": [],
1850 1850 "branch": "default",
1851 1851 "col": 0,
1852 1852 "color": 2,
1853 1853 "date": [
1854 1854 0.0,
1855 1855 0
1856 1856 ],
1857 1857 "desc": "initial",
1858 1858 "edges": [],
1859 1859 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1860 1860 "parents": [],
1861 1861 "phase": "public",
1862 1862 "row": 9,
1863 1863 "tags": [],
1864 1864 "user": "test"
1865 1865 }
1866 1866 ],
1867 1867 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
1868 1868 }
1869 1869
1870 1870 help/ shows help topics
1871 1871
1872 1872 $ request json-help
1873 1873 200 Script output follows
1874 1874
1875 1875 {
1876 1876 "earlycommands": [
1877 1877 {
1878 1878 "summary": "add the specified files on the next commit",
1879 1879 "topic": "add"
1880 1880 },
1881 1881 {
1882 1882 "summary": "show changeset information by line for each file",
1883 1883 "topic": "annotate"
1884 1884 },
1885 1885 {
1886 1886 "summary": "make a copy of an existing repository",
1887 1887 "topic": "clone"
1888 1888 },
1889 1889 {
1890 1890 "summary": "commit the specified files or all outstanding changes",
1891 1891 "topic": "commit"
1892 1892 },
1893 1893 {
1894 1894 "summary": "diff repository (or selected files)",
1895 1895 "topic": "diff"
1896 1896 },
1897 1897 {
1898 1898 "summary": "dump the header and diffs for one or more changesets",
1899 1899 "topic": "export"
1900 1900 },
1901 1901 {
1902 1902 "summary": "forget the specified files on the next commit",
1903 1903 "topic": "forget"
1904 1904 },
1905 1905 {
1906 1906 "summary": "create a new repository in the given directory",
1907 1907 "topic": "init"
1908 1908 },
1909 1909 {
1910 1910 "summary": "show revision history of entire repository or files",
1911 1911 "topic": "log"
1912 1912 },
1913 1913 {
1914 1914 "summary": "merge another revision into working directory",
1915 1915 "topic": "merge"
1916 1916 },
1917 1917 {
1918 1918 "summary": "pull changes from the specified source",
1919 1919 "topic": "pull"
1920 1920 },
1921 1921 {
1922 1922 "summary": "push changes to the specified destination",
1923 1923 "topic": "push"
1924 1924 },
1925 1925 {
1926 1926 "summary": "remove the specified files on the next commit",
1927 1927 "topic": "remove"
1928 1928 },
1929 1929 {
1930 1930 "summary": "start stand-alone webserver",
1931 1931 "topic": "serve"
1932 1932 },
1933 1933 {
1934 1934 "summary": "show changed files in the working directory",
1935 1935 "topic": "status"
1936 1936 },
1937 1937 {
1938 1938 "summary": "summarize working directory state",
1939 1939 "topic": "summary"
1940 1940 },
1941 1941 {
1942 1942 "summary": "update working directory (or switch revisions)",
1943 1943 "topic": "update"
1944 1944 }
1945 1945 ],
1946 1946 "othercommands": [
1947 1947 {
1948 1948 "summary": "add all new files, delete all missing files",
1949 1949 "topic": "addremove"
1950 1950 },
1951 1951 {
1952 1952 "summary": "create an unversioned archive of a repository revision",
1953 1953 "topic": "archive"
1954 1954 },
1955 1955 {
1956 1956 "summary": "reverse effect of earlier changeset",
1957 1957 "topic": "backout"
1958 1958 },
1959 1959 {
1960 1960 "summary": "subdivision search of changesets",
1961 1961 "topic": "bisect"
1962 1962 },
1963 1963 {
1964 1964 "summary": "create a new bookmark or list existing bookmarks",
1965 1965 "topic": "bookmarks"
1966 1966 },
1967 1967 {
1968 1968 "summary": "set or show the current branch name",
1969 1969 "topic": "branch"
1970 1970 },
1971 1971 {
1972 1972 "summary": "list repository named branches",
1973 1973 "topic": "branches"
1974 1974 },
1975 1975 {
1976 1976 "summary": "create a bundle file",
1977 1977 "topic": "bundle"
1978 1978 },
1979 1979 {
1980 1980 "summary": "output the current or given revision of files",
1981 1981 "topic": "cat"
1982 1982 },
1983 1983 {
1984 1984 "summary": "show combined config settings from all hgrc files",
1985 1985 "topic": "config"
1986 1986 },
1987 1987 {
1988 1988 "summary": "mark files as copied for the next commit",
1989 1989 "topic": "copy"
1990 1990 },
1991 1991 {
1992 1992 "summary": "list tracked files",
1993 1993 "topic": "files"
1994 1994 },
1995 1995 {
1996 1996 "summary": "copy changes from other branches onto the current branch",
1997 1997 "topic": "graft"
1998 1998 },
1999 1999 {
2000 2000 "summary": "search revision history for a pattern in specified files",
2001 2001 "topic": "grep"
2002 2002 },
2003 2003 {
2004 2004 "summary": "show branch heads",
2005 2005 "topic": "heads"
2006 2006 },
2007 2007 {
2008 2008 "summary": "show help for a given topic or a help overview",
2009 2009 "topic": "help"
2010 2010 },
2011 2011 {
2012 2012 "summary": "identify the working directory or specified revision",
2013 2013 "topic": "identify"
2014 2014 },
2015 2015 {
2016 2016 "summary": "import an ordered set of patches",
2017 2017 "topic": "import"
2018 2018 },
2019 2019 {
2020 2020 "summary": "show new changesets found in source",
2021 2021 "topic": "incoming"
2022 2022 },
2023 2023 {
2024 2024 "summary": "output the current or given revision of the project manifest",
2025 2025 "topic": "manifest"
2026 2026 },
2027 2027 {
2028 2028 "summary": "show changesets not found in the destination",
2029 2029 "topic": "outgoing"
2030 2030 },
2031 2031 {
2032 2032 "summary": "show aliases for remote repositories",
2033 2033 "topic": "paths"
2034 2034 },
2035 2035 {
2036 2036 "summary": "set or show the current phase name",
2037 2037 "topic": "phase"
2038 2038 },
2039 2039 {
2040 2040 "summary": "roll back an interrupted transaction",
2041 2041 "topic": "recover"
2042 2042 },
2043 2043 {
2044 2044 "summary": "rename files; equivalent of copy + remove",
2045 2045 "topic": "rename"
2046 2046 },
2047 2047 {
2048 2048 "summary": "redo merges or set/view the merge status of files",
2049 2049 "topic": "resolve"
2050 2050 },
2051 2051 {
2052 2052 "summary": "restore files to their checkout state",
2053 2053 "topic": "revert"
2054 2054 },
2055 2055 {
2056 2056 "summary": "print the root (top) of the current working directory",
2057 2057 "topic": "root"
2058 2058 },
2059 2059 {
2060 2060 "summary": "add one or more tags for the current or given revision",
2061 2061 "topic": "tag"
2062 2062 },
2063 2063 {
2064 2064 "summary": "list repository tags",
2065 2065 "topic": "tags"
2066 2066 },
2067 2067 {
2068 2068 "summary": "apply one or more bundle files",
2069 2069 "topic": "unbundle"
2070 2070 },
2071 2071 {
2072 2072 "summary": "verify the integrity of the repository",
2073 2073 "topic": "verify"
2074 2074 },
2075 2075 {
2076 2076 "summary": "output version and copyright information",
2077 2077 "topic": "version"
2078 2078 }
2079 2079 ],
2080 2080 "topics": [
2081 2081 {
2082 2082 "summary": "Bundle File Formats",
2083 2083 "topic": "bundlespec"
2084 2084 },
2085 2085 {
2086 2086 "summary": "Colorizing Outputs",
2087 2087 "topic": "color"
2088 2088 },
2089 2089 {
2090 2090 "summary": "Configuration Files",
2091 2091 "topic": "config"
2092 2092 },
2093 2093 {
2094 2094 "summary": "Date Formats",
2095 2095 "topic": "dates"
2096 2096 },
2097 2097 {
2098 2098 "summary": "Deprecated Features",
2099 2099 "topic": "deprecated"
2100 2100 },
2101 2101 {
2102 2102 "summary": "Diff Formats",
2103 2103 "topic": "diffs"
2104 2104 },
2105 2105 {
2106 2106 "summary": "Environment Variables",
2107 2107 "topic": "environment"
2108 2108 },
2109 2109 {
2110 2110 "summary": "Using Additional Features",
2111 2111 "topic": "extensions"
2112 2112 },
2113 2113 {
2114 2114 "summary": "Specifying File Sets",
2115 2115 "topic": "filesets"
2116 2116 },
2117 2117 {
2118 2118 "summary": "Command-line flags",
2119 2119 "topic": "flags"
2120 2120 },
2121 2121 {
2122 2122 "summary": "Glossary",
2123 2123 "topic": "glossary"
2124 2124 },
2125 2125 {
2126 2126 "summary": "Syntax for Mercurial Ignore Files",
2127 2127 "topic": "hgignore"
2128 2128 },
2129 2129 {
2130 2130 "summary": "Configuring hgweb",
2131 2131 "topic": "hgweb"
2132 2132 },
2133 2133 {
2134 2134 "summary": "Technical implementation topics",
2135 2135 "topic": "internals"
2136 2136 },
2137 2137 {
2138 2138 "summary": "Merge Tools",
2139 2139 "topic": "merge-tools"
2140 2140 },
2141 2141 {
2142 2142 "summary": "Pager Support",
2143 2143 "topic": "pager"
2144 2144 },
2145 2145 {
2146 2146 "summary": "File Name Patterns",
2147 2147 "topic": "patterns"
2148 2148 },
2149 2149 {
2150 2150 "summary": "Working with Phases",
2151 2151 "topic": "phases"
2152 2152 },
2153 2153 {
2154 2154 "summary": "Specifying Revisions",
2155 2155 "topic": "revisions"
2156 2156 },
2157 2157 {
2158 2158 "summary": "Using Mercurial from scripts and automation",
2159 2159 "topic": "scripting"
2160 2160 },
2161 2161 {
2162 2162 "summary": "Subrepositories",
2163 2163 "topic": "subrepos"
2164 2164 },
2165 2165 {
2166 2166 "summary": "Template Usage",
2167 2167 "topic": "templating"
2168 2168 },
2169 2169 {
2170 2170 "summary": "URL Paths",
2171 2171 "topic": "urls"
2172 2172 }
2173 2173 ]
2174 2174 }
2175 2175
2176 2176 help/{topic} shows an individual help topic
2177 2177
2178 2178 $ request json-help/phases
2179 2179 200 Script output follows
2180 2180
2181 2181 {
2182 2182 "rawdoc": "Working with Phases\n*", (glob)
2183 2183 "topic": "phases"
2184 2184 }
2185 2185
2186 2186 Error page shouldn't crash
2187 2187
2188 2188 $ request json-changeset/deadbeef
2189 2189 404 Not Found
2190 2190
2191 2191 {
2192 2192 "error": "unknown revision 'deadbeef'"
2193 2193 }
2194 2194 [1]
2195 2195
2196 2196 Commit message with Japanese Kanji 'Noh', which ends with '\x5c'
2197 2197
2198 2198 $ echo foo >> da/foo
2199 2199 $ HGENCODING=cp932 hg ci -m `"$PYTHON" -c 'print("\x94\x5c")'`
2200 2200
2201 2201 Commit message with null character
2202 2202
2203 2203 $ echo foo >> da/foo
2204 >>> open('msg', 'wb').write('commit with null character: \0\n')
2204 >>> open('msg', 'wb').write('commit with null character: \0\n') and None
2205 2205 $ hg ci -l msg
2206 2206 $ rm msg
2207 2207
2208 2208 Stop and restart with HGENCODING=cp932
2209 2209
2210 2210 $ killdaemons.py
2211 2211 $ HGENCODING=cp932 hg serve -p $HGPORT -d --pid-file=hg.pid \
2212 2212 > -A access.log -E error.log
2213 2213 $ cat hg.pid >> $DAEMON_PIDS
2214 2214
2215 2215 Test json escape of multibyte characters
2216 2216
2217 2217 $ request json-filelog/tip/da/foo?revcount=2 | grep '"desc":'
2218 2218 "desc": "commit with null character: \u0000",
2219 2219 "desc": "\u80fd",
@@ -1,1480 +1,1480 b''
1 1 #require no-reposimplestore
2 2
3 3 Run kwdemo outside a repo
4 4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
5 5 [extensions]
6 6 keyword =
7 7 [keyword]
8 8 demo.txt =
9 9 [keywordset]
10 10 svn = False
11 11 [keywordmaps]
12 12 Foo = {author|user}
13 13 $Foo: test $
14 14
15 15 $ cat <<EOF >> $HGRCPATH
16 16 > [extensions]
17 17 > keyword =
18 18 > mq =
19 19 > notify =
20 20 > record =
21 21 > transplant =
22 22 > [ui]
23 23 > interactive = true
24 24 > EOF
25 25
26 26 hide outer repo
27 27 $ hg init
28 28
29 29 Run kwdemo before [keyword] files are set up
30 30 as it would succeed without uisetup otherwise
31 31
32 32 $ hg --quiet kwdemo
33 33 [extensions]
34 34 keyword =
35 35 [keyword]
36 36 demo.txt =
37 37 [keywordset]
38 38 svn = False
39 39 [keywordmaps]
40 40 Author = {author|user}
41 41 Date = {date|utcdate}
42 42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
43 43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
44 44 RCSFile = {file|basename},v
45 45 RCSfile = {file|basename},v
46 46 Revision = {node|short}
47 47 Source = {root}/{file},v
48 48 $Author: test $
49 49 $Date: ????/??/?? ??:??:?? $ (glob)
50 50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
52 52 $RCSFile: demo.txt,v $
53 53 $RCSfile: demo.txt,v $
54 54 $Revision: ???????????? $ (glob)
55 55 $Source: */demo.txt,v $ (glob)
56 56
57 57 $ hg --quiet kwdemo "Branch = {branches}"
58 58 [extensions]
59 59 keyword =
60 60 [keyword]
61 61 demo.txt =
62 62 [keywordset]
63 63 svn = False
64 64 [keywordmaps]
65 65 Branch = {branches}
66 66 $Branch: demobranch $
67 67
68 68 (test template filter svnisodate and svnutcdate)
69 69
70 70 $ hg --quiet kwdemo --config keywordset.svn=True
71 71 [extensions]
72 72 keyword =
73 73 [keyword]
74 74 demo.txt =
75 75 [keywordset]
76 76 svn = True
77 77 [keywordmaps]
78 78 Author = {author|user}
79 79 Date = {date|svnisodate}
80 80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
81 81 LastChangedBy = {author|user}
82 82 LastChangedDate = {date|svnisodate}
83 83 LastChangedRevision = {node|short}
84 84 Revision = {node|short}
85 85 $Author: test $
86 86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
87 87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
88 88 $LastChangedBy: test $
89 89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
90 90 $LastChangedRevision: ???????????? $ (glob)
91 91 $Revision: ???????????? $ (glob)
92 92
93 93 $ cat <<EOF >> $HGRCPATH
94 94 > [keyword]
95 95 > ** =
96 96 > b = ignore
97 97 > i = ignore
98 98 > [hooks]
99 99 > EOF
100 100 $ cp $HGRCPATH $HGRCPATH.nohooks
101 101 > cat <<EOF >> $HGRCPATH
102 102 > commit=
103 103 > commit.test=cp a hooktest
104 104 > EOF
105 105
106 106 $ hg init Test-bndl
107 107 $ cd Test-bndl
108 108
109 109 kwshrink should exit silently in empty/invalid repo
110 110
111 111 $ hg kwshrink
112 112
113 113 Symlinks cannot be created on Windows.
114 114 A bundle to test this was made with:
115 115 hg init t
116 116 cd t
117 117 echo a > a
118 118 ln -s a sym
119 119 hg add sym
120 120 hg ci -m addsym -u mercurial
121 121 hg bundle --base null ../test-keyword.hg
122 122
123 123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
124 124 adding changesets
125 125 adding manifests
126 126 adding file changes
127 127 added 1 changesets with 1 changes to 1 files
128 128 new changesets a2392c293916 (1 drafts)
129 129 (run 'hg update' to get a working copy)
130 130 $ hg up a2392c293916
131 131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 132
133 133 $ echo 'expand $Id$' > a
134 134 $ echo 'do not process $Id:' >> a
135 135 $ echo 'xxx $' >> a
136 136 $ echo 'ignore $Id$' > b
137 137
138 138 Output files as they were created
139 139
140 140 $ cat a b
141 141 expand $Id$
142 142 do not process $Id:
143 143 xxx $
144 144 ignore $Id$
145 145
146 146 no kwfiles
147 147
148 148 $ hg kwfiles
149 149
150 150 untracked candidates
151 151
152 152 $ hg -v kwfiles --unknown
153 153 k a
154 154
155 155 Add files and check status
156 156
157 157 $ hg addremove
158 158 adding a
159 159 adding b
160 160 $ hg status
161 161 A a
162 162 A b
163 163
164 164
165 165 Default keyword expansion including commit hook
166 166 Interrupted commit should not change state or run commit hook
167 167
168 168 $ hg --debug commit
169 169 abort: empty commit message
170 170 [255]
171 171 $ hg status
172 172 A a
173 173 A b
174 174
175 175 Commit with several checks
176 176
177 177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
178 178 committing files:
179 179 a
180 180 b
181 181 committing manifest
182 182 committing changelog
183 183 overwriting a expanding keywords
184 184 updating the branch cache
185 185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
186 186 running hook commit.test: cp a hooktest
187 187 $ hg status
188 188 ? hooktest
189 189 $ hg debugrebuildstate
190 190 $ hg --quiet identify
191 191 ef63ca68695b
192 192
193 193 cat files in working directory with keywords expanded
194 194
195 195 $ cat a b
196 196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
197 197 do not process $Id:
198 198 xxx $
199 199 ignore $Id$
200 200
201 201 hg cat files and symlink, no expansion
202 202
203 203 $ hg cat sym a b && echo
204 204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
205 205 do not process $Id:
206 206 xxx $
207 207 ignore $Id$
208 208 a
209 209
210 210 $ diff a hooktest
211 211
212 212 $ cp $HGRCPATH.nohooks $HGRCPATH
213 213 $ rm hooktest
214 214
215 215 hg status of kw-ignored binary file starting with '\1\n'
216 216
217 >>> open("i", "wb").write("\1\nfoo")
217 >>> open("i", "wb").write("\1\nfoo") and None
218 218 $ hg -q commit -Am metasep i
219 219 $ hg status
220 220 >>> open("i", "wb").write("\1\nbar")
221 221 $ hg status
222 222 M i
223 223 $ hg -q commit -m "modify metasep" i
224 224 $ hg status --rev 2:3
225 225 M i
226 226 $ touch empty
227 227 $ hg -q commit -A -m "another file"
228 228 $ hg status -A --rev 3:4 i
229 229 C i
230 230
231 231 $ hg -q strip --no-backup 2
232 232
233 233 Test hook execution
234 234
235 235 bundle
236 236
237 237 $ hg bundle --base null ../kw.hg
238 238 2 changesets found
239 239 $ cd ..
240 240 $ hg init Test
241 241 $ cd Test
242 242
243 243 Notify on pull to check whether keywords stay as is in email
244 244 ie. if patch.diff wrapper acts as it should
245 245
246 246 $ cat <<EOF >> $HGRCPATH
247 247 > [hooks]
248 248 > incoming.notify = python:hgext.notify.hook
249 249 > [notify]
250 250 > sources = pull
251 251 > diffstat = False
252 252 > maxsubject = 15
253 253 > [reposubs]
254 254 > * = Test
255 255 > EOF
256 256
257 257 Pull from bundle and trigger notify
258 258
259 259 $ hg pull -u ../kw.hg
260 260 pulling from ../kw.hg
261 261 requesting all changes
262 262 adding changesets
263 263 adding manifests
264 264 adding file changes
265 265 added 2 changesets with 3 changes to 3 files
266 266 new changesets a2392c293916:ef63ca68695b (2 drafts)
267 267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 268 MIME-Version: 1.0
269 269 Content-Type: text/plain; charset="us-ascii"
270 270 Content-Transfer-Encoding: 7bit
271 271 Date: * (glob)
272 272 Subject: changeset in...
273 273 From: mercurial
274 274 X-Hg-Notification: changeset a2392c293916
275 275 Message-Id: <hg.a2392c293916*> (glob)
276 276 To: Test
277 277
278 278 changeset a2392c293916 in $TESTTMP/Test
279 279 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
280 280 description:
281 281 addsym
282 282
283 283 diffs (6 lines):
284 284
285 285 diff -r 000000000000 -r a2392c293916 sym
286 286 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 287 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
288 288 @@ -0,0 +1,1 @@
289 289 +a
290 290 \ No newline at end of file
291 291 MIME-Version: 1.0
292 292 Content-Type: text/plain; charset="us-ascii"
293 293 Content-Transfer-Encoding: 7bit
294 294 Date:* (glob)
295 295 Subject: changeset in...
296 296 From: User Name <user@example.com>
297 297 X-Hg-Notification: changeset ef63ca68695b
298 298 Message-Id: <hg.ef63ca68695b*> (glob)
299 299 To: Test
300 300
301 301 changeset ef63ca68695b in $TESTTMP/Test
302 302 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
303 303 description:
304 304 absym
305 305
306 306 diffs (12 lines):
307 307
308 308 diff -r a2392c293916 -r ef63ca68695b a
309 309 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310 310 +++ b/a Thu Jan 01 00:00:00 1970 +0000
311 311 @@ -0,0 +1,3 @@
312 312 +expand $Id$
313 313 +do not process $Id:
314 314 +xxx $
315 315 diff -r a2392c293916 -r ef63ca68695b b
316 316 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 317 +++ b/b Thu Jan 01 00:00:00 1970 +0000
318 318 @@ -0,0 +1,1 @@
319 319 +ignore $Id$
320 320
321 321 $ cp $HGRCPATH.nohooks $HGRCPATH
322 322
323 323 Touch files and check with status
324 324
325 325 $ touch a b
326 326 $ hg status
327 327
328 328 Update and expand
329 329
330 330 $ rm sym a b
331 331 $ hg update -C
332 332 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 333 $ cat a b
334 334 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
335 335 do not process $Id:
336 336 xxx $
337 337 ignore $Id$
338 338
339 339 Check whether expansion is filewise and file mode is preserved
340 340
341 341 $ echo '$Id$' > c
342 342 $ echo 'tests for different changenodes' >> c
343 343 #if unix-permissions
344 344 $ chmod 600 c
345 345 $ ls -l c | cut -b 1-10
346 346 -rw-------
347 347 #endif
348 348
349 349 commit file c
350 350
351 351 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
352 352 adding c
353 353 #if unix-permissions
354 354 $ ls -l c | cut -b 1-10
355 355 -rw-------
356 356 #endif
357 357
358 358 force expansion
359 359
360 360 $ hg -v kwexpand
361 361 overwriting a expanding keywords
362 362 overwriting c expanding keywords
363 363
364 364 compare changenodes in a and c
365 365
366 366 $ cat a c
367 367 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
368 368 do not process $Id:
369 369 xxx $
370 370 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
371 371 tests for different changenodes
372 372
373 373 record
374 374
375 375 $ echo '$Id$' > r
376 376 $ hg add r
377 377
378 378 record chunk
379 379
380 380 >>> lines = open('a', 'rb').readlines()
381 381 >>> lines.insert(1, 'foo\n')
382 382 >>> lines.append('bar\n')
383 383 >>> open('a', 'wb').writelines(lines)
384 384 $ hg record -d '10 1' -m rectest a<<EOF
385 385 > y
386 386 > y
387 387 > n
388 388 > EOF
389 389 diff --git a/a b/a
390 390 2 hunks, 2 lines changed
391 391 examine changes to 'a'? [Ynesfdaq?] y
392 392
393 393 @@ -1,3 +1,4 @@
394 394 expand $Id$
395 395 +foo
396 396 do not process $Id:
397 397 xxx $
398 398 record change 1/2 to 'a'? [Ynesfdaq?] y
399 399
400 400 @@ -2,2 +3,3 @@
401 401 do not process $Id:
402 402 xxx $
403 403 +bar
404 404 record change 2/2 to 'a'? [Ynesfdaq?] n
405 405
406 406
407 407 $ hg identify
408 408 5f5eb23505c3+ tip
409 409 $ hg status
410 410 M a
411 411 A r
412 412
413 413 Cat modified file a
414 414
415 415 $ cat a
416 416 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
417 417 foo
418 418 do not process $Id:
419 419 xxx $
420 420 bar
421 421
422 422 Diff remaining chunk
423 423
424 424 $ hg diff a
425 425 diff -r 5f5eb23505c3 a
426 426 --- a/a Thu Jan 01 00:00:09 1970 -0000
427 427 +++ b/a * (glob)
428 428 @@ -2,3 +2,4 @@
429 429 foo
430 430 do not process $Id:
431 431 xxx $
432 432 +bar
433 433
434 434 $ hg rollback
435 435 repository tip rolled back to revision 2 (undo commit)
436 436 working directory now based on revision 2
437 437
438 438 Record all chunks in file a
439 439
440 440 $ echo foo > msg
441 441
442 442 - do not use "hg record -m" here!
443 443
444 444 $ hg record -l msg -d '11 1' a<<EOF
445 445 > y
446 446 > y
447 447 > y
448 448 > EOF
449 449 diff --git a/a b/a
450 450 2 hunks, 2 lines changed
451 451 examine changes to 'a'? [Ynesfdaq?] y
452 452
453 453 @@ -1,3 +1,4 @@
454 454 expand $Id$
455 455 +foo
456 456 do not process $Id:
457 457 xxx $
458 458 record change 1/2 to 'a'? [Ynesfdaq?] y
459 459
460 460 @@ -2,2 +3,3 @@
461 461 do not process $Id:
462 462 xxx $
463 463 +bar
464 464 record change 2/2 to 'a'? [Ynesfdaq?] y
465 465
466 466
467 467 File a should be clean
468 468
469 469 $ hg status -A a
470 470 C a
471 471
472 472 rollback and revert expansion
473 473
474 474 $ cat a
475 475 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
476 476 foo
477 477 do not process $Id:
478 478 xxx $
479 479 bar
480 480 $ hg --verbose rollback
481 481 repository tip rolled back to revision 2 (undo commit)
482 482 working directory now based on revision 2
483 483 overwriting a expanding keywords
484 484 $ hg status a
485 485 M a
486 486 $ cat a
487 487 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
488 488 foo
489 489 do not process $Id:
490 490 xxx $
491 491 bar
492 492 $ echo '$Id$' > y
493 493 $ echo '$Id$' > z
494 494 $ hg add y
495 495 $ hg commit -Am "rollback only" z
496 496 $ cat z
497 497 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
498 498 $ hg --verbose rollback
499 499 repository tip rolled back to revision 2 (undo commit)
500 500 working directory now based on revision 2
501 501 overwriting z shrinking keywords
502 502
503 503 Only z should be overwritten
504 504
505 505 $ hg status a y z
506 506 M a
507 507 A y
508 508 A z
509 509 $ cat z
510 510 $Id$
511 511 $ hg forget y z
512 512 $ rm y z
513 513
514 514 record added file alone
515 515
516 516 $ hg -v record -l msg -d '12 2' r<<EOF
517 517 > y
518 518 > y
519 519 > EOF
520 520 diff --git a/r b/r
521 521 new file mode 100644
522 522 examine changes to 'r'? [Ynesfdaq?] y
523 523
524 524 @@ -0,0 +1,1 @@
525 525 +$Id$
526 526 record this change to 'r'? [Ynesfdaq?] y
527 527
528 528 resolving manifests
529 529 patching file r
530 530 committing files:
531 531 r
532 532 committing manifest
533 533 committing changelog
534 534 committed changeset 3:82a2f715724d
535 535 overwriting r expanding keywords
536 536 $ hg status r
537 537 $ hg --verbose rollback
538 538 repository tip rolled back to revision 2 (undo commit)
539 539 working directory now based on revision 2
540 540 overwriting r shrinking keywords
541 541 $ hg forget r
542 542 $ rm msg r
543 543 $ hg update -C
544 544 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 545
546 546 record added keyword ignored file
547 547
548 548 $ echo '$Id$' > i
549 549 $ hg add i
550 550 $ hg --verbose record -d '13 1' -m recignored<<EOF
551 551 > y
552 552 > y
553 553 > EOF
554 554 diff --git a/i b/i
555 555 new file mode 100644
556 556 examine changes to 'i'? [Ynesfdaq?] y
557 557
558 558 @@ -0,0 +1,1 @@
559 559 +$Id$
560 560 record this change to 'i'? [Ynesfdaq?] y
561 561
562 562 resolving manifests
563 563 patching file i
564 564 committing files:
565 565 i
566 566 committing manifest
567 567 committing changelog
568 568 committed changeset 3:9f40ceb5a072
569 569 $ cat i
570 570 $Id$
571 571 $ hg -q rollback
572 572 $ hg forget i
573 573 $ rm i
574 574
575 575 amend
576 576
577 577 $ echo amend >> a
578 578 $ echo amend >> b
579 579 $ hg -q commit -d '14 1' -m 'prepare amend'
580 580
581 581 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
582 582 overwriting a expanding keywords
583 583 $ hg -q id
584 584 67d8c481a6be
585 585 $ head -1 a
586 586 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
587 587
588 588 $ hg -q strip --no-backup tip
589 589
590 590 Test patch queue repo
591 591
592 592 $ hg init --mq
593 593 $ hg qimport -r tip -n mqtest.diff
594 594 $ hg commit --mq -m mqtest
595 595
596 596 Keywords should not be expanded in patch
597 597
598 598 $ cat .hg/patches/mqtest.diff
599 599 # HG changeset patch
600 600 # User User Name <user@example.com>
601 601 # Date 1 0
602 602 # Thu Jan 01 00:00:01 1970 +0000
603 603 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
604 604 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
605 605 cndiff
606 606
607 607 diff -r ef63ca68695b -r 40a904bbbe4c c
608 608 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 609 +++ b/c Thu Jan 01 00:00:01 1970 +0000
610 610 @@ -0,0 +1,2 @@
611 611 +$Id$
612 612 +tests for different changenodes
613 613
614 614 $ hg qpop
615 615 popping mqtest.diff
616 616 patch queue now empty
617 617
618 618 qgoto, implying qpush, should expand
619 619
620 620 $ hg qgoto mqtest.diff
621 621 applying mqtest.diff
622 622 now at: mqtest.diff
623 623 $ cat c
624 624 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
625 625 tests for different changenodes
626 626 $ hg cat c
627 627 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
628 628 tests for different changenodes
629 629
630 630 Keywords should not be expanded in filelog
631 631
632 632 $ hg --config 'extensions.keyword=!' cat c
633 633 $Id$
634 634 tests for different changenodes
635 635
636 636 qpop and move on
637 637
638 638 $ hg qpop
639 639 popping mqtest.diff
640 640 patch queue now empty
641 641
642 642 Copy and show added kwfiles
643 643
644 644 $ hg cp a c
645 645 $ hg kwfiles
646 646 a
647 647 c
648 648
649 649 Commit and show expansion in original and copy
650 650
651 651 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
652 652 committing files:
653 653 c
654 654 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
655 655 committing manifest
656 656 committing changelog
657 657 overwriting c expanding keywords
658 658 updating the branch cache
659 659 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
660 660 $ cat a c
661 661 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
662 662 do not process $Id:
663 663 xxx $
664 664 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
665 665 do not process $Id:
666 666 xxx $
667 667
668 668 Touch copied c and check its status
669 669
670 670 $ touch c
671 671 $ hg status
672 672
673 673 Copy kwfile to keyword ignored file unexpanding keywords
674 674
675 675 $ hg --verbose copy a i
676 676 copying a to i
677 677 overwriting i shrinking keywords
678 678 $ head -n 1 i
679 679 expand $Id$
680 680 $ hg forget i
681 681 $ rm i
682 682
683 683 Copy ignored file to ignored file: no overwriting
684 684
685 685 $ hg --verbose copy b i
686 686 copying b to i
687 687 $ hg forget i
688 688 $ rm i
689 689
690 690 cp symlink file; hg cp -A symlink file (part1)
691 691 - copied symlink points to kwfile: overwrite
692 692
693 693 #if symlink
694 694 $ cp sym i
695 695 $ ls -l i
696 696 -rw-r--r--* (glob)
697 697 $ head -1 i
698 698 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
699 699 $ hg copy --after --verbose sym i
700 700 copying sym to i
701 701 overwriting i shrinking keywords
702 702 $ head -1 i
703 703 expand $Id$
704 704 $ hg forget i
705 705 $ rm i
706 706 #endif
707 707
708 708 Test different options of hg kwfiles
709 709
710 710 $ hg kwfiles
711 711 a
712 712 c
713 713 $ hg -v kwfiles --ignore
714 714 I b
715 715 I sym
716 716 $ hg kwfiles --all
717 717 K a
718 718 K c
719 719 I b
720 720 I sym
721 721
722 722 Diff specific revision
723 723
724 724 $ hg diff --rev 1
725 725 diff -r ef63ca68695b c
726 726 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
727 727 +++ b/c * (glob)
728 728 @@ -0,0 +1,3 @@
729 729 +expand $Id$
730 730 +do not process $Id:
731 731 +xxx $
732 732
733 733 Status after rollback:
734 734
735 735 $ hg rollback
736 736 repository tip rolled back to revision 1 (undo commit)
737 737 working directory now based on revision 1
738 738 $ hg status
739 739 A c
740 740 $ hg update --clean
741 741 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
742 742
743 743 #if symlink
744 744
745 745 cp symlink file; hg cp -A symlink file (part2)
746 746 - copied symlink points to kw ignored file: do not overwrite
747 747
748 748 $ cat a > i
749 749 $ ln -s i symignored
750 750 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
751 751 $ cp symignored x
752 752 $ hg copy --after --verbose symignored x
753 753 copying symignored to x
754 754 $ head -n 1 x
755 755 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
756 756 $ hg forget x
757 757 $ rm x
758 758
759 759 $ hg rollback
760 760 repository tip rolled back to revision 1 (undo commit)
761 761 working directory now based on revision 1
762 762 $ hg update --clean
763 763 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 764 $ rm i symignored
765 765
766 766 #endif
767 767
768 768 Custom keywordmaps as argument to kwdemo
769 769
770 770 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
771 771 [extensions]
772 772 keyword =
773 773 [keyword]
774 774 ** =
775 775 b = ignore
776 776 demo.txt =
777 777 i = ignore
778 778 [keywordset]
779 779 svn = False
780 780 [keywordmaps]
781 781 Xinfo = {author}: {desc}
782 782 $Xinfo: test: hg keyword configuration and expansion example $
783 783
784 784 Configure custom keywordmaps
785 785
786 786 $ cat <<EOF >>$HGRCPATH
787 787 > [keywordmaps]
788 788 > Id = {file} {node|short} {date|rfc822date} {author|user}
789 789 > Xinfo = {author}: {desc}
790 790 > EOF
791 791
792 792 Cat and hg cat files before custom expansion
793 793
794 794 $ cat a b
795 795 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
796 796 do not process $Id:
797 797 xxx $
798 798 ignore $Id$
799 799 $ hg cat sym a b && echo
800 800 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
801 801 do not process $Id:
802 802 xxx $
803 803 ignore $Id$
804 804 a
805 805
806 806 Write custom keyword and prepare multi-line commit message
807 807
808 808 $ echo '$Xinfo$' >> a
809 809 $ cat <<EOF >> log
810 810 > firstline
811 811 > secondline
812 812 > EOF
813 813
814 814 Interrupted commit should not change state
815 815
816 816 $ hg commit
817 817 abort: empty commit message
818 818 [255]
819 819 $ hg status
820 820 M a
821 821 ? c
822 822 ? log
823 823
824 824 Commit with multi-line message and custom expansion
825 825
826 826 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
827 827 committing files:
828 828 a
829 829 committing manifest
830 830 committing changelog
831 831 overwriting a expanding keywords
832 832 updating the branch cache
833 833 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
834 834 $ rm log
835 835
836 836 Stat, verify and show custom expansion (firstline)
837 837
838 838 $ hg status
839 839 ? c
840 840 $ hg verify
841 841 checking changesets
842 842 checking manifests
843 843 crosschecking files in changesets and manifests
844 844 checking files
845 845 checked 3 changesets with 4 changes to 3 files
846 846 $ cat a b
847 847 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
848 848 do not process $Id:
849 849 xxx $
850 850 $Xinfo: User Name <user@example.com>: firstline $
851 851 ignore $Id$
852 852 $ hg cat sym a b && echo
853 853 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
854 854 do not process $Id:
855 855 xxx $
856 856 $Xinfo: User Name <user@example.com>: firstline $
857 857 ignore $Id$
858 858 a
859 859
860 860 annotate
861 861
862 862 $ hg annotate a
863 863 1: expand $Id$
864 864 1: do not process $Id:
865 865 1: xxx $
866 866 2: $Xinfo$
867 867
868 868 remove with status checks
869 869
870 870 $ hg debugrebuildstate
871 871 $ hg remove a
872 872 $ hg --debug commit -m rma
873 873 committing files:
874 874 committing manifest
875 875 committing changelog
876 876 updating the branch cache
877 877 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
878 878 $ hg status
879 879 ? c
880 880
881 881 Rollback, revert, and check expansion
882 882
883 883 $ hg rollback
884 884 repository tip rolled back to revision 2 (undo commit)
885 885 working directory now based on revision 2
886 886 $ hg status
887 887 R a
888 888 ? c
889 889 $ hg revert --no-backup --rev tip a
890 890 $ cat a
891 891 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
892 892 do not process $Id:
893 893 xxx $
894 894 $Xinfo: User Name <user@example.com>: firstline $
895 895
896 896 Clone to test global and local configurations
897 897
898 898 $ cd ..
899 899
900 900 Expansion in destination with global configuration
901 901
902 902 $ hg --quiet clone Test globalconf
903 903 $ cat globalconf/a
904 904 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
905 905 do not process $Id:
906 906 xxx $
907 907 $Xinfo: User Name <user@example.com>: firstline $
908 908
909 909 No expansion in destination with local configuration in origin only
910 910
911 911 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
912 912 $ cat localconf/a
913 913 expand $Id$
914 914 do not process $Id:
915 915 xxx $
916 916 $Xinfo$
917 917
918 918 Clone to test incoming
919 919
920 920 $ hg clone -r1 Test Test-a
921 921 adding changesets
922 922 adding manifests
923 923 adding file changes
924 924 added 2 changesets with 3 changes to 3 files
925 925 new changesets a2392c293916:ef63ca68695b
926 926 updating to branch default
927 927 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 928 $ cd Test-a
929 929 $ cat <<EOF >> .hg/hgrc
930 930 > [paths]
931 931 > default = ../Test
932 932 > EOF
933 933 $ hg incoming
934 934 comparing with $TESTTMP/Test
935 935 searching for changes
936 936 changeset: 2:bb948857c743
937 937 tag: tip
938 938 user: User Name <user@example.com>
939 939 date: Thu Jan 01 00:00:02 1970 +0000
940 940 summary: firstline
941 941
942 942 Imported patch should not be rejected
943 943
944 944 >>> import re
945 945 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
946 946 >>> open('a', 'wb').write(text)
947 947 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
948 948 committing files:
949 949 a
950 950 committing manifest
951 951 committing changelog
952 952 overwriting a expanding keywords
953 953 updating the branch cache
954 954 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
955 955 $ hg export -o ../rejecttest.diff tip
956 956 $ cd ../Test
957 957 $ hg import ../rejecttest.diff
958 958 applying ../rejecttest.diff
959 959 $ cat a b
960 960 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
961 961 do not process $Id: rejecttest
962 962 xxx $
963 963 $Xinfo: User Name <user@example.com>: rejects? $
964 964 ignore $Id$
965 965
966 966 $ hg rollback
967 967 repository tip rolled back to revision 2 (undo import)
968 968 working directory now based on revision 2
969 969 $ hg update --clean
970 970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971 971
972 972 kwexpand/kwshrink on selected files
973 973
974 974 $ mkdir x
975 975 $ hg copy a x/a
976 976 $ hg --verbose kwshrink a
977 977 overwriting a shrinking keywords
978 978 - sleep required for dirstate.normal() check
979 979 $ sleep 1
980 980 $ hg status a
981 981 $ hg --verbose kwexpand a
982 982 overwriting a expanding keywords
983 983 $ hg status a
984 984
985 985 kwexpand x/a should abort
986 986
987 987 $ hg --verbose kwexpand x/a
988 988 abort: outstanding uncommitted changes
989 989 [255]
990 990 $ cd x
991 991 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
992 992 committing files:
993 993 x/a
994 994 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
995 995 committing manifest
996 996 committing changelog
997 997 overwriting x/a expanding keywords
998 998 updating the branch cache
999 999 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
1000 1000 $ cat a
1001 1001 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
1002 1002 do not process $Id:
1003 1003 xxx $
1004 1004 $Xinfo: User Name <user@example.com>: xa $
1005 1005
1006 1006 kwshrink a inside directory x
1007 1007
1008 1008 $ hg --verbose kwshrink a
1009 1009 overwriting x/a shrinking keywords
1010 1010 $ cat a
1011 1011 expand $Id$
1012 1012 do not process $Id:
1013 1013 xxx $
1014 1014 $Xinfo$
1015 1015 $ cd ..
1016 1016
1017 1017 kwexpand nonexistent
1018 1018
1019 1019 $ hg kwexpand nonexistent
1020 1020 nonexistent:* (glob)
1021 1021
1022 1022
1023 1023 #if serve
1024 1024 hg serve
1025 1025 - expand with hgweb file
1026 1026 - no expansion with hgweb annotate/changeset/filediff/comparison
1027 1027 - expand with hgweb file, again
1028 1028 - check errors
1029 1029
1030 1030 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1031 1031 $ cat hg.pid >> $DAEMON_PIDS
1032 1032 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1033 1033 200 Script output follows
1034 1034
1035 1035 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1036 1036 do not process $Id:
1037 1037 xxx $
1038 1038 $Xinfo: User Name <user@example.com>: firstline $
1039 1039 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1040 1040 200 Script output follows
1041 1041
1042 1042
1043 1043 user@1: expand $Id$
1044 1044 user@1: do not process $Id:
1045 1045 user@1: xxx $
1046 1046 user@2: $Xinfo$
1047 1047
1048 1048
1049 1049
1050 1050
1051 1051 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1052 1052 200 Script output follows
1053 1053
1054 1054
1055 1055 # HG changeset patch
1056 1056 # User User Name <user@example.com>
1057 1057 # Date 3 0
1058 1058 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1059 1059 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1060 1060 xa
1061 1061
1062 1062 diff -r bb948857c743 -r b4560182a3f9 x/a
1063 1063 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1064 1064 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1065 1065 @@ -0,0 +1,4 @@
1066 1066 +expand $Id$
1067 1067 +do not process $Id:
1068 1068 +xxx $
1069 1069 +$Xinfo$
1070 1070
1071 1071 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1072 1072 200 Script output follows
1073 1073
1074 1074
1075 1075 diff -r ef63ca68695b -r bb948857c743 a
1076 1076 --- a/a Thu Jan 01 00:00:00 1970 +0000
1077 1077 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1078 1078 @@ -1,3 +1,4 @@
1079 1079 expand $Id$
1080 1080 do not process $Id:
1081 1081 xxx $
1082 1082 +$Xinfo$
1083 1083
1084 1084
1085 1085
1086 1086
1087 1087 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1088 1088 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1089 1089 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1090 1090 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1091 1091 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1092 1092 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1093 1093
1094 1094 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1095 1095 at subsequent webcommands)
1096 1096
1097 1097 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1098 1098 200 Script output follows
1099 1099
1100 1100 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1101 1101 do not process $Id:
1102 1102 xxx $
1103 1103 $Xinfo: User Name <user@example.com>: firstline $
1104 1104
1105 1105 $ killdaemons.py
1106 1106 $ cat errors.log
1107 1107 #endif
1108 1108
1109 1109 Prepare merge and resolve tests
1110 1110
1111 1111 $ echo '$Id$' > m
1112 1112 $ hg add m
1113 1113 $ hg commit -m 4kw
1114 1114 $ echo foo >> m
1115 1115 $ hg commit -m 5foo
1116 1116
1117 1117 simplemerge
1118 1118
1119 1119 $ hg update 4
1120 1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 1121 $ echo foo >> m
1122 1122 $ hg commit -m 6foo
1123 1123 created new head
1124 1124 $ hg merge
1125 1125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1126 1126 (branch merge, don't forget to commit)
1127 1127 $ hg commit -m simplemerge
1128 1128 $ cat m
1129 1129 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1130 1130 foo
1131 1131
1132 1132 conflict: keyword should stay outside conflict zone
1133 1133
1134 1134 $ hg update 4
1135 1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 1136 $ echo bar >> m
1137 1137 $ hg commit -m 8bar
1138 1138 created new head
1139 1139 $ hg merge
1140 1140 merging m
1141 1141 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1142 1142 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1143 1143 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1144 1144 [1]
1145 1145 $ cat m
1146 1146 $Id$
1147 1147 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1148 1148 bar
1149 1149 =======
1150 1150 foo
1151 1151 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1152 1152
1153 1153 resolve to local, m must contain hash of last change (local parent)
1154 1154
1155 1155 $ hg resolve -t internal:local -a
1156 1156 (no more unresolved files)
1157 1157 $ hg commit -m localresolve
1158 1158 $ cat m
1159 1159 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1160 1160 bar
1161 1161
1162 1162 Test restricted mode with transplant -b
1163 1163
1164 1164 $ hg update 6
1165 1165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1166 1166 $ hg branch foo
1167 1167 marked working directory as branch foo
1168 1168 (branches are permanent and global, did you want a bookmark?)
1169 1169 $ mv a a.bak
1170 1170 $ echo foobranch > a
1171 1171 $ cat a.bak >> a
1172 1172 $ rm a.bak
1173 1173 $ hg commit -m 9foobranch
1174 1174 $ hg update default
1175 1175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1176 1176 $ hg -y transplant -b foo tip
1177 1177 applying 4aa30d025d50
1178 1178 4aa30d025d50 transplanted to e00abbf63521
1179 1179
1180 1180 Expansion in changeset but not in file
1181 1181
1182 1182 $ hg tip -p
1183 1183 changeset: 11:e00abbf63521
1184 1184 tag: tip
1185 1185 parent: 9:800511b3a22d
1186 1186 user: test
1187 1187 date: Thu Jan 01 00:00:00 1970 +0000
1188 1188 summary: 9foobranch
1189 1189
1190 1190 diff -r 800511b3a22d -r e00abbf63521 a
1191 1191 --- a/a Thu Jan 01 00:00:00 1970 +0000
1192 1192 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1193 1193 @@ -1,3 +1,4 @@
1194 1194 +foobranch
1195 1195 expand $Id$
1196 1196 do not process $Id:
1197 1197 xxx $
1198 1198
1199 1199 $ head -n 2 a
1200 1200 foobranch
1201 1201 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1202 1202
1203 1203 Turn off expansion
1204 1204
1205 1205 $ hg -q rollback
1206 1206 $ hg -q update -C
1207 1207
1208 1208 kwshrink with unknown file u
1209 1209
1210 1210 $ cp a u
1211 1211 $ hg --verbose kwshrink
1212 1212 overwriting a shrinking keywords
1213 1213 overwriting m shrinking keywords
1214 1214 overwriting x/a shrinking keywords
1215 1215
1216 1216 Keywords shrunk in working directory, but not yet disabled
1217 1217 - cat shows unexpanded keywords
1218 1218 - hg cat shows expanded keywords
1219 1219
1220 1220 $ cat a b
1221 1221 expand $Id$
1222 1222 do not process $Id:
1223 1223 xxx $
1224 1224 $Xinfo$
1225 1225 ignore $Id$
1226 1226 $ hg cat sym a b && echo
1227 1227 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1228 1228 do not process $Id:
1229 1229 xxx $
1230 1230 $Xinfo: User Name <user@example.com>: firstline $
1231 1231 ignore $Id$
1232 1232 a
1233 1233
1234 1234 Now disable keyword expansion
1235 1235
1236 1236 $ cp $HGRCPATH $HGRCPATH.backup
1237 1237 $ rm "$HGRCPATH"
1238 1238 $ cat a b
1239 1239 expand $Id$
1240 1240 do not process $Id:
1241 1241 xxx $
1242 1242 $Xinfo$
1243 1243 ignore $Id$
1244 1244 $ hg cat sym a b && echo
1245 1245 expand $Id$
1246 1246 do not process $Id:
1247 1247 xxx $
1248 1248 $Xinfo$
1249 1249 ignore $Id$
1250 1250 a
1251 1251
1252 1252 enable keyword expansion again
1253 1253
1254 1254 $ cat $HGRCPATH.backup >> $HGRCPATH
1255 1255
1256 1256 Test restricted mode with unshelve
1257 1257
1258 1258 $ cat <<EOF >> $HGRCPATH
1259 1259 > [extensions]
1260 1260 > shelve =
1261 1261 > EOF
1262 1262
1263 1263 $ echo xxxx >> a
1264 1264 $ hg diff
1265 1265 diff -r 800511b3a22d a
1266 1266 --- a/a Thu Jan 01 00:00:00 1970 +0000
1267 1267 +++ b/a * (glob)
1268 1268 @@ -2,3 +2,4 @@
1269 1269 do not process $Id:
1270 1270 xxx $
1271 1271 $Xinfo$
1272 1272 +xxxx
1273 1273 $ hg shelve -q --name tmp
1274 1274 $ hg shelve --list --patch
1275 1275 tmp (*)* changes to: localresolve (glob)
1276 1276
1277 1277 diff --git a/a b/a
1278 1278 --- a/a
1279 1279 +++ b/a
1280 1280 @@ -2,3 +2,4 @@
1281 1281 do not process $Id:
1282 1282 xxx $
1283 1283 $Xinfo$
1284 1284 +xxxx
1285 1285
1286 1286 $ hg update -q -C 10
1287 1287 $ hg unshelve -q tmp
1288 1288 $ hg diff
1289 1289 diff -r 4aa30d025d50 a
1290 1290 --- a/a Thu Jan 01 00:00:00 1970 +0000
1291 1291 +++ b/a * (glob)
1292 1292 @@ -3,3 +3,4 @@
1293 1293 do not process $Id:
1294 1294 xxx $
1295 1295 $Xinfo$
1296 1296 +xxxx
1297 1297
1298 1298 Test restricted mode with rebase
1299 1299
1300 1300 $ cat <<EOF >> $HGRCPATH
1301 1301 > [extensions]
1302 1302 > rebase =
1303 1303 > EOF
1304 1304
1305 1305 $ hg update -q -C 9
1306 1306
1307 1307 $ echo xxxx >> a
1308 1308 $ hg commit -m '#11'
1309 1309 $ hg diff -c 11
1310 1310 diff -r 800511b3a22d -r b07670694489 a
1311 1311 --- a/a Thu Jan 01 00:00:00 1970 +0000
1312 1312 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1313 1313 @@ -2,3 +2,4 @@
1314 1314 do not process $Id:
1315 1315 xxx $
1316 1316 $Xinfo$
1317 1317 +xxxx
1318 1318
1319 1319 $ hg diff -c 10
1320 1320 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1321 1321 --- a/a Thu Jan 01 00:00:00 1970 +0000
1322 1322 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1323 1323 @@ -1,3 +1,4 @@
1324 1324 +foobranch
1325 1325 expand $Id$
1326 1326 do not process $Id:
1327 1327 xxx $
1328 1328
1329 1329 $ hg rebase -q -s 10 -d 11 --keep
1330 1330 $ hg diff -r 9 -r 12 a
1331 1331 diff -r 800511b3a22d -r 1939b927726c a
1332 1332 --- a/a Thu Jan 01 00:00:00 1970 +0000
1333 1333 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1334 1334 @@ -1,4 +1,6 @@
1335 1335 +foobranch
1336 1336 expand $Id$
1337 1337 do not process $Id:
1338 1338 xxx $
1339 1339 $Xinfo$
1340 1340 +xxxx
1341 1341
1342 1342 Test restricted mode with graft
1343 1343
1344 1344 $ hg graft -q 10
1345 1345 $ hg diff -r 9 -r 13 a
1346 1346 diff -r 800511b3a22d -r 01a68de1003a a
1347 1347 --- a/a Thu Jan 01 00:00:00 1970 +0000
1348 1348 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1349 1349 @@ -1,4 +1,6 @@
1350 1350 +foobranch
1351 1351 expand $Id$
1352 1352 do not process $Id:
1353 1353 xxx $
1354 1354 $Xinfo$
1355 1355 +xxxx
1356 1356
1357 1357 Test restricted mode with backout
1358 1358
1359 1359 $ hg backout -q 11 --no-commit
1360 1360 $ hg diff a
1361 1361 diff -r 01a68de1003a a
1362 1362 --- a/a Thu Jan 01 00:00:00 1970 +0000
1363 1363 +++ b/a * (glob)
1364 1364 @@ -3,4 +3,3 @@
1365 1365 do not process $Id:
1366 1366 xxx $
1367 1367 $Xinfo$
1368 1368 -xxxx
1369 1369
1370 1370 Test restricted mode with histedit
1371 1371
1372 1372 $ cat <<EOF >> $HGRCPATH
1373 1373 > [extensions]
1374 1374 > histedit =
1375 1375 > EOF
1376 1376
1377 1377 $ hg commit -m 'backout #11'
1378 1378 $ hg histedit -q --command - 13 <<EOF
1379 1379 > pick 49f5f2d940c3 14 backout #11
1380 1380 > pick 01a68de1003a 13 9foobranch
1381 1381 > EOF
1382 1382
1383 1383 Test restricted mode with fetch (with merge)
1384 1384
1385 1385 $ cat <<EOF >> $HGRCPATH
1386 1386 > [extensions]
1387 1387 > fetch =
1388 1388 > EOF
1389 1389
1390 1390 $ hg clone -q -r 9 . ../fetch-merge
1391 1391 $ cd ../fetch-merge
1392 1392 $ hg -R ../Test export 10 | hg import -q -
1393 1393 $ hg fetch -q -r 11
1394 1394 $ hg diff -r 9 a
1395 1395 diff -r 800511b3a22d a
1396 1396 --- a/a Thu Jan 01 00:00:00 1970 +0000
1397 1397 +++ b/a * (glob)
1398 1398 @@ -1,4 +1,6 @@
1399 1399 +foobranch
1400 1400 expand $Id$
1401 1401 do not process $Id:
1402 1402 xxx $
1403 1403 $Xinfo$
1404 1404 +xxxx
1405 1405
1406 1406 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1407 1407 suppress expanding keywords at subsequent commands
1408 1408
1409 1409 #if windows
1410 1410 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1411 1411 #else
1412 1412 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1413 1413 #endif
1414 1414 $ export PYTHONPATH
1415 1415
1416 1416 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1417 1417 $ mv $HGRCPATH.new $HGRCPATH
1418 1418
1419 1419 >>> from __future__ import print_function
1420 1420 >>> from hgclient import check, readchannel, runcommand
1421 1421 >>> @check
1422 1422 ... def check(server):
1423 1423 ... # hello block
1424 1424 ... readchannel(server)
1425 1425 ...
1426 1426 ... runcommand(server, ['cat', 'm'])
1427 1427 ... runcommand(server, ['diff', '-c', '.', 'm'])
1428 1428 ... runcommand(server, ['cat', 'm'])
1429 1429 *** runcommand cat m
1430 1430 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1431 1431 bar
1432 1432 *** runcommand diff -c . m
1433 1433 *** runcommand cat m
1434 1434 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1435 1435 bar
1436 1436
1437 1437 $ cd ..
1438 1438
1439 1439 #if serve
1440 1440
1441 1441 Test that keywords are expanded only in repositories, which enable
1442 1442 keyword extension, even if multiple repositories are served in a
1443 1443 process
1444 1444
1445 1445 $ cat >> fetch-merge/.hg/hgrc <<EOF
1446 1446 > [extensions]
1447 1447 > keyword = !
1448 1448 > EOF
1449 1449
1450 1450 $ cat > paths.conf <<EOF
1451 1451 > [paths]
1452 1452 > enabled=Test
1453 1453 > disabled=fetch-merge
1454 1454 > EOF
1455 1455
1456 1456 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1457 1457 $ cat hg.pid >> $DAEMON_PIDS
1458 1458
1459 1459 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1460 1460 200 Script output follows
1461 1461
1462 1462 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1463 1463 bar
1464 1464
1465 1465 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1466 1466 200 Script output follows
1467 1467
1468 1468 $Id$
1469 1469 bar
1470 1470
1471 1471 (check expansion again, for safety)
1472 1472
1473 1473 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1474 1474 200 Script output follows
1475 1475
1476 1476 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1477 1477 bar
1478 1478
1479 1479 $ killdaemons.py
1480 1480 #endif
@@ -1,52 +1,52 b''
1 1 $ hg init empty-repo
2 2 $ cd empty-repo
3 3
4 4 Flags on revlog version 0 are rejected
5 5
6 6 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
7 7 ... fh.write(b'\x00\x01\x00\x00') and None
8 8
9 9 $ hg log
10 10 abort: unknown flags (0x01) in version 0 revlog 00changelog.i!
11 11 [255]
12 12
13 13 Unknown flags on revlog version 1 are rejected
14 14
15 15 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
16 16 ... fh.write(b'\x00\x04\x00\x01') and None
17 17
18 18 $ hg log
19 19 abort: unknown flags (0x04) in version 1 revlog 00changelog.i!
20 20 [255]
21 21
22 22 Unknown version is rejected
23 23
24 24 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
25 25 ... fh.write(b'\x00\x00\x00\x02') and None
26 26
27 27 $ hg log
28 28 abort: unknown version (2) in revlog 00changelog.i!
29 29 [255]
30 30
31 31 $ cd ..
32 32
33 33 Test for CVE-2016-3630
34 34
35 35 $ hg init
36 36
37 37 >>> open("a.i", "wb").write(
38 38 ... b"""eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD
39 39 ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA=="""
40 ... .decode("base64").decode("zlib"))
40 ... .decode("base64").decode("zlib")) and None
41 41
42 42 $ hg debugrevlogindex a.i
43 43 rev linkrev nodeid p1 p2
44 44 0 2 99e0332bd498 000000000000 000000000000
45 45 1 3 6674f57a23d8 99e0332bd498 000000000000
46 46
47 47 >>> from mercurial import revlog, vfs
48 48 >>> tvfs = vfs.vfs(b'.')
49 49 >>> tvfs.options = {b'revlogv1': True}
50 50 >>> rl = revlog.revlog(tvfs, b'a.i')
51 51 >>> rl.revision(1)
52 52 mpatchError('patch cannot be decoded',)
General Comments 0
You need to be logged in to leave comments. Login now