##// END OF EJS Templates
tests: drop final true command from unified tests
Matt Mackall -
r12346:3b165c12 default
parent child Browse files
Show More
@@ -1,1738 +1,1736
1 1 > do_push()
2 2 > {
3 3 > user=$1
4 4 > shift
5 5 > echo "Pushing as user $user"
6 6 > echo 'hgrc = """'
7 7 > sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py
8 8 > echo '"""'
9 9 > if test -f acl.config; then
10 10 > echo 'acl.config = """'
11 11 > cat acl.config
12 12 > echo '"""'
13 13 > fi
14 14 > # On AIX /etc/profile sets LOGNAME read-only. So
15 15 > # LOGNAME=$user hg --cws a --debug push ../b
16 16 > # fails with "This variable is read only."
17 17 > # Use env to work around this.
18 18 > env LOGNAME=$user hg --cwd a --debug push ../b
19 19 > hg --cwd b rollback
20 20 > hg --cwd b --quiet tip
21 21 > echo
22 22 > }
23 23
24 24 > init_config()
25 25 > {
26 26 > cat > fakegroups.py <<EOF
27 27 > from hgext import acl
28 28 > def fakegetusers(ui, group):
29 29 > try:
30 30 > return acl._getusersorig(ui, group)
31 31 > except:
32 32 > return ["fred", "betty"]
33 33 > acl._getusersorig = acl._getusers
34 34 > acl._getusers = fakegetusers
35 35 > EOF
36 36 > rm -f acl.config
37 37 > cat > $config <<EOF
38 38 > [hooks]
39 39 > pretxnchangegroup.acl = python:hgext.acl.hook
40 40 > [acl]
41 41 > sources = push
42 42 > [extensions]
43 43 > f=`pwd`/fakegroups.py
44 44 > EOF
45 45 > }
46 46
47 47 $ hg init a
48 48 $ cd a
49 49 $ mkdir foo foo/Bar quux
50 50 $ echo 'in foo' > foo/file.txt
51 51 $ echo 'in foo/Bar' > foo/Bar/file.txt
52 52 $ echo 'in quux' > quux/file.py
53 53 $ hg add -q
54 54 $ hg ci -m 'add files' -d '1000000 0'
55 55 $ echo >> foo/file.txt
56 56 $ hg ci -m 'change foo/file' -d '1000001 0'
57 57 $ echo >> foo/Bar/file.txt
58 58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
59 59 $ echo >> quux/file.py
60 60 $ hg ci -m 'change quux/file' -d '1000003 0'
61 61 $ hg tip --quiet
62 62 3:911600dab2ae
63 63
64 64 $ cd ..
65 65 $ hg clone -r 0 a b
66 66 requesting all changes
67 67 adding changesets
68 68 adding manifests
69 69 adding file changes
70 70 added 1 changesets with 3 changes to 3 files
71 71 updating to branch default
72 72 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 73
74 74 $ echo '[extensions]' >> $HGRCPATH
75 75 $ echo 'acl =' >> $HGRCPATH
76 76
77 77 $ config=b/.hg/hgrc
78 78
79 79 Extension disabled for lack of a hook
80 80
81 81 $ do_push fred
82 82 Pushing as user fred
83 83 hgrc = """
84 84 """
85 85 pushing to ../b
86 86 searching for changes
87 87 common changesets up to 6675d58eff77
88 88 3 changesets found
89 89 list of changesets:
90 90 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
91 91 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
92 92 911600dab2ae7a9baff75958b84fe606851ce955
93 93 adding changesets
94 94 bundling changes: 0 chunks
95 95 bundling changes: 1 chunks
96 96 bundling changes: 2 chunks
97 97 bundling changes: 3 chunks
98 98 bundling changes: 4 chunks
99 99 bundling changes: 5 chunks
100 100 bundling changes: 6 chunks
101 101 bundling changes: 7 chunks
102 102 bundling changes: 8 chunks
103 103 bundling changes: 9 chunks
104 104 bundling manifests: 0 chunks
105 105 bundling manifests: 1 chunks
106 106 bundling manifests: 2 chunks
107 107 bundling manifests: 3 chunks
108 108 bundling manifests: 4 chunks
109 109 bundling manifests: 5 chunks
110 110 bundling manifests: 6 chunks
111 111 bundling manifests: 7 chunks
112 112 bundling manifests: 8 chunks
113 113 bundling manifests: 9 chunks
114 114 bundling files: foo/Bar/file.txt 0 chunks
115 115 bundling files: foo/Bar/file.txt 1 chunks
116 116 bundling files: foo/Bar/file.txt 2 chunks
117 117 bundling files: foo/Bar/file.txt 3 chunks
118 118 bundling files: foo/file.txt 4 chunks
119 119 bundling files: foo/file.txt 5 chunks
120 120 bundling files: foo/file.txt 6 chunks
121 121 bundling files: foo/file.txt 7 chunks
122 122 bundling files: quux/file.py 8 chunks
123 123 bundling files: quux/file.py 9 chunks
124 124 bundling files: quux/file.py 10 chunks
125 125 bundling files: quux/file.py 11 chunks
126 126 changesets: 1 chunks
127 127 add changeset ef1ea85a6374
128 128 changesets: 2 chunks
129 129 add changeset f9cafe1212c8
130 130 changesets: 3 chunks
131 131 add changeset 911600dab2ae
132 132 adding manifests
133 133 manifests: 1/3 chunks (33.33%)
134 134 manifests: 2/3 chunks (66.67%)
135 135 manifests: 3/3 chunks (100.00%)
136 136 adding file changes
137 137 adding foo/Bar/file.txt revisions
138 138 files: 1/3 chunks (33.33%)
139 139 adding foo/file.txt revisions
140 140 files: 2/3 chunks (66.67%)
141 141 adding quux/file.py revisions
142 142 files: 3/3 chunks (100.00%)
143 143 added 3 changesets with 3 changes to 3 files
144 144 updating the branch cache
145 145 rolling back to revision 0 (undo push)
146 146 0:6675d58eff77
147 147
148 148
149 149 $ echo '[hooks]' >> $config
150 150 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
151 151
152 152 Extension disabled for lack of acl.sources
153 153
154 154 $ do_push fred
155 155 Pushing as user fred
156 156 hgrc = """
157 157 [hooks]
158 158 pretxnchangegroup.acl = python:hgext.acl.hook
159 159 """
160 160 pushing to ../b
161 161 searching for changes
162 162 common changesets up to 6675d58eff77
163 163 invalidating branch cache (tip differs)
164 164 3 changesets found
165 165 list of changesets:
166 166 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
167 167 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
168 168 911600dab2ae7a9baff75958b84fe606851ce955
169 169 adding changesets
170 170 bundling changes: 0 chunks
171 171 bundling changes: 1 chunks
172 172 bundling changes: 2 chunks
173 173 bundling changes: 3 chunks
174 174 bundling changes: 4 chunks
175 175 bundling changes: 5 chunks
176 176 bundling changes: 6 chunks
177 177 bundling changes: 7 chunks
178 178 bundling changes: 8 chunks
179 179 bundling changes: 9 chunks
180 180 bundling manifests: 0 chunks
181 181 bundling manifests: 1 chunks
182 182 bundling manifests: 2 chunks
183 183 bundling manifests: 3 chunks
184 184 bundling manifests: 4 chunks
185 185 bundling manifests: 5 chunks
186 186 bundling manifests: 6 chunks
187 187 bundling manifests: 7 chunks
188 188 bundling manifests: 8 chunks
189 189 bundling manifests: 9 chunks
190 190 bundling files: foo/Bar/file.txt 0 chunks
191 191 bundling files: foo/Bar/file.txt 1 chunks
192 192 bundling files: foo/Bar/file.txt 2 chunks
193 193 bundling files: foo/Bar/file.txt 3 chunks
194 194 bundling files: foo/file.txt 4 chunks
195 195 bundling files: foo/file.txt 5 chunks
196 196 bundling files: foo/file.txt 6 chunks
197 197 bundling files: foo/file.txt 7 chunks
198 198 bundling files: quux/file.py 8 chunks
199 199 bundling files: quux/file.py 9 chunks
200 200 bundling files: quux/file.py 10 chunks
201 201 bundling files: quux/file.py 11 chunks
202 202 changesets: 1 chunks
203 203 add changeset ef1ea85a6374
204 204 changesets: 2 chunks
205 205 add changeset f9cafe1212c8
206 206 changesets: 3 chunks
207 207 add changeset 911600dab2ae
208 208 adding manifests
209 209 manifests: 1/3 chunks (33.33%)
210 210 manifests: 2/3 chunks (66.67%)
211 211 manifests: 3/3 chunks (100.00%)
212 212 adding file changes
213 213 adding foo/Bar/file.txt revisions
214 214 files: 1/3 chunks (33.33%)
215 215 adding foo/file.txt revisions
216 216 files: 2/3 chunks (66.67%)
217 217 adding quux/file.py revisions
218 218 files: 3/3 chunks (100.00%)
219 219 added 3 changesets with 3 changes to 3 files
220 220 calling hook pretxnchangegroup.acl: hgext.acl.hook
221 221 acl: changes have source "push" - skipping
222 222 updating the branch cache
223 223 rolling back to revision 0 (undo push)
224 224 0:6675d58eff77
225 225
226 226
227 227 No [acl.allow]/[acl.deny]
228 228
229 229 $ echo '[acl]' >> $config
230 230 $ echo 'sources = push' >> $config
231 231 $ do_push fred
232 232 Pushing as user fred
233 233 hgrc = """
234 234 [hooks]
235 235 pretxnchangegroup.acl = python:hgext.acl.hook
236 236 [acl]
237 237 sources = push
238 238 """
239 239 pushing to ../b
240 240 searching for changes
241 241 common changesets up to 6675d58eff77
242 242 invalidating branch cache (tip differs)
243 243 3 changesets found
244 244 list of changesets:
245 245 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
246 246 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
247 247 911600dab2ae7a9baff75958b84fe606851ce955
248 248 adding changesets
249 249 bundling changes: 0 chunks
250 250 bundling changes: 1 chunks
251 251 bundling changes: 2 chunks
252 252 bundling changes: 3 chunks
253 253 bundling changes: 4 chunks
254 254 bundling changes: 5 chunks
255 255 bundling changes: 6 chunks
256 256 bundling changes: 7 chunks
257 257 bundling changes: 8 chunks
258 258 bundling changes: 9 chunks
259 259 bundling manifests: 0 chunks
260 260 bundling manifests: 1 chunks
261 261 bundling manifests: 2 chunks
262 262 bundling manifests: 3 chunks
263 263 bundling manifests: 4 chunks
264 264 bundling manifests: 5 chunks
265 265 bundling manifests: 6 chunks
266 266 bundling manifests: 7 chunks
267 267 bundling manifests: 8 chunks
268 268 bundling manifests: 9 chunks
269 269 bundling files: foo/Bar/file.txt 0 chunks
270 270 bundling files: foo/Bar/file.txt 1 chunks
271 271 bundling files: foo/Bar/file.txt 2 chunks
272 272 bundling files: foo/Bar/file.txt 3 chunks
273 273 bundling files: foo/file.txt 4 chunks
274 274 bundling files: foo/file.txt 5 chunks
275 275 bundling files: foo/file.txt 6 chunks
276 276 bundling files: foo/file.txt 7 chunks
277 277 bundling files: quux/file.py 8 chunks
278 278 bundling files: quux/file.py 9 chunks
279 279 bundling files: quux/file.py 10 chunks
280 280 bundling files: quux/file.py 11 chunks
281 281 changesets: 1 chunks
282 282 add changeset ef1ea85a6374
283 283 changesets: 2 chunks
284 284 add changeset f9cafe1212c8
285 285 changesets: 3 chunks
286 286 add changeset 911600dab2ae
287 287 adding manifests
288 288 manifests: 1/3 chunks (33.33%)
289 289 manifests: 2/3 chunks (66.67%)
290 290 manifests: 3/3 chunks (100.00%)
291 291 adding file changes
292 292 adding foo/Bar/file.txt revisions
293 293 files: 1/3 chunks (33.33%)
294 294 adding foo/file.txt revisions
295 295 files: 2/3 chunks (66.67%)
296 296 adding quux/file.py revisions
297 297 files: 3/3 chunks (100.00%)
298 298 added 3 changesets with 3 changes to 3 files
299 299 calling hook pretxnchangegroup.acl: hgext.acl.hook
300 300 acl: acl.allow.branches not enabled
301 301 acl: acl.deny.branches not enabled
302 302 acl: acl.allow not enabled
303 303 acl: acl.deny not enabled
304 304 acl: branch access granted: "ef1ea85a6374" on branch "default"
305 305 acl: allowing changeset ef1ea85a6374
306 306 acl: branch access granted: "f9cafe1212c8" on branch "default"
307 307 acl: allowing changeset f9cafe1212c8
308 308 acl: branch access granted: "911600dab2ae" on branch "default"
309 309 acl: allowing changeset 911600dab2ae
310 310 updating the branch cache
311 311 rolling back to revision 0 (undo push)
312 312 0:6675d58eff77
313 313
314 314
315 315 Empty [acl.allow]
316 316
317 317 $ echo '[acl.allow]' >> $config
318 318 $ do_push fred
319 319 Pushing as user fred
320 320 hgrc = """
321 321 [hooks]
322 322 pretxnchangegroup.acl = python:hgext.acl.hook
323 323 [acl]
324 324 sources = push
325 325 [acl.allow]
326 326 """
327 327 pushing to ../b
328 328 searching for changes
329 329 common changesets up to 6675d58eff77
330 330 invalidating branch cache (tip differs)
331 331 3 changesets found
332 332 list of changesets:
333 333 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
334 334 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
335 335 911600dab2ae7a9baff75958b84fe606851ce955
336 336 adding changesets
337 337 bundling changes: 0 chunks
338 338 bundling changes: 1 chunks
339 339 bundling changes: 2 chunks
340 340 bundling changes: 3 chunks
341 341 bundling changes: 4 chunks
342 342 bundling changes: 5 chunks
343 343 bundling changes: 6 chunks
344 344 bundling changes: 7 chunks
345 345 bundling changes: 8 chunks
346 346 bundling changes: 9 chunks
347 347 bundling manifests: 0 chunks
348 348 bundling manifests: 1 chunks
349 349 bundling manifests: 2 chunks
350 350 bundling manifests: 3 chunks
351 351 bundling manifests: 4 chunks
352 352 bundling manifests: 5 chunks
353 353 bundling manifests: 6 chunks
354 354 bundling manifests: 7 chunks
355 355 bundling manifests: 8 chunks
356 356 bundling manifests: 9 chunks
357 357 bundling files: foo/Bar/file.txt 0 chunks
358 358 bundling files: foo/Bar/file.txt 1 chunks
359 359 bundling files: foo/Bar/file.txt 2 chunks
360 360 bundling files: foo/Bar/file.txt 3 chunks
361 361 bundling files: foo/file.txt 4 chunks
362 362 bundling files: foo/file.txt 5 chunks
363 363 bundling files: foo/file.txt 6 chunks
364 364 bundling files: foo/file.txt 7 chunks
365 365 bundling files: quux/file.py 8 chunks
366 366 bundling files: quux/file.py 9 chunks
367 367 bundling files: quux/file.py 10 chunks
368 368 bundling files: quux/file.py 11 chunks
369 369 changesets: 1 chunks
370 370 add changeset ef1ea85a6374
371 371 changesets: 2 chunks
372 372 add changeset f9cafe1212c8
373 373 changesets: 3 chunks
374 374 add changeset 911600dab2ae
375 375 adding manifests
376 376 manifests: 1/3 chunks (33.33%)
377 377 manifests: 2/3 chunks (66.67%)
378 378 manifests: 3/3 chunks (100.00%)
379 379 adding file changes
380 380 adding foo/Bar/file.txt revisions
381 381 files: 1/3 chunks (33.33%)
382 382 adding foo/file.txt revisions
383 383 files: 2/3 chunks (66.67%)
384 384 adding quux/file.py revisions
385 385 files: 3/3 chunks (100.00%)
386 386 added 3 changesets with 3 changes to 3 files
387 387 calling hook pretxnchangegroup.acl: hgext.acl.hook
388 388 acl: acl.allow.branches not enabled
389 389 acl: acl.deny.branches not enabled
390 390 acl: acl.allow enabled, 0 entries for user fred
391 391 acl: acl.deny not enabled
392 392 acl: branch access granted: "ef1ea85a6374" on branch "default"
393 393 acl: user fred not allowed on foo/file.txt
394 394 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
395 395 transaction abort!
396 396 rollback completed
397 397 abort: acl: access denied for changeset ef1ea85a6374
398 398 no rollback information available
399 399 0:6675d58eff77
400 400
401 401
402 402 fred is allowed inside foo/
403 403
404 404 $ echo 'foo/** = fred' >> $config
405 405 $ do_push fred
406 406 Pushing as user fred
407 407 hgrc = """
408 408 [hooks]
409 409 pretxnchangegroup.acl = python:hgext.acl.hook
410 410 [acl]
411 411 sources = push
412 412 [acl.allow]
413 413 foo/** = fred
414 414 """
415 415 pushing to ../b
416 416 searching for changes
417 417 common changesets up to 6675d58eff77
418 418 3 changesets found
419 419 list of changesets:
420 420 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
421 421 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
422 422 911600dab2ae7a9baff75958b84fe606851ce955
423 423 adding changesets
424 424 bundling changes: 0 chunks
425 425 bundling changes: 1 chunks
426 426 bundling changes: 2 chunks
427 427 bundling changes: 3 chunks
428 428 bundling changes: 4 chunks
429 429 bundling changes: 5 chunks
430 430 bundling changes: 6 chunks
431 431 bundling changes: 7 chunks
432 432 bundling changes: 8 chunks
433 433 bundling changes: 9 chunks
434 434 bundling manifests: 0 chunks
435 435 bundling manifests: 1 chunks
436 436 bundling manifests: 2 chunks
437 437 bundling manifests: 3 chunks
438 438 bundling manifests: 4 chunks
439 439 bundling manifests: 5 chunks
440 440 bundling manifests: 6 chunks
441 441 bundling manifests: 7 chunks
442 442 bundling manifests: 8 chunks
443 443 bundling manifests: 9 chunks
444 444 bundling files: foo/Bar/file.txt 0 chunks
445 445 bundling files: foo/Bar/file.txt 1 chunks
446 446 bundling files: foo/Bar/file.txt 2 chunks
447 447 bundling files: foo/Bar/file.txt 3 chunks
448 448 bundling files: foo/file.txt 4 chunks
449 449 bundling files: foo/file.txt 5 chunks
450 450 bundling files: foo/file.txt 6 chunks
451 451 bundling files: foo/file.txt 7 chunks
452 452 bundling files: quux/file.py 8 chunks
453 453 bundling files: quux/file.py 9 chunks
454 454 bundling files: quux/file.py 10 chunks
455 455 bundling files: quux/file.py 11 chunks
456 456 changesets: 1 chunks
457 457 add changeset ef1ea85a6374
458 458 changesets: 2 chunks
459 459 add changeset f9cafe1212c8
460 460 changesets: 3 chunks
461 461 add changeset 911600dab2ae
462 462 adding manifests
463 463 manifests: 1/3 chunks (33.33%)
464 464 manifests: 2/3 chunks (66.67%)
465 465 manifests: 3/3 chunks (100.00%)
466 466 adding file changes
467 467 adding foo/Bar/file.txt revisions
468 468 files: 1/3 chunks (33.33%)
469 469 adding foo/file.txt revisions
470 470 files: 2/3 chunks (66.67%)
471 471 adding quux/file.py revisions
472 472 files: 3/3 chunks (100.00%)
473 473 added 3 changesets with 3 changes to 3 files
474 474 calling hook pretxnchangegroup.acl: hgext.acl.hook
475 475 acl: acl.allow.branches not enabled
476 476 acl: acl.deny.branches not enabled
477 477 acl: acl.allow enabled, 1 entries for user fred
478 478 acl: acl.deny not enabled
479 479 acl: branch access granted: "ef1ea85a6374" on branch "default"
480 480 acl: allowing changeset ef1ea85a6374
481 481 acl: branch access granted: "f9cafe1212c8" on branch "default"
482 482 acl: allowing changeset f9cafe1212c8
483 483 acl: branch access granted: "911600dab2ae" on branch "default"
484 484 acl: user fred not allowed on quux/file.py
485 485 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
486 486 transaction abort!
487 487 rollback completed
488 488 abort: acl: access denied for changeset 911600dab2ae
489 489 no rollback information available
490 490 0:6675d58eff77
491 491
492 492
493 493 Empty [acl.deny]
494 494
495 495 $ echo '[acl.deny]' >> $config
496 496 $ do_push barney
497 497 Pushing as user barney
498 498 hgrc = """
499 499 [hooks]
500 500 pretxnchangegroup.acl = python:hgext.acl.hook
501 501 [acl]
502 502 sources = push
503 503 [acl.allow]
504 504 foo/** = fred
505 505 [acl.deny]
506 506 """
507 507 pushing to ../b
508 508 searching for changes
509 509 common changesets up to 6675d58eff77
510 510 3 changesets found
511 511 list of changesets:
512 512 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
513 513 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
514 514 911600dab2ae7a9baff75958b84fe606851ce955
515 515 adding changesets
516 516 bundling changes: 0 chunks
517 517 bundling changes: 1 chunks
518 518 bundling changes: 2 chunks
519 519 bundling changes: 3 chunks
520 520 bundling changes: 4 chunks
521 521 bundling changes: 5 chunks
522 522 bundling changes: 6 chunks
523 523 bundling changes: 7 chunks
524 524 bundling changes: 8 chunks
525 525 bundling changes: 9 chunks
526 526 bundling manifests: 0 chunks
527 527 bundling manifests: 1 chunks
528 528 bundling manifests: 2 chunks
529 529 bundling manifests: 3 chunks
530 530 bundling manifests: 4 chunks
531 531 bundling manifests: 5 chunks
532 532 bundling manifests: 6 chunks
533 533 bundling manifests: 7 chunks
534 534 bundling manifests: 8 chunks
535 535 bundling manifests: 9 chunks
536 536 bundling files: foo/Bar/file.txt 0 chunks
537 537 bundling files: foo/Bar/file.txt 1 chunks
538 538 bundling files: foo/Bar/file.txt 2 chunks
539 539 bundling files: foo/Bar/file.txt 3 chunks
540 540 bundling files: foo/file.txt 4 chunks
541 541 bundling files: foo/file.txt 5 chunks
542 542 bundling files: foo/file.txt 6 chunks
543 543 bundling files: foo/file.txt 7 chunks
544 544 bundling files: quux/file.py 8 chunks
545 545 bundling files: quux/file.py 9 chunks
546 546 bundling files: quux/file.py 10 chunks
547 547 bundling files: quux/file.py 11 chunks
548 548 changesets: 1 chunks
549 549 add changeset ef1ea85a6374
550 550 changesets: 2 chunks
551 551 add changeset f9cafe1212c8
552 552 changesets: 3 chunks
553 553 add changeset 911600dab2ae
554 554 adding manifests
555 555 manifests: 1/3 chunks (33.33%)
556 556 manifests: 2/3 chunks (66.67%)
557 557 manifests: 3/3 chunks (100.00%)
558 558 adding file changes
559 559 adding foo/Bar/file.txt revisions
560 560 files: 1/3 chunks (33.33%)
561 561 adding foo/file.txt revisions
562 562 files: 2/3 chunks (66.67%)
563 563 adding quux/file.py revisions
564 564 files: 3/3 chunks (100.00%)
565 565 added 3 changesets with 3 changes to 3 files
566 566 calling hook pretxnchangegroup.acl: hgext.acl.hook
567 567 acl: acl.allow.branches not enabled
568 568 acl: acl.deny.branches not enabled
569 569 acl: acl.allow enabled, 0 entries for user barney
570 570 acl: acl.deny enabled, 0 entries for user barney
571 571 acl: branch access granted: "ef1ea85a6374" on branch "default"
572 572 acl: user barney not allowed on foo/file.txt
573 573 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
574 574 transaction abort!
575 575 rollback completed
576 576 abort: acl: access denied for changeset ef1ea85a6374
577 577 no rollback information available
578 578 0:6675d58eff77
579 579
580 580
581 581 fred is allowed inside foo/, but not foo/bar/ (case matters)
582 582
583 583 $ echo 'foo/bar/** = fred' >> $config
584 584 $ do_push fred
585 585 Pushing as user fred
586 586 hgrc = """
587 587 [hooks]
588 588 pretxnchangegroup.acl = python:hgext.acl.hook
589 589 [acl]
590 590 sources = push
591 591 [acl.allow]
592 592 foo/** = fred
593 593 [acl.deny]
594 594 foo/bar/** = fred
595 595 """
596 596 pushing to ../b
597 597 searching for changes
598 598 common changesets up to 6675d58eff77
599 599 3 changesets found
600 600 list of changesets:
601 601 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
602 602 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
603 603 911600dab2ae7a9baff75958b84fe606851ce955
604 604 adding changesets
605 605 bundling changes: 0 chunks
606 606 bundling changes: 1 chunks
607 607 bundling changes: 2 chunks
608 608 bundling changes: 3 chunks
609 609 bundling changes: 4 chunks
610 610 bundling changes: 5 chunks
611 611 bundling changes: 6 chunks
612 612 bundling changes: 7 chunks
613 613 bundling changes: 8 chunks
614 614 bundling changes: 9 chunks
615 615 bundling manifests: 0 chunks
616 616 bundling manifests: 1 chunks
617 617 bundling manifests: 2 chunks
618 618 bundling manifests: 3 chunks
619 619 bundling manifests: 4 chunks
620 620 bundling manifests: 5 chunks
621 621 bundling manifests: 6 chunks
622 622 bundling manifests: 7 chunks
623 623 bundling manifests: 8 chunks
624 624 bundling manifests: 9 chunks
625 625 bundling files: foo/Bar/file.txt 0 chunks
626 626 bundling files: foo/Bar/file.txt 1 chunks
627 627 bundling files: foo/Bar/file.txt 2 chunks
628 628 bundling files: foo/Bar/file.txt 3 chunks
629 629 bundling files: foo/file.txt 4 chunks
630 630 bundling files: foo/file.txt 5 chunks
631 631 bundling files: foo/file.txt 6 chunks
632 632 bundling files: foo/file.txt 7 chunks
633 633 bundling files: quux/file.py 8 chunks
634 634 bundling files: quux/file.py 9 chunks
635 635 bundling files: quux/file.py 10 chunks
636 636 bundling files: quux/file.py 11 chunks
637 637 changesets: 1 chunks
638 638 add changeset ef1ea85a6374
639 639 changesets: 2 chunks
640 640 add changeset f9cafe1212c8
641 641 changesets: 3 chunks
642 642 add changeset 911600dab2ae
643 643 adding manifests
644 644 manifests: 1/3 chunks (33.33%)
645 645 manifests: 2/3 chunks (66.67%)
646 646 manifests: 3/3 chunks (100.00%)
647 647 adding file changes
648 648 adding foo/Bar/file.txt revisions
649 649 files: 1/3 chunks (33.33%)
650 650 adding foo/file.txt revisions
651 651 files: 2/3 chunks (66.67%)
652 652 adding quux/file.py revisions
653 653 files: 3/3 chunks (100.00%)
654 654 added 3 changesets with 3 changes to 3 files
655 655 calling hook pretxnchangegroup.acl: hgext.acl.hook
656 656 acl: acl.allow.branches not enabled
657 657 acl: acl.deny.branches not enabled
658 658 acl: acl.allow enabled, 1 entries for user fred
659 659 acl: acl.deny enabled, 1 entries for user fred
660 660 acl: branch access granted: "ef1ea85a6374" on branch "default"
661 661 acl: allowing changeset ef1ea85a6374
662 662 acl: branch access granted: "f9cafe1212c8" on branch "default"
663 663 acl: allowing changeset f9cafe1212c8
664 664 acl: branch access granted: "911600dab2ae" on branch "default"
665 665 acl: user fred not allowed on quux/file.py
666 666 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
667 667 transaction abort!
668 668 rollback completed
669 669 abort: acl: access denied for changeset 911600dab2ae
670 670 no rollback information available
671 671 0:6675d58eff77
672 672
673 673
674 674 fred is allowed inside foo/, but not foo/Bar/
675 675
676 676 $ echo 'foo/Bar/** = fred' >> $config
677 677 $ do_push fred
678 678 Pushing as user fred
679 679 hgrc = """
680 680 [hooks]
681 681 pretxnchangegroup.acl = python:hgext.acl.hook
682 682 [acl]
683 683 sources = push
684 684 [acl.allow]
685 685 foo/** = fred
686 686 [acl.deny]
687 687 foo/bar/** = fred
688 688 foo/Bar/** = fred
689 689 """
690 690 pushing to ../b
691 691 searching for changes
692 692 common changesets up to 6675d58eff77
693 693 3 changesets found
694 694 list of changesets:
695 695 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
696 696 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
697 697 911600dab2ae7a9baff75958b84fe606851ce955
698 698 adding changesets
699 699 bundling changes: 0 chunks
700 700 bundling changes: 1 chunks
701 701 bundling changes: 2 chunks
702 702 bundling changes: 3 chunks
703 703 bundling changes: 4 chunks
704 704 bundling changes: 5 chunks
705 705 bundling changes: 6 chunks
706 706 bundling changes: 7 chunks
707 707 bundling changes: 8 chunks
708 708 bundling changes: 9 chunks
709 709 bundling manifests: 0 chunks
710 710 bundling manifests: 1 chunks
711 711 bundling manifests: 2 chunks
712 712 bundling manifests: 3 chunks
713 713 bundling manifests: 4 chunks
714 714 bundling manifests: 5 chunks
715 715 bundling manifests: 6 chunks
716 716 bundling manifests: 7 chunks
717 717 bundling manifests: 8 chunks
718 718 bundling manifests: 9 chunks
719 719 bundling files: foo/Bar/file.txt 0 chunks
720 720 bundling files: foo/Bar/file.txt 1 chunks
721 721 bundling files: foo/Bar/file.txt 2 chunks
722 722 bundling files: foo/Bar/file.txt 3 chunks
723 723 bundling files: foo/file.txt 4 chunks
724 724 bundling files: foo/file.txt 5 chunks
725 725 bundling files: foo/file.txt 6 chunks
726 726 bundling files: foo/file.txt 7 chunks
727 727 bundling files: quux/file.py 8 chunks
728 728 bundling files: quux/file.py 9 chunks
729 729 bundling files: quux/file.py 10 chunks
730 730 bundling files: quux/file.py 11 chunks
731 731 changesets: 1 chunks
732 732 add changeset ef1ea85a6374
733 733 changesets: 2 chunks
734 734 add changeset f9cafe1212c8
735 735 changesets: 3 chunks
736 736 add changeset 911600dab2ae
737 737 adding manifests
738 738 manifests: 1/3 chunks (33.33%)
739 739 manifests: 2/3 chunks (66.67%)
740 740 manifests: 3/3 chunks (100.00%)
741 741 adding file changes
742 742 adding foo/Bar/file.txt revisions
743 743 files: 1/3 chunks (33.33%)
744 744 adding foo/file.txt revisions
745 745 files: 2/3 chunks (66.67%)
746 746 adding quux/file.py revisions
747 747 files: 3/3 chunks (100.00%)
748 748 added 3 changesets with 3 changes to 3 files
749 749 calling hook pretxnchangegroup.acl: hgext.acl.hook
750 750 acl: acl.allow.branches not enabled
751 751 acl: acl.deny.branches not enabled
752 752 acl: acl.allow enabled, 1 entries for user fred
753 753 acl: acl.deny enabled, 2 entries for user fred
754 754 acl: branch access granted: "ef1ea85a6374" on branch "default"
755 755 acl: allowing changeset ef1ea85a6374
756 756 acl: branch access granted: "f9cafe1212c8" on branch "default"
757 757 acl: user fred denied on foo/Bar/file.txt
758 758 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
759 759 transaction abort!
760 760 rollback completed
761 761 abort: acl: access denied for changeset f9cafe1212c8
762 762 no rollback information available
763 763 0:6675d58eff77
764 764
765 765
766 766 $ echo 'barney is not mentioned => not allowed anywhere'
767 767 barney is not mentioned => not allowed anywhere
768 768 $ do_push barney
769 769 Pushing as user barney
770 770 hgrc = """
771 771 [hooks]
772 772 pretxnchangegroup.acl = python:hgext.acl.hook
773 773 [acl]
774 774 sources = push
775 775 [acl.allow]
776 776 foo/** = fred
777 777 [acl.deny]
778 778 foo/bar/** = fred
779 779 foo/Bar/** = fred
780 780 """
781 781 pushing to ../b
782 782 searching for changes
783 783 common changesets up to 6675d58eff77
784 784 3 changesets found
785 785 list of changesets:
786 786 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
787 787 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
788 788 911600dab2ae7a9baff75958b84fe606851ce955
789 789 adding changesets
790 790 bundling changes: 0 chunks
791 791 bundling changes: 1 chunks
792 792 bundling changes: 2 chunks
793 793 bundling changes: 3 chunks
794 794 bundling changes: 4 chunks
795 795 bundling changes: 5 chunks
796 796 bundling changes: 6 chunks
797 797 bundling changes: 7 chunks
798 798 bundling changes: 8 chunks
799 799 bundling changes: 9 chunks
800 800 bundling manifests: 0 chunks
801 801 bundling manifests: 1 chunks
802 802 bundling manifests: 2 chunks
803 803 bundling manifests: 3 chunks
804 804 bundling manifests: 4 chunks
805 805 bundling manifests: 5 chunks
806 806 bundling manifests: 6 chunks
807 807 bundling manifests: 7 chunks
808 808 bundling manifests: 8 chunks
809 809 bundling manifests: 9 chunks
810 810 bundling files: foo/Bar/file.txt 0 chunks
811 811 bundling files: foo/Bar/file.txt 1 chunks
812 812 bundling files: foo/Bar/file.txt 2 chunks
813 813 bundling files: foo/Bar/file.txt 3 chunks
814 814 bundling files: foo/file.txt 4 chunks
815 815 bundling files: foo/file.txt 5 chunks
816 816 bundling files: foo/file.txt 6 chunks
817 817 bundling files: foo/file.txt 7 chunks
818 818 bundling files: quux/file.py 8 chunks
819 819 bundling files: quux/file.py 9 chunks
820 820 bundling files: quux/file.py 10 chunks
821 821 bundling files: quux/file.py 11 chunks
822 822 changesets: 1 chunks
823 823 add changeset ef1ea85a6374
824 824 changesets: 2 chunks
825 825 add changeset f9cafe1212c8
826 826 changesets: 3 chunks
827 827 add changeset 911600dab2ae
828 828 adding manifests
829 829 manifests: 1/3 chunks (33.33%)
830 830 manifests: 2/3 chunks (66.67%)
831 831 manifests: 3/3 chunks (100.00%)
832 832 adding file changes
833 833 adding foo/Bar/file.txt revisions
834 834 files: 1/3 chunks (33.33%)
835 835 adding foo/file.txt revisions
836 836 files: 2/3 chunks (66.67%)
837 837 adding quux/file.py revisions
838 838 files: 3/3 chunks (100.00%)
839 839 added 3 changesets with 3 changes to 3 files
840 840 calling hook pretxnchangegroup.acl: hgext.acl.hook
841 841 acl: acl.allow.branches not enabled
842 842 acl: acl.deny.branches not enabled
843 843 acl: acl.allow enabled, 0 entries for user barney
844 844 acl: acl.deny enabled, 0 entries for user barney
845 845 acl: branch access granted: "ef1ea85a6374" on branch "default"
846 846 acl: user barney not allowed on foo/file.txt
847 847 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
848 848 transaction abort!
849 849 rollback completed
850 850 abort: acl: access denied for changeset ef1ea85a6374
851 851 no rollback information available
852 852 0:6675d58eff77
853 853
854 854
855 855 barney is allowed everywhere
856 856
857 857 $ echo '[acl.allow]' >> $config
858 858 $ echo '** = barney' >> $config
859 859 $ do_push barney
860 860 Pushing as user barney
861 861 hgrc = """
862 862 [hooks]
863 863 pretxnchangegroup.acl = python:hgext.acl.hook
864 864 [acl]
865 865 sources = push
866 866 [acl.allow]
867 867 foo/** = fred
868 868 [acl.deny]
869 869 foo/bar/** = fred
870 870 foo/Bar/** = fred
871 871 [acl.allow]
872 872 ** = barney
873 873 """
874 874 pushing to ../b
875 875 searching for changes
876 876 common changesets up to 6675d58eff77
877 877 3 changesets found
878 878 list of changesets:
879 879 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
880 880 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
881 881 911600dab2ae7a9baff75958b84fe606851ce955
882 882 adding changesets
883 883 bundling changes: 0 chunks
884 884 bundling changes: 1 chunks
885 885 bundling changes: 2 chunks
886 886 bundling changes: 3 chunks
887 887 bundling changes: 4 chunks
888 888 bundling changes: 5 chunks
889 889 bundling changes: 6 chunks
890 890 bundling changes: 7 chunks
891 891 bundling changes: 8 chunks
892 892 bundling changes: 9 chunks
893 893 bundling manifests: 0 chunks
894 894 bundling manifests: 1 chunks
895 895 bundling manifests: 2 chunks
896 896 bundling manifests: 3 chunks
897 897 bundling manifests: 4 chunks
898 898 bundling manifests: 5 chunks
899 899 bundling manifests: 6 chunks
900 900 bundling manifests: 7 chunks
901 901 bundling manifests: 8 chunks
902 902 bundling manifests: 9 chunks
903 903 bundling files: foo/Bar/file.txt 0 chunks
904 904 bundling files: foo/Bar/file.txt 1 chunks
905 905 bundling files: foo/Bar/file.txt 2 chunks
906 906 bundling files: foo/Bar/file.txt 3 chunks
907 907 bundling files: foo/file.txt 4 chunks
908 908 bundling files: foo/file.txt 5 chunks
909 909 bundling files: foo/file.txt 6 chunks
910 910 bundling files: foo/file.txt 7 chunks
911 911 bundling files: quux/file.py 8 chunks
912 912 bundling files: quux/file.py 9 chunks
913 913 bundling files: quux/file.py 10 chunks
914 914 bundling files: quux/file.py 11 chunks
915 915 changesets: 1 chunks
916 916 add changeset ef1ea85a6374
917 917 changesets: 2 chunks
918 918 add changeset f9cafe1212c8
919 919 changesets: 3 chunks
920 920 add changeset 911600dab2ae
921 921 adding manifests
922 922 manifests: 1/3 chunks (33.33%)
923 923 manifests: 2/3 chunks (66.67%)
924 924 manifests: 3/3 chunks (100.00%)
925 925 adding file changes
926 926 adding foo/Bar/file.txt revisions
927 927 files: 1/3 chunks (33.33%)
928 928 adding foo/file.txt revisions
929 929 files: 2/3 chunks (66.67%)
930 930 adding quux/file.py revisions
931 931 files: 3/3 chunks (100.00%)
932 932 added 3 changesets with 3 changes to 3 files
933 933 calling hook pretxnchangegroup.acl: hgext.acl.hook
934 934 acl: acl.allow.branches not enabled
935 935 acl: acl.deny.branches not enabled
936 936 acl: acl.allow enabled, 1 entries for user barney
937 937 acl: acl.deny enabled, 0 entries for user barney
938 938 acl: branch access granted: "ef1ea85a6374" on branch "default"
939 939 acl: allowing changeset ef1ea85a6374
940 940 acl: branch access granted: "f9cafe1212c8" on branch "default"
941 941 acl: allowing changeset f9cafe1212c8
942 942 acl: branch access granted: "911600dab2ae" on branch "default"
943 943 acl: allowing changeset 911600dab2ae
944 944 updating the branch cache
945 945 rolling back to revision 0 (undo push)
946 946 0:6675d58eff77
947 947
948 948
949 949 wilma can change files with a .txt extension
950 950
951 951 $ echo '**/*.txt = wilma' >> $config
952 952 $ do_push wilma
953 953 Pushing as user wilma
954 954 hgrc = """
955 955 [hooks]
956 956 pretxnchangegroup.acl = python:hgext.acl.hook
957 957 [acl]
958 958 sources = push
959 959 [acl.allow]
960 960 foo/** = fred
961 961 [acl.deny]
962 962 foo/bar/** = fred
963 963 foo/Bar/** = fred
964 964 [acl.allow]
965 965 ** = barney
966 966 **/*.txt = wilma
967 967 """
968 968 pushing to ../b
969 969 searching for changes
970 970 common changesets up to 6675d58eff77
971 971 invalidating branch cache (tip differs)
972 972 3 changesets found
973 973 list of changesets:
974 974 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
975 975 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
976 976 911600dab2ae7a9baff75958b84fe606851ce955
977 977 adding changesets
978 978 bundling changes: 0 chunks
979 979 bundling changes: 1 chunks
980 980 bundling changes: 2 chunks
981 981 bundling changes: 3 chunks
982 982 bundling changes: 4 chunks
983 983 bundling changes: 5 chunks
984 984 bundling changes: 6 chunks
985 985 bundling changes: 7 chunks
986 986 bundling changes: 8 chunks
987 987 bundling changes: 9 chunks
988 988 bundling manifests: 0 chunks
989 989 bundling manifests: 1 chunks
990 990 bundling manifests: 2 chunks
991 991 bundling manifests: 3 chunks
992 992 bundling manifests: 4 chunks
993 993 bundling manifests: 5 chunks
994 994 bundling manifests: 6 chunks
995 995 bundling manifests: 7 chunks
996 996 bundling manifests: 8 chunks
997 997 bundling manifests: 9 chunks
998 998 bundling files: foo/Bar/file.txt 0 chunks
999 999 bundling files: foo/Bar/file.txt 1 chunks
1000 1000 bundling files: foo/Bar/file.txt 2 chunks
1001 1001 bundling files: foo/Bar/file.txt 3 chunks
1002 1002 bundling files: foo/file.txt 4 chunks
1003 1003 bundling files: foo/file.txt 5 chunks
1004 1004 bundling files: foo/file.txt 6 chunks
1005 1005 bundling files: foo/file.txt 7 chunks
1006 1006 bundling files: quux/file.py 8 chunks
1007 1007 bundling files: quux/file.py 9 chunks
1008 1008 bundling files: quux/file.py 10 chunks
1009 1009 bundling files: quux/file.py 11 chunks
1010 1010 changesets: 1 chunks
1011 1011 add changeset ef1ea85a6374
1012 1012 changesets: 2 chunks
1013 1013 add changeset f9cafe1212c8
1014 1014 changesets: 3 chunks
1015 1015 add changeset 911600dab2ae
1016 1016 adding manifests
1017 1017 manifests: 1/3 chunks (33.33%)
1018 1018 manifests: 2/3 chunks (66.67%)
1019 1019 manifests: 3/3 chunks (100.00%)
1020 1020 adding file changes
1021 1021 adding foo/Bar/file.txt revisions
1022 1022 files: 1/3 chunks (33.33%)
1023 1023 adding foo/file.txt revisions
1024 1024 files: 2/3 chunks (66.67%)
1025 1025 adding quux/file.py revisions
1026 1026 files: 3/3 chunks (100.00%)
1027 1027 added 3 changesets with 3 changes to 3 files
1028 1028 calling hook pretxnchangegroup.acl: hgext.acl.hook
1029 1029 acl: acl.allow.branches not enabled
1030 1030 acl: acl.deny.branches not enabled
1031 1031 acl: acl.allow enabled, 1 entries for user wilma
1032 1032 acl: acl.deny enabled, 0 entries for user wilma
1033 1033 acl: branch access granted: "ef1ea85a6374" on branch "default"
1034 1034 acl: allowing changeset ef1ea85a6374
1035 1035 acl: branch access granted: "f9cafe1212c8" on branch "default"
1036 1036 acl: allowing changeset f9cafe1212c8
1037 1037 acl: branch access granted: "911600dab2ae" on branch "default"
1038 1038 acl: user wilma not allowed on quux/file.py
1039 1039 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
1040 1040 transaction abort!
1041 1041 rollback completed
1042 1042 abort: acl: access denied for changeset 911600dab2ae
1043 1043 no rollback information available
1044 1044 0:6675d58eff77
1045 1045
1046 1046
1047 1047 file specified by acl.config does not exist
1048 1048
1049 1049 $ echo '[acl]' >> $config
1050 1050 $ echo 'config = ../acl.config' >> $config
1051 1051 $ do_push barney
1052 1052 Pushing as user barney
1053 1053 hgrc = """
1054 1054 [hooks]
1055 1055 pretxnchangegroup.acl = python:hgext.acl.hook
1056 1056 [acl]
1057 1057 sources = push
1058 1058 [acl.allow]
1059 1059 foo/** = fred
1060 1060 [acl.deny]
1061 1061 foo/bar/** = fred
1062 1062 foo/Bar/** = fred
1063 1063 [acl.allow]
1064 1064 ** = barney
1065 1065 **/*.txt = wilma
1066 1066 [acl]
1067 1067 config = ../acl.config
1068 1068 """
1069 1069 pushing to ../b
1070 1070 searching for changes
1071 1071 common changesets up to 6675d58eff77
1072 1072 3 changesets found
1073 1073 list of changesets:
1074 1074 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1075 1075 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1076 1076 911600dab2ae7a9baff75958b84fe606851ce955
1077 1077 adding changesets
1078 1078 bundling changes: 0 chunks
1079 1079 bundling changes: 1 chunks
1080 1080 bundling changes: 2 chunks
1081 1081 bundling changes: 3 chunks
1082 1082 bundling changes: 4 chunks
1083 1083 bundling changes: 5 chunks
1084 1084 bundling changes: 6 chunks
1085 1085 bundling changes: 7 chunks
1086 1086 bundling changes: 8 chunks
1087 1087 bundling changes: 9 chunks
1088 1088 bundling manifests: 0 chunks
1089 1089 bundling manifests: 1 chunks
1090 1090 bundling manifests: 2 chunks
1091 1091 bundling manifests: 3 chunks
1092 1092 bundling manifests: 4 chunks
1093 1093 bundling manifests: 5 chunks
1094 1094 bundling manifests: 6 chunks
1095 1095 bundling manifests: 7 chunks
1096 1096 bundling manifests: 8 chunks
1097 1097 bundling manifests: 9 chunks
1098 1098 bundling files: foo/Bar/file.txt 0 chunks
1099 1099 bundling files: foo/Bar/file.txt 1 chunks
1100 1100 bundling files: foo/Bar/file.txt 2 chunks
1101 1101 bundling files: foo/Bar/file.txt 3 chunks
1102 1102 bundling files: foo/file.txt 4 chunks
1103 1103 bundling files: foo/file.txt 5 chunks
1104 1104 bundling files: foo/file.txt 6 chunks
1105 1105 bundling files: foo/file.txt 7 chunks
1106 1106 bundling files: quux/file.py 8 chunks
1107 1107 bundling files: quux/file.py 9 chunks
1108 1108 bundling files: quux/file.py 10 chunks
1109 1109 bundling files: quux/file.py 11 chunks
1110 1110 changesets: 1 chunks
1111 1111 add changeset ef1ea85a6374
1112 1112 changesets: 2 chunks
1113 1113 add changeset f9cafe1212c8
1114 1114 changesets: 3 chunks
1115 1115 add changeset 911600dab2ae
1116 1116 adding manifests
1117 1117 manifests: 1/3 chunks (33.33%)
1118 1118 manifests: 2/3 chunks (66.67%)
1119 1119 manifests: 3/3 chunks (100.00%)
1120 1120 adding file changes
1121 1121 adding foo/Bar/file.txt revisions
1122 1122 files: 1/3 chunks (33.33%)
1123 1123 adding foo/file.txt revisions
1124 1124 files: 2/3 chunks (66.67%)
1125 1125 adding quux/file.py revisions
1126 1126 files: 3/3 chunks (100.00%)
1127 1127 added 3 changesets with 3 changes to 3 files
1128 1128 calling hook pretxnchangegroup.acl: hgext.acl.hook
1129 1129 error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
1130 1130 transaction abort!
1131 1131 rollback completed
1132 1132 abort: No such file or directory: ../acl.config
1133 1133 no rollback information available
1134 1134 0:6675d58eff77
1135 1135
1136 1136
1137 1137 betty is allowed inside foo/ by a acl.config file
1138 1138
1139 1139 $ echo '[acl.allow]' >> acl.config
1140 1140 $ echo 'foo/** = betty' >> acl.config
1141 1141 $ do_push betty
1142 1142 Pushing as user betty
1143 1143 hgrc = """
1144 1144 [hooks]
1145 1145 pretxnchangegroup.acl = python:hgext.acl.hook
1146 1146 [acl]
1147 1147 sources = push
1148 1148 [acl.allow]
1149 1149 foo/** = fred
1150 1150 [acl.deny]
1151 1151 foo/bar/** = fred
1152 1152 foo/Bar/** = fred
1153 1153 [acl.allow]
1154 1154 ** = barney
1155 1155 **/*.txt = wilma
1156 1156 [acl]
1157 1157 config = ../acl.config
1158 1158 """
1159 1159 acl.config = """
1160 1160 [acl.allow]
1161 1161 foo/** = betty
1162 1162 """
1163 1163 pushing to ../b
1164 1164 searching for changes
1165 1165 common changesets up to 6675d58eff77
1166 1166 3 changesets found
1167 1167 list of changesets:
1168 1168 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1169 1169 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1170 1170 911600dab2ae7a9baff75958b84fe606851ce955
1171 1171 adding changesets
1172 1172 bundling changes: 0 chunks
1173 1173 bundling changes: 1 chunks
1174 1174 bundling changes: 2 chunks
1175 1175 bundling changes: 3 chunks
1176 1176 bundling changes: 4 chunks
1177 1177 bundling changes: 5 chunks
1178 1178 bundling changes: 6 chunks
1179 1179 bundling changes: 7 chunks
1180 1180 bundling changes: 8 chunks
1181 1181 bundling changes: 9 chunks
1182 1182 bundling manifests: 0 chunks
1183 1183 bundling manifests: 1 chunks
1184 1184 bundling manifests: 2 chunks
1185 1185 bundling manifests: 3 chunks
1186 1186 bundling manifests: 4 chunks
1187 1187 bundling manifests: 5 chunks
1188 1188 bundling manifests: 6 chunks
1189 1189 bundling manifests: 7 chunks
1190 1190 bundling manifests: 8 chunks
1191 1191 bundling manifests: 9 chunks
1192 1192 bundling files: foo/Bar/file.txt 0 chunks
1193 1193 bundling files: foo/Bar/file.txt 1 chunks
1194 1194 bundling files: foo/Bar/file.txt 2 chunks
1195 1195 bundling files: foo/Bar/file.txt 3 chunks
1196 1196 bundling files: foo/file.txt 4 chunks
1197 1197 bundling files: foo/file.txt 5 chunks
1198 1198 bundling files: foo/file.txt 6 chunks
1199 1199 bundling files: foo/file.txt 7 chunks
1200 1200 bundling files: quux/file.py 8 chunks
1201 1201 bundling files: quux/file.py 9 chunks
1202 1202 bundling files: quux/file.py 10 chunks
1203 1203 bundling files: quux/file.py 11 chunks
1204 1204 changesets: 1 chunks
1205 1205 add changeset ef1ea85a6374
1206 1206 changesets: 2 chunks
1207 1207 add changeset f9cafe1212c8
1208 1208 changesets: 3 chunks
1209 1209 add changeset 911600dab2ae
1210 1210 adding manifests
1211 1211 manifests: 1/3 chunks (33.33%)
1212 1212 manifests: 2/3 chunks (66.67%)
1213 1213 manifests: 3/3 chunks (100.00%)
1214 1214 adding file changes
1215 1215 adding foo/Bar/file.txt revisions
1216 1216 files: 1/3 chunks (33.33%)
1217 1217 adding foo/file.txt revisions
1218 1218 files: 2/3 chunks (66.67%)
1219 1219 adding quux/file.py revisions
1220 1220 files: 3/3 chunks (100.00%)
1221 1221 added 3 changesets with 3 changes to 3 files
1222 1222 calling hook pretxnchangegroup.acl: hgext.acl.hook
1223 1223 acl: acl.allow.branches not enabled
1224 1224 acl: acl.deny.branches not enabled
1225 1225 acl: acl.allow enabled, 1 entries for user betty
1226 1226 acl: acl.deny enabled, 0 entries for user betty
1227 1227 acl: branch access granted: "ef1ea85a6374" on branch "default"
1228 1228 acl: allowing changeset ef1ea85a6374
1229 1229 acl: branch access granted: "f9cafe1212c8" on branch "default"
1230 1230 acl: allowing changeset f9cafe1212c8
1231 1231 acl: branch access granted: "911600dab2ae" on branch "default"
1232 1232 acl: user betty not allowed on quux/file.py
1233 1233 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
1234 1234 transaction abort!
1235 1235 rollback completed
1236 1236 abort: acl: access denied for changeset 911600dab2ae
1237 1237 no rollback information available
1238 1238 0:6675d58eff77
1239 1239
1240 1240
1241 1241 acl.config can set only [acl.allow]/[acl.deny]
1242 1242
1243 1243 $ echo '[hooks]' >> acl.config
1244 1244 $ echo 'changegroup.acl = false' >> acl.config
1245 1245 $ do_push barney
1246 1246 Pushing as user barney
1247 1247 hgrc = """
1248 1248 [hooks]
1249 1249 pretxnchangegroup.acl = python:hgext.acl.hook
1250 1250 [acl]
1251 1251 sources = push
1252 1252 [acl.allow]
1253 1253 foo/** = fred
1254 1254 [acl.deny]
1255 1255 foo/bar/** = fred
1256 1256 foo/Bar/** = fred
1257 1257 [acl.allow]
1258 1258 ** = barney
1259 1259 **/*.txt = wilma
1260 1260 [acl]
1261 1261 config = ../acl.config
1262 1262 """
1263 1263 acl.config = """
1264 1264 [acl.allow]
1265 1265 foo/** = betty
1266 1266 [hooks]
1267 1267 changegroup.acl = false
1268 1268 """
1269 1269 pushing to ../b
1270 1270 searching for changes
1271 1271 common changesets up to 6675d58eff77
1272 1272 3 changesets found
1273 1273 list of changesets:
1274 1274 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1275 1275 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1276 1276 911600dab2ae7a9baff75958b84fe606851ce955
1277 1277 adding changesets
1278 1278 bundling changes: 0 chunks
1279 1279 bundling changes: 1 chunks
1280 1280 bundling changes: 2 chunks
1281 1281 bundling changes: 3 chunks
1282 1282 bundling changes: 4 chunks
1283 1283 bundling changes: 5 chunks
1284 1284 bundling changes: 6 chunks
1285 1285 bundling changes: 7 chunks
1286 1286 bundling changes: 8 chunks
1287 1287 bundling changes: 9 chunks
1288 1288 bundling manifests: 0 chunks
1289 1289 bundling manifests: 1 chunks
1290 1290 bundling manifests: 2 chunks
1291 1291 bundling manifests: 3 chunks
1292 1292 bundling manifests: 4 chunks
1293 1293 bundling manifests: 5 chunks
1294 1294 bundling manifests: 6 chunks
1295 1295 bundling manifests: 7 chunks
1296 1296 bundling manifests: 8 chunks
1297 1297 bundling manifests: 9 chunks
1298 1298 bundling files: foo/Bar/file.txt 0 chunks
1299 1299 bundling files: foo/Bar/file.txt 1 chunks
1300 1300 bundling files: foo/Bar/file.txt 2 chunks
1301 1301 bundling files: foo/Bar/file.txt 3 chunks
1302 1302 bundling files: foo/file.txt 4 chunks
1303 1303 bundling files: foo/file.txt 5 chunks
1304 1304 bundling files: foo/file.txt 6 chunks
1305 1305 bundling files: foo/file.txt 7 chunks
1306 1306 bundling files: quux/file.py 8 chunks
1307 1307 bundling files: quux/file.py 9 chunks
1308 1308 bundling files: quux/file.py 10 chunks
1309 1309 bundling files: quux/file.py 11 chunks
1310 1310 changesets: 1 chunks
1311 1311 add changeset ef1ea85a6374
1312 1312 changesets: 2 chunks
1313 1313 add changeset f9cafe1212c8
1314 1314 changesets: 3 chunks
1315 1315 add changeset 911600dab2ae
1316 1316 adding manifests
1317 1317 manifests: 1/3 chunks (33.33%)
1318 1318 manifests: 2/3 chunks (66.67%)
1319 1319 manifests: 3/3 chunks (100.00%)
1320 1320 adding file changes
1321 1321 adding foo/Bar/file.txt revisions
1322 1322 files: 1/3 chunks (33.33%)
1323 1323 adding foo/file.txt revisions
1324 1324 files: 2/3 chunks (66.67%)
1325 1325 adding quux/file.py revisions
1326 1326 files: 3/3 chunks (100.00%)
1327 1327 added 3 changesets with 3 changes to 3 files
1328 1328 calling hook pretxnchangegroup.acl: hgext.acl.hook
1329 1329 acl: acl.allow.branches not enabled
1330 1330 acl: acl.deny.branches not enabled
1331 1331 acl: acl.allow enabled, 1 entries for user barney
1332 1332 acl: acl.deny enabled, 0 entries for user barney
1333 1333 acl: branch access granted: "ef1ea85a6374" on branch "default"
1334 1334 acl: allowing changeset ef1ea85a6374
1335 1335 acl: branch access granted: "f9cafe1212c8" on branch "default"
1336 1336 acl: allowing changeset f9cafe1212c8
1337 1337 acl: branch access granted: "911600dab2ae" on branch "default"
1338 1338 acl: allowing changeset 911600dab2ae
1339 1339 updating the branch cache
1340 1340 rolling back to revision 0 (undo push)
1341 1341 0:6675d58eff77
1342 1342
1343 1343
1344 1344 asterisk
1345 1345
1346 1346 $ init_config
1347 1347
1348 1348 asterisk test
1349 1349
1350 1350 $ echo '[acl.allow]' >> $config
1351 1351 $ echo "** = fred" >> $config
1352 1352
1353 1353 fred is always allowed
1354 1354
1355 1355 $ do_push fred
1356 1356 Pushing as user fred
1357 1357 hgrc = """
1358 1358 [acl]
1359 1359 sources = push
1360 1360 [extensions]
1361 1361 [acl.allow]
1362 1362 ** = fred
1363 1363 """
1364 1364 pushing to ../b
1365 1365 searching for changes
1366 1366 common changesets up to 6675d58eff77
1367 1367 invalidating branch cache (tip differs)
1368 1368 3 changesets found
1369 1369 list of changesets:
1370 1370 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1371 1371 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1372 1372 911600dab2ae7a9baff75958b84fe606851ce955
1373 1373 adding changesets
1374 1374 bundling changes: 0 chunks
1375 1375 bundling changes: 1 chunks
1376 1376 bundling changes: 2 chunks
1377 1377 bundling changes: 3 chunks
1378 1378 bundling changes: 4 chunks
1379 1379 bundling changes: 5 chunks
1380 1380 bundling changes: 6 chunks
1381 1381 bundling changes: 7 chunks
1382 1382 bundling changes: 8 chunks
1383 1383 bundling changes: 9 chunks
1384 1384 bundling manifests: 0 chunks
1385 1385 bundling manifests: 1 chunks
1386 1386 bundling manifests: 2 chunks
1387 1387 bundling manifests: 3 chunks
1388 1388 bundling manifests: 4 chunks
1389 1389 bundling manifests: 5 chunks
1390 1390 bundling manifests: 6 chunks
1391 1391 bundling manifests: 7 chunks
1392 1392 bundling manifests: 8 chunks
1393 1393 bundling manifests: 9 chunks
1394 1394 bundling files: foo/Bar/file.txt 0 chunks
1395 1395 bundling files: foo/Bar/file.txt 1 chunks
1396 1396 bundling files: foo/Bar/file.txt 2 chunks
1397 1397 bundling files: foo/Bar/file.txt 3 chunks
1398 1398 bundling files: foo/file.txt 4 chunks
1399 1399 bundling files: foo/file.txt 5 chunks
1400 1400 bundling files: foo/file.txt 6 chunks
1401 1401 bundling files: foo/file.txt 7 chunks
1402 1402 bundling files: quux/file.py 8 chunks
1403 1403 bundling files: quux/file.py 9 chunks
1404 1404 bundling files: quux/file.py 10 chunks
1405 1405 bundling files: quux/file.py 11 chunks
1406 1406 changesets: 1 chunks
1407 1407 add changeset ef1ea85a6374
1408 1408 changesets: 2 chunks
1409 1409 add changeset f9cafe1212c8
1410 1410 changesets: 3 chunks
1411 1411 add changeset 911600dab2ae
1412 1412 adding manifests
1413 1413 manifests: 1/3 chunks (33.33%)
1414 1414 manifests: 2/3 chunks (66.67%)
1415 1415 manifests: 3/3 chunks (100.00%)
1416 1416 adding file changes
1417 1417 adding foo/Bar/file.txt revisions
1418 1418 files: 1/3 chunks (33.33%)
1419 1419 adding foo/file.txt revisions
1420 1420 files: 2/3 chunks (66.67%)
1421 1421 adding quux/file.py revisions
1422 1422 files: 3/3 chunks (100.00%)
1423 1423 added 3 changesets with 3 changes to 3 files
1424 1424 calling hook pretxnchangegroup.acl: hgext.acl.hook
1425 1425 acl: acl.allow.branches not enabled
1426 1426 acl: acl.deny.branches not enabled
1427 1427 acl: acl.allow enabled, 1 entries for user fred
1428 1428 acl: acl.deny not enabled
1429 1429 acl: branch access granted: "ef1ea85a6374" on branch "default"
1430 1430 acl: allowing changeset ef1ea85a6374
1431 1431 acl: branch access granted: "f9cafe1212c8" on branch "default"
1432 1432 acl: allowing changeset f9cafe1212c8
1433 1433 acl: branch access granted: "911600dab2ae" on branch "default"
1434 1434 acl: allowing changeset 911600dab2ae
1435 1435 updating the branch cache
1436 1436 rolling back to revision 0 (undo push)
1437 1437 0:6675d58eff77
1438 1438
1439 1439
1440 1440 $ echo '[acl.deny]' >> $config
1441 1441 $ echo "foo/Bar/** = *" >> $config
1442 1442
1443 1443 no one is allowed inside foo/Bar/
1444 1444
1445 1445 $ do_push fred
1446 1446 Pushing as user fred
1447 1447 hgrc = """
1448 1448 [acl]
1449 1449 sources = push
1450 1450 [extensions]
1451 1451 [acl.allow]
1452 1452 ** = fred
1453 1453 [acl.deny]
1454 1454 foo/Bar/** = *
1455 1455 """
1456 1456 pushing to ../b
1457 1457 searching for changes
1458 1458 common changesets up to 6675d58eff77
1459 1459 invalidating branch cache (tip differs)
1460 1460 3 changesets found
1461 1461 list of changesets:
1462 1462 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1463 1463 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1464 1464 911600dab2ae7a9baff75958b84fe606851ce955
1465 1465 adding changesets
1466 1466 bundling changes: 0 chunks
1467 1467 bundling changes: 1 chunks
1468 1468 bundling changes: 2 chunks
1469 1469 bundling changes: 3 chunks
1470 1470 bundling changes: 4 chunks
1471 1471 bundling changes: 5 chunks
1472 1472 bundling changes: 6 chunks
1473 1473 bundling changes: 7 chunks
1474 1474 bundling changes: 8 chunks
1475 1475 bundling changes: 9 chunks
1476 1476 bundling manifests: 0 chunks
1477 1477 bundling manifests: 1 chunks
1478 1478 bundling manifests: 2 chunks
1479 1479 bundling manifests: 3 chunks
1480 1480 bundling manifests: 4 chunks
1481 1481 bundling manifests: 5 chunks
1482 1482 bundling manifests: 6 chunks
1483 1483 bundling manifests: 7 chunks
1484 1484 bundling manifests: 8 chunks
1485 1485 bundling manifests: 9 chunks
1486 1486 bundling files: foo/Bar/file.txt 0 chunks
1487 1487 bundling files: foo/Bar/file.txt 1 chunks
1488 1488 bundling files: foo/Bar/file.txt 2 chunks
1489 1489 bundling files: foo/Bar/file.txt 3 chunks
1490 1490 bundling files: foo/file.txt 4 chunks
1491 1491 bundling files: foo/file.txt 5 chunks
1492 1492 bundling files: foo/file.txt 6 chunks
1493 1493 bundling files: foo/file.txt 7 chunks
1494 1494 bundling files: quux/file.py 8 chunks
1495 1495 bundling files: quux/file.py 9 chunks
1496 1496 bundling files: quux/file.py 10 chunks
1497 1497 bundling files: quux/file.py 11 chunks
1498 1498 changesets: 1 chunks
1499 1499 add changeset ef1ea85a6374
1500 1500 changesets: 2 chunks
1501 1501 add changeset f9cafe1212c8
1502 1502 changesets: 3 chunks
1503 1503 add changeset 911600dab2ae
1504 1504 adding manifests
1505 1505 manifests: 1/3 chunks (33.33%)
1506 1506 manifests: 2/3 chunks (66.67%)
1507 1507 manifests: 3/3 chunks (100.00%)
1508 1508 adding file changes
1509 1509 adding foo/Bar/file.txt revisions
1510 1510 files: 1/3 chunks (33.33%)
1511 1511 adding foo/file.txt revisions
1512 1512 files: 2/3 chunks (66.67%)
1513 1513 adding quux/file.py revisions
1514 1514 files: 3/3 chunks (100.00%)
1515 1515 added 3 changesets with 3 changes to 3 files
1516 1516 calling hook pretxnchangegroup.acl: hgext.acl.hook
1517 1517 acl: acl.allow.branches not enabled
1518 1518 acl: acl.deny.branches not enabled
1519 1519 acl: acl.allow enabled, 1 entries for user fred
1520 1520 acl: acl.deny enabled, 1 entries for user fred
1521 1521 acl: branch access granted: "ef1ea85a6374" on branch "default"
1522 1522 acl: allowing changeset ef1ea85a6374
1523 1523 acl: branch access granted: "f9cafe1212c8" on branch "default"
1524 1524 acl: user fred denied on foo/Bar/file.txt
1525 1525 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
1526 1526 transaction abort!
1527 1527 rollback completed
1528 1528 abort: acl: access denied for changeset f9cafe1212c8
1529 1529 no rollback information available
1530 1530 0:6675d58eff77
1531 1531
1532 1532
1533 1533 Groups
1534 1534
1535 1535 $ init_config
1536 1536
1537 1537 OS-level groups
1538 1538
1539 1539 $ echo '[acl.allow]' >> $config
1540 1540 $ echo "** = @group1" >> $config
1541 1541
1542 1542 @group1 is always allowed
1543 1543
1544 1544 $ do_push fred
1545 1545 Pushing as user fred
1546 1546 hgrc = """
1547 1547 [acl]
1548 1548 sources = push
1549 1549 [extensions]
1550 1550 [acl.allow]
1551 1551 ** = @group1
1552 1552 """
1553 1553 pushing to ../b
1554 1554 searching for changes
1555 1555 common changesets up to 6675d58eff77
1556 1556 3 changesets found
1557 1557 list of changesets:
1558 1558 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1559 1559 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1560 1560 911600dab2ae7a9baff75958b84fe606851ce955
1561 1561 adding changesets
1562 1562 bundling changes: 0 chunks
1563 1563 bundling changes: 1 chunks
1564 1564 bundling changes: 2 chunks
1565 1565 bundling changes: 3 chunks
1566 1566 bundling changes: 4 chunks
1567 1567 bundling changes: 5 chunks
1568 1568 bundling changes: 6 chunks
1569 1569 bundling changes: 7 chunks
1570 1570 bundling changes: 8 chunks
1571 1571 bundling changes: 9 chunks
1572 1572 bundling manifests: 0 chunks
1573 1573 bundling manifests: 1 chunks
1574 1574 bundling manifests: 2 chunks
1575 1575 bundling manifests: 3 chunks
1576 1576 bundling manifests: 4 chunks
1577 1577 bundling manifests: 5 chunks
1578 1578 bundling manifests: 6 chunks
1579 1579 bundling manifests: 7 chunks
1580 1580 bundling manifests: 8 chunks
1581 1581 bundling manifests: 9 chunks
1582 1582 bundling files: foo/Bar/file.txt 0 chunks
1583 1583 bundling files: foo/Bar/file.txt 1 chunks
1584 1584 bundling files: foo/Bar/file.txt 2 chunks
1585 1585 bundling files: foo/Bar/file.txt 3 chunks
1586 1586 bundling files: foo/file.txt 4 chunks
1587 1587 bundling files: foo/file.txt 5 chunks
1588 1588 bundling files: foo/file.txt 6 chunks
1589 1589 bundling files: foo/file.txt 7 chunks
1590 1590 bundling files: quux/file.py 8 chunks
1591 1591 bundling files: quux/file.py 9 chunks
1592 1592 bundling files: quux/file.py 10 chunks
1593 1593 bundling files: quux/file.py 11 chunks
1594 1594 changesets: 1 chunks
1595 1595 add changeset ef1ea85a6374
1596 1596 changesets: 2 chunks
1597 1597 add changeset f9cafe1212c8
1598 1598 changesets: 3 chunks
1599 1599 add changeset 911600dab2ae
1600 1600 adding manifests
1601 1601 manifests: 1/3 chunks (33.33%)
1602 1602 manifests: 2/3 chunks (66.67%)
1603 1603 manifests: 3/3 chunks (100.00%)
1604 1604 adding file changes
1605 1605 adding foo/Bar/file.txt revisions
1606 1606 files: 1/3 chunks (33.33%)
1607 1607 adding foo/file.txt revisions
1608 1608 files: 2/3 chunks (66.67%)
1609 1609 adding quux/file.py revisions
1610 1610 files: 3/3 chunks (100.00%)
1611 1611 added 3 changesets with 3 changes to 3 files
1612 1612 calling hook pretxnchangegroup.acl: hgext.acl.hook
1613 1613 acl: acl.allow.branches not enabled
1614 1614 acl: acl.deny.branches not enabled
1615 1615 acl: "group1" not defined in [acl.groups]
1616 1616 acl: acl.allow enabled, 1 entries for user fred
1617 1617 acl: acl.deny not enabled
1618 1618 acl: branch access granted: "ef1ea85a6374" on branch "default"
1619 1619 acl: allowing changeset ef1ea85a6374
1620 1620 acl: branch access granted: "f9cafe1212c8" on branch "default"
1621 1621 acl: allowing changeset f9cafe1212c8
1622 1622 acl: branch access granted: "911600dab2ae" on branch "default"
1623 1623 acl: allowing changeset 911600dab2ae
1624 1624 updating the branch cache
1625 1625 rolling back to revision 0 (undo push)
1626 1626 0:6675d58eff77
1627 1627
1628 1628
1629 1629 $ echo '[acl.deny]' >> $config
1630 1630 $ echo "foo/Bar/** = @group1" >> $config
1631 1631
1632 1632 @group is allowed inside anything but foo/Bar/
1633 1633
1634 1634 $ do_push fred
1635 1635 Pushing as user fred
1636 1636 hgrc = """
1637 1637 [acl]
1638 1638 sources = push
1639 1639 [extensions]
1640 1640 [acl.allow]
1641 1641 ** = @group1
1642 1642 [acl.deny]
1643 1643 foo/Bar/** = @group1
1644 1644 """
1645 1645 pushing to ../b
1646 1646 searching for changes
1647 1647 common changesets up to 6675d58eff77
1648 1648 invalidating branch cache (tip differs)
1649 1649 3 changesets found
1650 1650 list of changesets:
1651 1651 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1652 1652 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1653 1653 911600dab2ae7a9baff75958b84fe606851ce955
1654 1654 adding changesets
1655 1655 bundling changes: 0 chunks
1656 1656 bundling changes: 1 chunks
1657 1657 bundling changes: 2 chunks
1658 1658 bundling changes: 3 chunks
1659 1659 bundling changes: 4 chunks
1660 1660 bundling changes: 5 chunks
1661 1661 bundling changes: 6 chunks
1662 1662 bundling changes: 7 chunks
1663 1663 bundling changes: 8 chunks
1664 1664 bundling changes: 9 chunks
1665 1665 bundling manifests: 0 chunks
1666 1666 bundling manifests: 1 chunks
1667 1667 bundling manifests: 2 chunks
1668 1668 bundling manifests: 3 chunks
1669 1669 bundling manifests: 4 chunks
1670 1670 bundling manifests: 5 chunks
1671 1671 bundling manifests: 6 chunks
1672 1672 bundling manifests: 7 chunks
1673 1673 bundling manifests: 8 chunks
1674 1674 bundling manifests: 9 chunks
1675 1675 bundling files: foo/Bar/file.txt 0 chunks
1676 1676 bundling files: foo/Bar/file.txt 1 chunks
1677 1677 bundling files: foo/Bar/file.txt 2 chunks
1678 1678 bundling files: foo/Bar/file.txt 3 chunks
1679 1679 bundling files: foo/file.txt 4 chunks
1680 1680 bundling files: foo/file.txt 5 chunks
1681 1681 bundling files: foo/file.txt 6 chunks
1682 1682 bundling files: foo/file.txt 7 chunks
1683 1683 bundling files: quux/file.py 8 chunks
1684 1684 bundling files: quux/file.py 9 chunks
1685 1685 bundling files: quux/file.py 10 chunks
1686 1686 bundling files: quux/file.py 11 chunks
1687 1687 changesets: 1 chunks
1688 1688 add changeset ef1ea85a6374
1689 1689 changesets: 2 chunks
1690 1690 add changeset f9cafe1212c8
1691 1691 changesets: 3 chunks
1692 1692 add changeset 911600dab2ae
1693 1693 adding manifests
1694 1694 manifests: 1/3 chunks (33.33%)
1695 1695 manifests: 2/3 chunks (66.67%)
1696 1696 manifests: 3/3 chunks (100.00%)
1697 1697 adding file changes
1698 1698 adding foo/Bar/file.txt revisions
1699 1699 files: 1/3 chunks (33.33%)
1700 1700 adding foo/file.txt revisions
1701 1701 files: 2/3 chunks (66.67%)
1702 1702 adding quux/file.py revisions
1703 1703 files: 3/3 chunks (100.00%)
1704 1704 added 3 changesets with 3 changes to 3 files
1705 1705 calling hook pretxnchangegroup.acl: hgext.acl.hook
1706 1706 acl: acl.allow.branches not enabled
1707 1707 acl: acl.deny.branches not enabled
1708 1708 acl: "group1" not defined in [acl.groups]
1709 1709 acl: acl.allow enabled, 1 entries for user fred
1710 1710 acl: "group1" not defined in [acl.groups]
1711 1711 acl: acl.deny enabled, 1 entries for user fred
1712 1712 acl: branch access granted: "ef1ea85a6374" on branch "default"
1713 1713 acl: allowing changeset ef1ea85a6374
1714 1714 acl: branch access granted: "f9cafe1212c8" on branch "default"
1715 1715 acl: user fred denied on foo/Bar/file.txt
1716 1716 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
1717 1717 transaction abort!
1718 1718 rollback completed
1719 1719 abort: acl: access denied for changeset f9cafe1212c8
1720 1720 no rollback information available
1721 1721 0:6675d58eff77
1722 1722
1723 1723
1724 1724 Invalid group
1725 1725
1726 1726 Disable the fakegroups trick to get real failures
1727 1727
1728 1728 $ grep -v fakegroups $config > config.tmp
1729 1729 $ mv config.tmp $config
1730 1730 $ echo '[acl.allow]' >> $config
1731 1731 $ echo "** = @unlikelytoexist" >> $config
1732 1732 $ do_push fred 2>&1 | grep unlikelytoexist
1733 1733 ** = @unlikelytoexist
1734 1734 acl: "unlikelytoexist" not defined in [acl.groups]
1735 1735 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1736 1736 abort: group 'unlikelytoexist' is undefined
1737
1738 $ true
@@ -1,102 +1,100
1 1 $ hg init rep; cd rep
2 2
3 3 $ touch empty-file
4 4 $ python -c 'for x in range(10000): print x' > large-file
5 5
6 6 $ hg addremove
7 7 adding empty-file
8 8 adding large-file
9 9
10 10 $ hg commit -m A
11 11
12 12 $ rm large-file empty-file
13 13 $ python -c 'for x in range(10,10000): print x' > another-file
14 14
15 15 $ hg addremove -s50
16 16 adding another-file
17 17 removing empty-file
18 18 removing large-file
19 19 recording removal of large-file as rename to another-file (99% similar)
20 20
21 21 $ hg commit -m B
22 22
23 23 comparing two empty files caused ZeroDivisionError in the past
24 24
25 25 $ hg update -C 0
26 26 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 27 $ rm empty-file
28 28 $ touch another-empty-file
29 29 $ hg addremove -s50
30 30 adding another-empty-file
31 31 removing empty-file
32 32
33 33 $ cd ..
34 34
35 35 $ hg init rep2; cd rep2
36 36
37 37 $ python -c 'for x in range(10000): print x' > large-file
38 38 $ python -c 'for x in range(50): print x' > tiny-file
39 39
40 40 $ hg addremove
41 41 adding large-file
42 42 adding tiny-file
43 43
44 44 $ hg commit -m A
45 45
46 46 $ python -c 'for x in range(70): print x' > small-file
47 47 $ rm tiny-file
48 48 $ rm large-file
49 49
50 50 $ hg addremove -s50
51 51 removing large-file
52 52 adding small-file
53 53 removing tiny-file
54 54 recording removal of tiny-file as rename to small-file (82% similar)
55 55
56 56 $ hg commit -m B
57 57
58 58 should all fail
59 59
60 60 $ hg addremove -s foo
61 61 abort: similarity must be a number
62 62 [255]
63 63 $ hg addremove -s -1
64 64 abort: similarity must be between 0 and 100
65 65 [255]
66 66 $ hg addremove -s 1e6
67 67 abort: similarity must be between 0 and 100
68 68 [255]
69 69
70 70 $ cd ..
71 71
72 72 issue 1527
73 73
74 74 $ hg init rep3; cd rep3
75 75 $ mkdir d
76 76 $ echo a > d/a
77 77 $ hg add d/a
78 78 $ hg commit -m 1
79 79
80 80 $ mv d/a d/b
81 81 $ hg addremove -s80
82 82 removing d/a
83 83 adding d/b
84 84 recording removal of d/a as rename to d/b (100% similar)
85 85 $ hg debugstate
86 86 r 0 0 1970-01-01 00:00:00 d/a
87 87 a 0 -1 unset d/b
88 88 copy: d/a -> d/b
89 89 $ mv d/b c
90 90
91 91 no copies found here (since the target isn't in d
92 92
93 93 $ hg addremove -s80 d
94 94 removing d/b
95 95
96 96 copies here
97 97
98 98 $ hg addremove -s80
99 99 adding c
100 100 recording removal of d/a as rename to c (100% similar)
101
102 $ true
@@ -1,67 +1,66
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "bookmarks=" >> $HGRCPATH
3 3
4 4 $ echo "[bookmarks]" >> $HGRCPATH
5 5 $ echo "track.current = True" >> $HGRCPATH
6 6
7 7 initialize
8 8
9 9 $ hg init a
10 10 $ cd a
11 11 $ echo 'test' > test
12 12 $ hg commit -Am'test'
13 13 adding test
14 14
15 15 set bookmarks
16 16
17 17 $ hg bookmark X
18 18 $ hg bookmark Y
19 19 $ hg bookmark Z
20 20
21 21 import bookmark by name
22 22
23 23 $ hg init ../b
24 24 $ cd ../b
25 25 $ hg pull ../a
26 26 pulling from ../a
27 27 requesting all changes
28 28 adding changesets
29 29 adding manifests
30 30 adding file changes
31 31 added 1 changesets with 1 changes to 1 files
32 32 (run 'hg update' to get a working copy)
33 33 $ hg bookmarks
34 34 no bookmarks set
35 35 $ hg pull -B X ../a
36 36 pulling from ../a
37 37 searching for changes
38 38 no changes found
39 39 importing bookmark X
40 40 $ hg bookmark
41 41 X 0:4e3505fd9583
42 42
43 43 export bookmark by name
44 44
45 45 $ hg bookmark W
46 46 $ hg bookmark foo
47 47 $ hg bookmark foobar
48 48 $ hg push -B W ../a
49 49 pushing to ../a
50 50 searching for changes
51 51 no changes found
52 52 exporting bookmark W
53 53 $ hg -R ../a bookmarks
54 54 Y 0:4e3505fd9583
55 55 X 0:4e3505fd9583
56 56 * Z 0:4e3505fd9583
57 57 W -1:000000000000
58 58
59 59 push/pull name that doesn't exist
60 60
61 61 $ hg push -B badname ../a
62 62 bookmark badname does not exist on the local or remote repository!
63 63 [2]
64 64 $ hg pull -B anotherbadname ../a
65 65 abort: remote bookmark anotherbadname not found!
66 66 [255]
67 $ true
@@ -1,191 +1,189
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "bookmarks=" >> $HGRCPATH
3 3
4 4 $ hg init
5 5
6 6 no bookmarks
7 7
8 8 $ hg bookmarks
9 9 no bookmarks set
10 10
11 11 bookmark rev -1
12 12
13 13 $ hg bookmark X
14 14
15 15 list bookmarks
16 16
17 17 $ hg bookmarks
18 18 * X -1:000000000000
19 19
20 20 list bookmarks with color
21 21
22 22 $ hg --config extensions.color= --config color.mode=ansi \
23 23 > bookmarks --color=always
24 24  * X -1:000000000000
25 25
26 26 $ echo a > a
27 27 $ hg add a
28 28 $ hg commit -m 0
29 29
30 30 bookmark X moved to rev 0
31 31
32 32 $ hg bookmarks
33 33 * X 0:f7b1eb17ad24
34 34
35 35 look up bookmark
36 36
37 37 $ hg log -r X
38 38 changeset: 0:f7b1eb17ad24
39 39 tag: X
40 40 tag: tip
41 41 user: test
42 42 date: Thu Jan 01 00:00:00 1970 +0000
43 43 summary: 0
44 44
45 45
46 46 second bookmark for rev 0
47 47
48 48 $ hg bookmark X2
49 49
50 50 bookmark rev -1 again
51 51
52 52 $ hg bookmark -r null Y
53 53
54 54 list bookmarks
55 55
56 56 $ hg bookmarks
57 57 * X2 0:f7b1eb17ad24
58 58 * X 0:f7b1eb17ad24
59 59 Y -1:000000000000
60 60
61 61 $ echo b > b
62 62 $ hg add b
63 63 $ hg commit -m 1
64 64
65 65 bookmarks X and X2 moved to rev 1, Y at rev -1
66 66
67 67 $ hg bookmarks
68 68 * X2 1:925d80f479bb
69 69 * X 1:925d80f479bb
70 70 Y -1:000000000000
71 71
72 72 bookmark rev 0 again
73 73
74 74 $ hg bookmark -r 0 Z
75 75
76 76 $ echo c > c
77 77 $ hg add c
78 78 $ hg commit -m 2
79 79
80 80 bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
81 81
82 82 $ hg bookmarks
83 83 * X2 2:0316ce92851d
84 84 * X 2:0316ce92851d
85 85 Z 0:f7b1eb17ad24
86 86 Y -1:000000000000
87 87
88 88 rename nonexistent bookmark
89 89
90 90 $ hg bookmark -m A B
91 91 abort: a bookmark of this name does not exist
92 92 [255]
93 93
94 94 rename to existent bookmark
95 95
96 96 $ hg bookmark -m X Y
97 97 abort: a bookmark of the same name already exists
98 98 [255]
99 99
100 100 force rename to existent bookmark
101 101
102 102 $ hg bookmark -f -m X Y
103 103
104 104 list bookmarks
105 105
106 106 $ hg bookmark
107 107 * X2 2:0316ce92851d
108 108 * Y 2:0316ce92851d
109 109 Z 0:f7b1eb17ad24
110 110
111 111 rename without new name
112 112
113 113 $ hg bookmark -m Y
114 114 abort: new bookmark name required
115 115 [255]
116 116
117 117 delete without name
118 118
119 119 $ hg bookmark -d
120 120 abort: bookmark name required
121 121 [255]
122 122
123 123 delete nonexistent bookmark
124 124
125 125 $ hg bookmark -d A
126 126 abort: a bookmark of this name does not exist
127 127 [255]
128 128
129 129 bookmark name with spaces should be stripped
130 130
131 131 $ hg bookmark ' x y '
132 132
133 133 list bookmarks
134 134
135 135 $ hg bookmarks
136 136 * X2 2:0316ce92851d
137 137 * Y 2:0316ce92851d
138 138 Z 0:f7b1eb17ad24
139 139 * x y 2:0316ce92851d
140 140
141 141 look up stripped bookmark name
142 142
143 143 $ hg log -r '"x y"'
144 144 changeset: 2:0316ce92851d
145 145 tag: X2
146 146 tag: Y
147 147 tag: tip
148 148 tag: x y
149 149 user: test
150 150 date: Thu Jan 01 00:00:00 1970 +0000
151 151 summary: 2
152 152
153 153
154 154 reject bookmark name with newline
155 155
156 156 $ hg bookmark '
157 157 > '
158 158 abort: bookmark name cannot contain newlines
159 159 [255]
160 160
161 161 bookmark with existing name
162 162
163 163 $ hg bookmark Z
164 164 abort: a bookmark of the same name already exists
165 165 [255]
166 166
167 167 force bookmark with existing name
168 168
169 169 $ hg bookmark -f Z
170 170
171 171 list bookmarks
172 172
173 173 $ hg bookmark
174 174 * X2 2:0316ce92851d
175 175 * Y 2:0316ce92851d
176 176 * Z 2:0316ce92851d
177 177 * x y 2:0316ce92851d
178 178
179 179 revision but no bookmark name
180 180
181 181 $ hg bookmark -r .
182 182 abort: bookmark name required
183 183 [255]
184 184
185 185 bookmark name with whitespace only
186 186
187 187 $ hg bookmark ' '
188 188 abort: bookmark names cannot consist entirely of whitespace
189 189 [255]
190
191 $ true
@@ -1,65 +1,63
1 1 $ unset HGUSER
2 2 $ EMAIL="My Name <myname@example.com>"
3 3 $ export EMAIL
4 4
5 5 $ hg init test
6 6 $ cd test
7 7 $ touch asdf
8 8 $ hg add asdf
9 9 $ hg commit -m commit-1
10 10 $ hg tip
11 11 changeset: 0:53f268a58230
12 12 tag: tip
13 13 user: My Name <myname@example.com>
14 14 date: Thu Jan 01 00:00:00 1970 +0000
15 15 summary: commit-1
16 16
17 17
18 18 $ unset EMAIL
19 19 $ echo 1234 > asdf
20 20 $ hg commit -u "foo@bar.com" -m commit-1
21 21 $ hg tip
22 22 changeset: 1:3871b2a9e9bf
23 23 tag: tip
24 24 user: foo@bar.com
25 25 date: Thu Jan 01 00:00:00 1970 +0000
26 26 summary: commit-1
27 27
28 28 $ echo "[ui]" >> .hg/hgrc
29 29 $ echo "username = foobar <foo@bar.com>" >> .hg/hgrc
30 30 $ echo 12 > asdf
31 31 $ hg commit -m commit-1
32 32 $ hg tip
33 33 changeset: 2:8eeac6695c1c
34 34 tag: tip
35 35 user: foobar <foo@bar.com>
36 36 date: Thu Jan 01 00:00:00 1970 +0000
37 37 summary: commit-1
38 38
39 39 $ echo 1 > asdf
40 40 $ hg commit -u "foo@bar.com" -m commit-1
41 41 $ hg tip
42 42 changeset: 3:957606a725e4
43 43 tag: tip
44 44 user: foo@bar.com
45 45 date: Thu Jan 01 00:00:00 1970 +0000
46 46 summary: commit-1
47 47
48 48 $ echo 123 > asdf
49 49 $ echo "[ui]" > .hg/hgrc
50 50 $ echo "username = " >> .hg/hgrc
51 51 $ hg commit -m commit-1
52 52 abort: no username supplied (see "hg help config")
53 53 [255]
54 54 $ rm .hg/hgrc
55 55 $ hg commit -m commit-1 2>&1
56 56 No username found, using '[^']*' instead
57 57
58 58 $ echo space > asdf
59 59 $ hg commit -u ' ' -m commit-1
60 60 transaction abort!
61 61 rollback completed
62 62 abort: empty username!
63 63 [255]
64
65 $ true
@@ -1,42 +1,40
1 1 $ hg init
2 2 $ touch a
3 3 $ hg add a
4 4 $ hg ci -m "a"
5 5
6 6 $ echo 123 > b
7 7 $ hg add b
8 8 $ hg diff --nodates
9 9 diff -r 3903775176ed b
10 10 --- /dev/null
11 11 +++ b/b
12 12 @@ -0,0 +1,1 @@
13 13 +123
14 14
15 15 $ hg diff --nodates -r tip
16 16 diff -r 3903775176ed b
17 17 --- /dev/null
18 18 +++ b/b
19 19 @@ -0,0 +1,1 @@
20 20 +123
21 21
22 22 $ echo foo > a
23 23 $ hg diff --nodates
24 24 diff -r 3903775176ed a
25 25 --- a/a
26 26 +++ b/a
27 27 @@ -0,0 +1,1 @@
28 28 +foo
29 29 diff -r 3903775176ed b
30 30 --- /dev/null
31 31 +++ b/b
32 32 @@ -0,0 +1,1 @@
33 33 +123
34 34
35 35 $ hg diff -r ""
36 36 abort: 00changelog.i@: ambiguous identifier!
37 37 [255]
38 38 $ hg diff -r tip -r ""
39 39 abort: 00changelog.i@: ambiguous identifier!
40 40 [255]
41
42 $ true
@@ -1,25 +1,23
1 1 $ hg init
2 2
3 3 $ echo 123 > a
4 4 $ hg add a
5 5 $ hg commit -m "first" a
6 6
7 7 $ mkdir sub
8 8 $ echo 321 > sub/b
9 9 $ hg add sub/b
10 10 $ hg commit -m "second" sub/b
11 11
12 12 $ cat sub/b
13 13 321
14 14
15 15 $ hg co 0
16 16 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
17 17
18 18 $ cat sub/b 2>/dev/null || echo "sub/b not present"
19 19 sub/b not present
20 20
21 21 $ test -d sub || echo "sub not present"
22 22 sub not present
23 23
24 $ true
25
@@ -1,175 +1,173
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "extdiff=" >> $HGRCPATH
3 3
4 4 $ hg init a
5 5 $ cd a
6 6 $ echo a > a
7 7 $ echo b > b
8 8 $ hg add
9 9 adding a
10 10 adding b
11 11
12 12 Should diff cloned directories:
13 13
14 14 $ hg extdiff -o -r $opt
15 15 Only in a: a
16 16 Only in a: b
17 17 [1]
18 18
19 19 $ echo "[extdiff]" >> $HGRCPATH
20 20 $ echo "cmd.falabala=echo" >> $HGRCPATH
21 21 $ echo "opts.falabala=diffing" >> $HGRCPATH
22 22
23 23 $ hg falabala
24 24 diffing a.000000000000 a
25 25 [1]
26 26
27 27 $ hg help falabala
28 28 hg falabala [OPTION]... [FILE]...
29 29
30 30 use 'echo' to diff repository (or selected files)
31 31
32 32 Show differences between revisions for the specified files, using the
33 33 'echo' program.
34 34
35 35 When two revision arguments are given, then changes are shown between
36 36 those revisions. If only one revision is specified then that revision is
37 37 compared to the working directory, and, when no revisions are specified,
38 38 the working directory files are compared to its parent.
39 39
40 40 options:
41 41
42 42 -o --option OPT [+] pass option to comparison program
43 43 -r --rev REV [+] revision
44 44 -c --change REV change made by revision
45 45 -I --include PATTERN [+] include names matching the given patterns
46 46 -X --exclude PATTERN [+] exclude names matching the given patterns
47 47
48 48 [+] marked option can be specified multiple times
49 49
50 50 use "hg -v help falabala" to show global options
51 51
52 52 $ hg ci -d '0 0' -mtest1
53 53
54 54 $ echo b >> a
55 55 $ hg ci -d '1 0' -mtest2
56 56
57 57 Should diff cloned files directly:
58 58
59 59 $ hg falabala -r 0:1
60 60 diffing a.8a5febb7f867/a a.34eed99112ab/a
61 61 [1]
62 62
63 63 Test diff during merge:
64 64
65 65 $ hg update -C 0
66 66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 67 $ echo c >> c
68 68 $ hg add c
69 69 $ hg ci -m "new branch" -d '1 0'
70 70 created new head
71 71 $ hg merge 1
72 72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 73 (branch merge, don't forget to commit)
74 74
75 75 Should diff cloned file against wc file:
76 76
77 77 $ hg falabala > out
78 78 [1]
79 79
80 80 Cleanup the output since the wc is a tmp directory:
81 81
82 82 $ sed 's:\(diffing [^ ]* \).*\(\/test-extdiff\):\1[tmp]\2:' out
83 83 diffing a.2a13a4d2da36/a [tmp]/test-extdiff.t/a/a
84 84
85 85 Test --change option:
86 86
87 87 $ hg ci -d '2 0' -mtest3
88 88 $ hg falabala -c 1
89 89 diffing a.8a5febb7f867/a a.34eed99112ab/a
90 90 [1]
91 91
92 92 Check diff are made from the first parent:
93 93
94 94 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
95 95 diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
96 96 diff-like tools yield a non-zero exit code
97 97
98 98 Test extdiff of multiple files in tmp dir:
99 99
100 100 $ hg update -C 0 > /dev/null
101 101 $ echo changed > a
102 102 $ echo changed > b
103 103 $ chmod +x b
104 104
105 105 Diff in working directory, before:
106 106
107 107 $ hg diff --git
108 108 diff --git a/a b/a
109 109 --- a/a
110 110 +++ b/a
111 111 @@ -1,1 +1,1 @@
112 112 -a
113 113 +changed
114 114 diff --git a/b b/b
115 115 old mode 100644
116 116 new mode 100755
117 117 --- a/b
118 118 +++ b/b
119 119 @@ -1,1 +1,1 @@
120 120 -b
121 121 +changed
122 122
123 123
124 124 Edit with extdiff -p:
125 125
126 126 Prepare custom diff/edit tool:
127 127
128 128 $ cat > 'diff tool.py' << EOT
129 129 > #!/usr/bin/env python
130 130 > import time
131 131 > time.sleep(1) # avoid unchanged-timestamp problems
132 132 > file('a/a', 'ab').write('edited\n')
133 133 > file('a/b', 'ab').write('edited\n')
134 134 > EOT
135 135
136 136 $ chmod +x 'diff tool.py'
137 137
138 138 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
139 139 and start tool
140 140
141 141 $ hg extdiff -p "`pwd`/diff tool.py"
142 142 [1]
143 143
144 144 Diff in working directory, after:
145 145
146 146 $ hg diff --git
147 147 diff --git a/a b/a
148 148 --- a/a
149 149 +++ b/a
150 150 @@ -1,1 +1,2 @@
151 151 -a
152 152 +changed
153 153 +edited
154 154 diff --git a/b b/b
155 155 old mode 100644
156 156 new mode 100755
157 157 --- a/b
158 158 +++ b/b
159 159 @@ -1,1 +1,2 @@
160 160 -b
161 161 +changed
162 162 +edited
163 163
164 164 Test extdiff with --option:
165 165
166 166 $ hg extdiff -p echo -o this -c 1
167 167 this a.8a5febb7f867/a a.34eed99112ab/a
168 168 [1]
169 169
170 170 $ hg falabala -o this -c 1
171 171 diffing this a.8a5febb7f867/a a.34eed99112ab/a
172 172 [1]
173 173
174 $ true
175
@@ -1,71 +1,69
1 1 $ "$TESTDIR/hghave" no-outer-repo || exit 80
2 2
3 3 no repo
4 4
5 5 $ hg id
6 6 abort: there is no Mercurial repository here (.hg not found)
7 7 [255]
8 8
9 9 create repo
10 10
11 11 $ hg init test
12 12 $ cd test
13 13 $ echo a > a
14 14 $ hg ci -Ama
15 15 adding a
16 16
17 17 basic id usage
18 18
19 19 $ hg id
20 20 cb9a9f314b8b tip
21 21 $ hg id --debug
22 22 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip
23 23 $ hg id -q
24 24 cb9a9f314b8b
25 25 $ hg id -v
26 26 cb9a9f314b8b tip
27 27
28 28 with options
29 29
30 30 $ hg id -r.
31 31 cb9a9f314b8b tip
32 32 $ hg id -n
33 33 0
34 34 $ hg id -t
35 35 tip
36 36 $ hg id -b
37 37 default
38 38 $ hg id -i
39 39 cb9a9f314b8b
40 40 $ hg id -n -t -b -i
41 41 cb9a9f314b8b 0 default tip
42 42
43 43 with modifications
44 44
45 45 $ echo b > a
46 46 $ hg id -n -t -b -i
47 47 cb9a9f314b8b+ 0+ default tip
48 48
49 49 other local repo
50 50
51 51 $ cd ..
52 52 $ hg -R test id
53 53 cb9a9f314b8b+ tip
54 54 $ hg id test
55 55 cb9a9f314b8b+ tip
56 56
57 57 with remote http repo
58 58
59 59 $ cd test
60 60 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid
61 61 $ cat hg.pid >> $DAEMON_PIDS
62 62 $ hg id http://localhost:$HGPORT1/
63 63 cb9a9f314b8b
64 64
65 65 remote with tags?
66 66
67 67 $ hg id -t http://localhost:$HGPORT1/
68 68 abort: can't query remote revision number, branch, or tags
69 69 [255]
70
71 $ true # ends with util.Abort -> returns 255
@@ -1,24 +1,22
1 1 hg debuginstall
2 2 $ hg debuginstall
3 3 Checking encoding (ascii)...
4 4 Checking installed modules \(.*/mercurial\)...
5 5 Checking templates...
6 6 Checking patch...
7 7 Checking commit editor...
8 8 Checking username...
9 9 No problems detected
10 10
11 11 hg debuginstall with no username
12 12 $ HGUSER= hg debuginstall
13 13 Checking encoding (ascii)...
14 14 Checking installed modules \(.*/mercurial\)...
15 15 Checking templates...
16 16 Checking patch...
17 17 Checking commit editor...
18 18 Checking username...
19 19 no username supplied (see "hg help config")
20 20 (specify a username in your configuration file)
21 21 1 problems detected, please check your install!
22 22 [1]
23
24 $ true
@@ -1,13 +1,10
1 1 http://mercurial.selenic.com/bts/issue433
2 2
3 3 $ hg init
4 4 $ echo a > a
5 5 $ hg commit -Ama
6 6 adding a
7 7
8 8 $ hg parents -r 0 doesnotexist
9 9 abort: 'doesnotexist' not found in manifest!
10 10 [255]
11
12 $ true
13
@@ -1,31 +1,29
1 1 http://mercurial.selenic.com/bts/issue619
2 2
3 3 $ hg init
4 4 $ echo a > a
5 5 $ hg ci -Ama
6 6 adding a
7 7
8 8 $ echo b > b
9 9 $ hg branch b
10 10 marked working directory as branch b
11 11 $ hg ci -Amb
12 12 adding b
13 13
14 14 $ hg co -C 0
15 15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
16 16
17 17 Fast-forward:
18 18
19 19 $ hg merge b
20 20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21 (branch merge, don't forget to commit)
22 22 $ hg ci -Ammerge
23 23
24 24 Bogus fast-forward should fail:
25 25
26 26 $ hg merge b
27 27 abort: merging with a working directory ancestor has no effect
28 28 [255]
29 29
30 $ true
31
@@ -1,69 +1,65
1 1 Source bundle was generated with the following script:
2 2
3 3 # hg init
4 4 # echo a > a
5 5 # ln -s a l
6 6 # hg ci -Ama -d'0 0'
7 7 # mkdir b
8 8 # echo a > b/a
9 9 # chmod +x b/a
10 10 # hg ci -Amb -d'1 0'
11 11
12 12 $ hg init
13 13 $ hg -q pull "$TESTDIR/test-manifest.hg"
14 14
15 15 The next call is expected to return nothing:
16 16
17 17 $ hg manifest
18 18
19 19 $ hg co
20 20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21
22 22 $ hg manifest
23 23 a
24 24 b/a
25 25 l
26 26
27 27 $ hg manifest -v
28 28 644 a
29 29 755 * b/a
30 30 644 @ l
31 31
32 32 $ hg manifest --debug
33 33 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
34 34 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
35 35 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
36 36
37 37 $ hg manifest -r 0
38 38 a
39 39 l
40 40
41 41 $ hg manifest -r 1
42 42 a
43 43 b/a
44 44 l
45 45
46 46 $ hg manifest -r tip
47 47 a
48 48 b/a
49 49 l
50 50
51 51 $ hg manifest tip
52 52 a
53 53 b/a
54 54 l
55 55
56 56
57 57 The next two calls are expected to abort:
58 58
59 59 $ hg manifest -r 2
60 60 abort: unknown revision '2'!
61 61 [255]
62 62
63 63 $ hg manifest -r tip tip
64 64 abort: please specify just one revision
65 65 [255]
66
67
68 $ true
69
@@ -1,94 +1,92
1 1 test that we don't interrupt the merge session if
2 2 a file-level merge failed
3 3
4 4 $ hg init repo
5 5 $ cd repo
6 6
7 7 $ echo foo > foo
8 8 $ echo a > bar
9 9 $ hg ci -Am 'add foo'
10 10 adding bar
11 11 adding foo
12 12
13 13 $ hg mv foo baz
14 14 $ echo b >> bar
15 15 $ echo quux > quux1
16 16 $ hg ci -Am 'mv foo baz'
17 17 adding quux1
18 18
19 19 $ hg up -qC 0
20 20 $ echo >> foo
21 21 $ echo c >> bar
22 22 $ echo quux > quux2
23 23 $ hg ci -Am 'change foo'
24 24 adding quux2
25 25 created new head
26 26
27 27 test with the rename on the remote side
28 28 $ HGMERGE=false hg merge
29 29 merging bar
30 30 merging bar failed!
31 31 merging foo and baz to baz
32 32 1 files updated, 1 files merged, 0 files removed, 1 files unresolved
33 33 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
34 34 [1]
35 35 $ hg resolve -l
36 36 U bar
37 37 R baz
38 38
39 39 test with the rename on the local side
40 40 $ hg up -C 1
41 41 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
42 42 $ HGMERGE=false hg merge
43 43 merging bar
44 44 merging bar failed!
45 45 merging baz and foo to baz
46 46 1 files updated, 1 files merged, 0 files removed, 1 files unresolved
47 47 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
48 48 [1]
49 49
50 50 show unresolved
51 51 $ hg resolve -l
52 52 U bar
53 53 R baz
54 54
55 55 unmark baz
56 56 $ hg resolve -u baz
57 57
58 58 show
59 59 $ hg resolve -l
60 60 U bar
61 61 U baz
62 62 $ hg st
63 63 M bar
64 64 M baz
65 65 M quux2
66 66 ? bar.orig
67 67
68 68 re-resolve baz
69 69 $ hg resolve baz
70 70 merging baz and foo to baz
71 71
72 72 after resolve
73 73 $ hg resolve -l
74 74 U bar
75 75 R baz
76 76
77 77 resolve all warning
78 78 $ hg resolve
79 79 abort: no files or directories specified; use --all to remerge all files
80 80 [255]
81 81
82 82 resolve all
83 83 $ hg resolve -a
84 84 merging bar
85 85 warning: conflicts during merge.
86 86 merging bar failed!
87 87 [1]
88 88
89 89 after
90 90 $ hg resolve -l
91 91 U bar
92 92 R baz
93
94 $ true
@@ -1,17 +1,16
1 1 $ hg init a
2 2 $ hg clone a b
3 3 updating to branch default
4 4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 5 $ cd a
6 6 $ echo '[paths]' >> .hg/hgrc
7 7 $ echo 'dupe = ../b' >> .hg/hgrc
8 8 $ hg in dupe
9 9 comparing with .*/test-paths.t/b
10 10 no changes found
11 11 [1]
12 12 $ cd ..
13 13 $ hg -R a in dupe
14 14 comparing with .*/test-paths.t/b
15 15 no changes found
16 16 [1]
17 $ true
@@ -1,54 +1,52
1 1 $ hg init test
2 2 $ cd test
3 3
4 4 $ cat > .hg/hgrc <<EOF
5 5 > [server]
6 6 > validate=1
7 7 > EOF
8 8
9 9 $ echo alpha > alpha
10 10 $ echo beta > beta
11 11 $ hg addr
12 12 adding alpha
13 13 adding beta
14 14 $ hg ci -m 1
15 15
16 16 $ cd ..
17 17 $ hg clone test test-clone
18 18 updating to branch default
19 19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 20
21 21 $ cd test-clone
22 22 $ cp .hg/store/data/beta.i tmp
23 23 $ echo blah >> beta
24 24 $ hg ci -m '2 (corrupt)'
25 25 $ mv tmp .hg/store/data/beta.i
26 26
27 27 Expected to fail:
28 28
29 29 $ hg verify
30 30 checking changesets
31 31 checking manifests
32 32 crosschecking files in changesets and manifests
33 33 checking files
34 34 beta@1: dddc47b3ba30 in manifests not found
35 35 2 files, 2 changesets, 2 total revisions
36 36 1 integrity errors encountered!
37 37 (first damaged changeset appears to be 1)
38 38 [1]
39 39
40 40 Expected to fail:
41 41
42 42 $ hg push
43 43 pushing to .*
44 44 searching for changes
45 45 adding changesets
46 46 adding manifests
47 47 adding file changes
48 48 transaction abort!
49 49 rollback completed
50 50 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
51 51 [255]
52 52
53 $ true
54
@@ -1,16 +1,14
1 1 $ mkdir t
2 2 $ cd t
3 3 $ hg init
4 4 $ echo a > a
5 5 $ hg add a
6 6 $ hg commit -m test
7 7 $ rm .hg/requires
8 8 $ hg tip
9 9 abort: index 00changelog.i unknown format 2!
10 10 [255]
11 11 $ echo indoor-pool > .hg/requires
12 12 $ hg tip
13 13 abort: requirement 'indoor-pool' not supported!
14 14 [255]
15
16 $ true
@@ -1,27 +1,25
1 1 $ hg init
2 2 $ touch a
3 3
4 4 $ unset HGUSER
5 5 $ echo "[ui]" >> .hg/hgrc
6 6 $ echo "username= foo" >> .hg/hgrc
7 7 $ echo " bar1" >> .hg/hgrc
8 8
9 9 $ hg ci -Am m
10 10 adding a
11 11 abort: username 'foo\nbar1' contains a newline
12 12
13 13 [255]
14 14 $ rm .hg/hgrc
15 15
16 16 $ HGUSER=`(echo foo; echo bar2)` hg ci -Am m
17 17 abort: username 'foo\nbar2' contains a newline
18 18
19 19 [255]
20 20 $ hg ci -Am m -u "`(echo foo; echo bar3)`"
21 21 transaction abort!
22 22 rollback completed
23 23 abort: username 'foo\nbar3' contains a newline!
24 24 [255]
25 25
26 $ true
27
General Comments 0
You need to be logged in to leave comments. Login now