Debian Codegraph @

tests/test-acl.t

raw
1 > do_push()
2 > {
3 > user=$1
4 > shift
5 > echo "Pushing as user $user"
6 > echo 'hgrc = """'
7 > sed -n '/\[[ha]/,$p' b/.hg/hgrc | grep -v fakegroups.py
8 > echo '"""'
9 > if test -f acl.config; then
10 > echo 'acl.config = """'
11 > cat acl.config
12 > echo '"""'
13 > fi
14 > # On AIX /etc/profile sets LOGNAME read-only. So
15 > # LOGNAME=$user hg --cws a --debug push ../b
16 > # fails with "This variable is read only."
17 > # Use env to work around this.
18 > env LOGNAME=$user hg --cwd a --debug push ../b $*
19 > hg --cwd b rollback
20 > hg --cwd b --quiet tip
21 > echo
22 > }
23
24 > cat > posixgetuser.py <<'EOF'
25 > import getpass
26 > from mercurial import pycompat
27 > from mercurial.utils import procutil
28 > def posixgetuser():
29 > return pycompat.fsencode(getpass.getuser())
30 > if not pycompat.isposix:
31 > procutil.getuser = posixgetuser # forcibly trust $LOGNAME
32 > EOF
33
34 > init_config()
35 > {
36 > cat > fakegroups.py <<EOF
37 > from hgext import acl
38 > def fakegetusers(ui, group):
39 > try:
40 > return acl._getusersorig(ui, group)
41 > except BaseException:
42 > return [b"fred", b"betty"]
43 > acl._getusersorig = acl._getusers
44 > acl._getusers = fakegetusers
45 > EOF
46 > rm -f acl.config
47 > cat > $config <<EOF
48 > [hooks]
49 > pretxnchangegroup.acl = python:hgext.acl.hook
50 > prepushkey.acl = python:hgext.acl.hook
51 > [acl]
52 > sources = push
53 > [extensions]
54 > f=`pwd`/fakegroups.py
55 > posixgetuser=$TESTTMP/posixgetuser.py
56 > EOF
57 > }
58
59 $ hg init a
60 $ cd a
61 $ mkdir foo foo/Bar quux
62 $ echo 'in foo' > foo/file.txt
63 $ echo 'in foo/Bar' > foo/Bar/file.txt
64 $ echo 'in quux' > quux/file.py
65 $ hg add -q
66 $ hg ci -m 'add files' -d '1000000 0'
67 $ echo >> foo/file.txt
68 $ hg ci -m 'change foo/file' -d '1000001 0'
69 $ echo >> foo/Bar/file.txt
70 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
71 $ echo >> quux/file.py
72 $ hg ci -m 'change quux/file' -d '1000003 0'
73 $ hg tip --quiet
74 3:911600dab2ae
75
76 $ cd ..
77 $ hg clone -r 0 a b
78 adding changesets
79 adding manifests
80 adding file changes
81 added 1 changesets with 3 changes to 3 files
82 new changesets 6675d58eff77
83 updating to branch default
84 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
85
86 $ config=b/.hg/hgrc
87 $ cat >> "$config" <<EOF
88 > [extensions]
89 > posixgetuser=$TESTTMP/posixgetuser.py
90 > EOF
91
92 Extension disabled for lack of a hook
93
94 $ do_push fred
95 Pushing as user fred
96 hgrc = """
97 """
98 pushing to ../b
99 query 1; heads
100 searching for changes
101 all remote heads known locally
102 listing keys for "phases"
103 checking for updated bookmarks
104 listing keys for "bookmarks"
105 listing keys for "bookmarks"
106 3 changesets found
107 list of changesets:
108 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
109 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
110 911600dab2ae7a9baff75958b84fe606851ce955
111 bundle2-output-bundle: "HG20", 5 parts total
112 bundle2-output-part: "replycaps" * bytes payload (glob)
113 bundle2-output-part: "check:phases" 24 bytes payload
114 bundle2-output-part: "check:updated-heads" streamed payload
115 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
116 bundle2-output-part: "phase-heads" 24 bytes payload
117 bundle2-input-bundle: with-transaction
118 bundle2-input-part: "replycaps" supported
119 bundle2-input-part: total payload size * (glob)
120 bundle2-input-part: "check:phases" supported
121 bundle2-input-part: total payload size * (glob)
122 bundle2-input-part: "check:updated-heads" supported
123 bundle2-input-part: total payload size * (glob)
124 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
125 adding changesets
126 add changeset ef1ea85a6374
127 add changeset f9cafe1212c8
128 add changeset 911600dab2ae
129 adding manifests
130 adding file changes
131 adding foo/Bar/file.txt revisions
132 adding foo/file.txt revisions
133 adding quux/file.py revisions
134 bundle2-input-part: total payload size * (glob)
135 bundle2-input-part: "phase-heads" supported
136 bundle2-input-part: total payload size * (glob)
137 bundle2-input-bundle: 5 parts total
138 updating the branch cache
139 added 3 changesets with 3 changes to 3 files
140 bundle2-output-bundle: "HG20", 1 parts total
141 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
142 bundle2-input-bundle: no-transaction
143 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
144 bundle2-input-bundle: 1 parts total
145 listing keys for "phases"
146 repository tip rolled back to revision 0 (undo push)
147 0:6675d58eff77
148
149
150 $ echo '[hooks]' >> $config
151 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
152 $ echo 'prepushkey.acl = python:hgext.acl.hook' >> $config
153
154 Extension disabled for lack of acl.sources
155
156 $ do_push fred
157 Pushing as user fred
158 hgrc = """
159 [hooks]
160 pretxnchangegroup.acl = python:hgext.acl.hook
161 prepushkey.acl = python:hgext.acl.hook
162 """
163 pushing to ../b
164 query 1; heads
165 searching for changes
166 all remote heads known locally
167 listing keys for "phases"
168 checking for updated bookmarks
169 listing keys for "bookmarks"
170 listing keys for "bookmarks"
171 3 changesets found
172 list of changesets:
173 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
174 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
175 911600dab2ae7a9baff75958b84fe606851ce955
176 bundle2-output-bundle: "HG20", 5 parts total
177 bundle2-output-part: "replycaps" * bytes payload (glob)
178 bundle2-output-part: "check:phases" 24 bytes payload
179 bundle2-output-part: "check:updated-heads" streamed payload
180 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
181 bundle2-output-part: "phase-heads" 24 bytes payload
182 bundle2-input-bundle: with-transaction
183 bundle2-input-part: "replycaps" supported
184 bundle2-input-part: total payload size * (glob)
185 bundle2-input-part: "check:phases" supported
186 bundle2-input-part: total payload size * (glob)
187 bundle2-input-part: "check:updated-heads" supported
188 bundle2-input-part: total payload size * (glob)
189 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
190 adding changesets
191 add changeset ef1ea85a6374
192 add changeset f9cafe1212c8
193 add changeset 911600dab2ae
194 adding manifests
195 adding file changes
196 adding foo/Bar/file.txt revisions
197 adding foo/file.txt revisions
198 adding quux/file.py revisions
199 calling hook pretxnchangegroup.acl: hgext.acl.hook
200 acl: changes have source "push" - skipping
201 bundle2-input-part: total payload size * (glob)
202 bundle2-input-part: "phase-heads" supported
203 bundle2-input-part: total payload size * (glob)
204 bundle2-input-bundle: 5 parts total
205 resetting content of cache/rbc-revs-v2
206 updating the branch cache
207 added 3 changesets with 3 changes to 3 files
208 bundle2-output-bundle: "HG20", 1 parts total
209 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
210 bundle2-input-bundle: no-transaction
211 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
212 bundle2-input-bundle: 1 parts total
213 listing keys for "phases"
214 repository tip rolled back to revision 0 (undo push)
215 0:6675d58eff77
216
217
218 No [acl.allow]/[acl.deny]
219
220 $ echo '[acl]' >> $config
221 $ echo 'sources = push' >> $config
222 $ do_push fred
223 Pushing as user fred
224 hgrc = """
225 [hooks]
226 pretxnchangegroup.acl = python:hgext.acl.hook
227 prepushkey.acl = python:hgext.acl.hook
228 [acl]
229 sources = push
230 """
231 pushing to ../b
232 query 1; heads
233 searching for changes
234 all remote heads known locally
235 listing keys for "phases"
236 checking for updated bookmarks
237 listing keys for "bookmarks"
238 listing keys for "bookmarks"
239 3 changesets found
240 list of changesets:
241 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
242 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
243 911600dab2ae7a9baff75958b84fe606851ce955
244 bundle2-output-bundle: "HG20", 5 parts total
245 bundle2-output-part: "replycaps" * bytes payload (glob)
246 bundle2-output-part: "check:phases" 24 bytes payload
247 bundle2-output-part: "check:updated-heads" streamed payload
248 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
249 bundle2-output-part: "phase-heads" 24 bytes payload
250 bundle2-input-bundle: with-transaction
251 bundle2-input-part: "replycaps" supported
252 bundle2-input-part: total payload size * (glob)
253 bundle2-input-part: "check:phases" supported
254 bundle2-input-part: total payload size * (glob)
255 bundle2-input-part: "check:updated-heads" supported
256 bundle2-input-part: total payload size * (glob)
257 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
258 adding changesets
259 add changeset ef1ea85a6374
260 add changeset f9cafe1212c8
261 add changeset 911600dab2ae
262 adding manifests
263 adding file changes
264 adding foo/Bar/file.txt revisions
265 adding foo/file.txt revisions
266 adding quux/file.py revisions
267 calling hook pretxnchangegroup.acl: hgext.acl.hook
268 acl: checking access for user "fred"
269 acl: acl.allow.branches not enabled
270 acl: acl.deny.branches not enabled
271 acl: acl.allow not enabled
272 acl: acl.deny not enabled
273 acl: branch access granted: "ef1ea85a6374" on branch "default"
274 acl: path access granted: "ef1ea85a6374"
275 acl: branch access granted: "f9cafe1212c8" on branch "default"
276 acl: path access granted: "f9cafe1212c8"
277 acl: branch access granted: "911600dab2ae" on branch "default"
278 acl: path access granted: "911600dab2ae"
279 bundle2-input-part: total payload size * (glob)
280 bundle2-input-part: "phase-heads" supported
281 bundle2-input-part: total payload size * (glob)
282 bundle2-input-bundle: 5 parts total
283 resetting content of cache/rbc-revs-v2
284 updating the branch cache
285 added 3 changesets with 3 changes to 3 files
286 bundle2-output-bundle: "HG20", 1 parts total
287 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
288 bundle2-input-bundle: no-transaction
289 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
290 bundle2-input-bundle: 1 parts total
291 listing keys for "phases"
292 repository tip rolled back to revision 0 (undo push)
293 0:6675d58eff77
294
295
296 Empty [acl.allow]
297
298 $ echo '[acl.allow]' >> $config
299 $ do_push fred
300 Pushing as user fred
301 hgrc = """
302 [hooks]
303 pretxnchangegroup.acl = python:hgext.acl.hook
304 prepushkey.acl = python:hgext.acl.hook
305 [acl]
306 sources = push
307 [acl.allow]
308 """
309 pushing to ../b
310 query 1; heads
311 searching for changes
312 all remote heads known locally
313 listing keys for "phases"
314 checking for updated bookmarks
315 listing keys for "bookmarks"
316 listing keys for "bookmarks"
317 3 changesets found
318 list of changesets:
319 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
320 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
321 911600dab2ae7a9baff75958b84fe606851ce955
322 bundle2-output-bundle: "HG20", 5 parts total
323 bundle2-output-part: "replycaps" * bytes payload (glob)
324 bundle2-output-part: "check:phases" 24 bytes payload
325 bundle2-output-part: "check:updated-heads" streamed payload
326 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
327 bundle2-output-part: "phase-heads" 24 bytes payload
328 bundle2-input-bundle: with-transaction
329 bundle2-input-part: "replycaps" supported
330 bundle2-input-part: total payload size * (glob)
331 bundle2-input-part: "check:phases" supported
332 bundle2-input-part: total payload size * (glob)
333 bundle2-input-part: "check:updated-heads" supported
334 bundle2-input-part: total payload size * (glob)
335 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
336 adding changesets
337 add changeset ef1ea85a6374
338 add changeset f9cafe1212c8
339 add changeset 911600dab2ae
340 adding manifests
341 adding file changes
342 adding foo/Bar/file.txt revisions
343 adding foo/file.txt revisions
344 adding quux/file.py revisions
345 calling hook pretxnchangegroup.acl: hgext.acl.hook
346 acl: checking access for user "fred"
347 acl: acl.allow.branches not enabled
348 acl: acl.deny.branches not enabled
349 acl: acl.allow enabled, 0 entries for user fred
350 acl: acl.deny not enabled
351 acl: branch access granted: "ef1ea85a6374" on branch "default"
352 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
353 bundle2-input-part: total payload size * (glob)
354 bundle2-input-part: total payload size * (glob)
355 bundle2-input-bundle: 5 parts total
356 transaction abort!
357 rollback completed
358 resetting content of cache/rbc-revs-v2
359 abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
360 no rollback information available
361 0:6675d58eff77
362
363
364 fred is allowed inside foo/
365
366 $ echo 'foo/** = fred' >> $config
367 $ do_push fred
368 Pushing as user fred
369 hgrc = """
370 [hooks]
371 pretxnchangegroup.acl = python:hgext.acl.hook
372 prepushkey.acl = python:hgext.acl.hook
373 [acl]
374 sources = push
375 [acl.allow]
376 foo/** = fred
377 """
378 pushing to ../b
379 query 1; heads
380 searching for changes
381 all remote heads known locally
382 listing keys for "phases"
383 checking for updated bookmarks
384 listing keys for "bookmarks"
385 listing keys for "bookmarks"
386 3 changesets found
387 list of changesets:
388 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
389 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
390 911600dab2ae7a9baff75958b84fe606851ce955
391 bundle2-output-bundle: "HG20", 5 parts total
392 bundle2-output-part: "replycaps" * bytes payload (glob)
393 bundle2-output-part: "check:phases" 24 bytes payload
394 bundle2-output-part: "check:updated-heads" streamed payload
395 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
396 bundle2-output-part: "phase-heads" 24 bytes payload
397 bundle2-input-bundle: with-transaction
398 bundle2-input-part: "replycaps" supported
399 bundle2-input-part: total payload size * (glob)
400 bundle2-input-part: "check:phases" supported
401 bundle2-input-part: total payload size * (glob)
402 bundle2-input-part: "check:updated-heads" supported
403 bundle2-input-part: total payload size * (glob)
404 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
405 adding changesets
406 add changeset ef1ea85a6374
407 add changeset f9cafe1212c8
408 add changeset 911600dab2ae
409 adding manifests
410 adding file changes
411 adding foo/Bar/file.txt revisions
412 adding foo/file.txt revisions
413 adding quux/file.py revisions
414 calling hook pretxnchangegroup.acl: hgext.acl.hook
415 acl: checking access for user "fred"
416 acl: acl.allow.branches not enabled
417 acl: acl.deny.branches not enabled
418 acl: acl.allow enabled, 1 entries for user fred
419 acl: acl.deny not enabled
420 acl: branch access granted: "ef1ea85a6374" on branch "default"
421 acl: path access granted: "ef1ea85a6374"
422 acl: branch access granted: "f9cafe1212c8" on branch "default"
423 acl: path access granted: "f9cafe1212c8"
424 acl: branch access granted: "911600dab2ae" on branch "default"
425 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
426 bundle2-input-part: total payload size * (glob)
427 bundle2-input-part: total payload size * (glob)
428 bundle2-input-bundle: 5 parts total
429 transaction abort!
430 rollback completed
431 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
432 no rollback information available
433 0:6675d58eff77
434
435
436 Empty [acl.deny]
437
438 $ echo '[acl.deny]' >> $config
439 $ do_push barney
440 Pushing as user barney
441 hgrc = """
442 [hooks]
443 pretxnchangegroup.acl = python:hgext.acl.hook
444 prepushkey.acl = python:hgext.acl.hook
445 [acl]
446 sources = push
447 [acl.allow]
448 foo/** = fred
449 [acl.deny]
450 """
451 pushing to ../b
452 query 1; heads
453 searching for changes
454 all remote heads known locally
455 listing keys for "phases"
456 checking for updated bookmarks
457 listing keys for "bookmarks"
458 listing keys for "bookmarks"
459 3 changesets found
460 list of changesets:
461 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
462 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
463 911600dab2ae7a9baff75958b84fe606851ce955
464 bundle2-output-bundle: "HG20", 5 parts total
465 bundle2-output-part: "replycaps" * bytes payload (glob)
466 bundle2-output-part: "check:phases" 24 bytes payload
467 bundle2-output-part: "check:updated-heads" streamed payload
468 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
469 bundle2-output-part: "phase-heads" 24 bytes payload
470 bundle2-input-bundle: with-transaction
471 bundle2-input-part: "replycaps" supported
472 bundle2-input-part: total payload size * (glob)
473 bundle2-input-part: "check:phases" supported
474 bundle2-input-part: total payload size * (glob)
475 bundle2-input-part: "check:updated-heads" supported
476 bundle2-input-part: total payload size * (glob)
477 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
478 adding changesets
479 add changeset ef1ea85a6374
480 add changeset f9cafe1212c8
481 add changeset 911600dab2ae
482 adding manifests
483 adding file changes
484 adding foo/Bar/file.txt revisions
485 adding foo/file.txt revisions
486 adding quux/file.py revisions
487 calling hook pretxnchangegroup.acl: hgext.acl.hook
488 acl: checking access for user "barney"
489 acl: acl.allow.branches not enabled
490 acl: acl.deny.branches not enabled
491 acl: acl.allow enabled, 0 entries for user barney
492 acl: acl.deny enabled, 0 entries for user barney
493 acl: branch access granted: "ef1ea85a6374" on branch "default"
494 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
495 bundle2-input-part: total payload size * (glob)
496 bundle2-input-part: total payload size * (glob)
497 bundle2-input-bundle: 5 parts total
498 transaction abort!
499 rollback completed
500 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
501 no rollback information available
502 0:6675d58eff77
503
504
505 fred is allowed inside foo/, but not foo/bar/ (case matters)
506
507 $ echo 'foo/bar/** = fred' >> $config
508 $ do_push fred
509 Pushing as user fred
510 hgrc = """
511 [hooks]
512 pretxnchangegroup.acl = python:hgext.acl.hook
513 prepushkey.acl = python:hgext.acl.hook
514 [acl]
515 sources = push
516 [acl.allow]
517 foo/** = fred
518 [acl.deny]
519 foo/bar/** = fred
520 """
521 pushing to ../b
522 query 1; heads
523 searching for changes
524 all remote heads known locally
525 listing keys for "phases"
526 checking for updated bookmarks
527 listing keys for "bookmarks"
528 listing keys for "bookmarks"
529 3 changesets found
530 list of changesets:
531 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
532 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
533 911600dab2ae7a9baff75958b84fe606851ce955
534 bundle2-output-bundle: "HG20", 5 parts total
535 bundle2-output-part: "replycaps" * bytes payload (glob)
536 bundle2-output-part: "check:phases" 24 bytes payload
537 bundle2-output-part: "check:updated-heads" streamed payload
538 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
539 bundle2-output-part: "phase-heads" 24 bytes payload
540 bundle2-input-bundle: with-transaction
541 bundle2-input-part: "replycaps" supported
542 bundle2-input-part: total payload size * (glob)
543 bundle2-input-part: "check:phases" supported
544 bundle2-input-part: total payload size * (glob)
545 bundle2-input-part: "check:updated-heads" supported
546 bundle2-input-part: total payload size * (glob)
547 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
548 adding changesets
549 add changeset ef1ea85a6374
550 add changeset f9cafe1212c8
551 add changeset 911600dab2ae
552 adding manifests
553 adding file changes
554 adding foo/Bar/file.txt revisions
555 adding foo/file.txt revisions
556 adding quux/file.py revisions
557 calling hook pretxnchangegroup.acl: hgext.acl.hook
558 acl: checking access for user "fred"
559 acl: acl.allow.branches not enabled
560 acl: acl.deny.branches not enabled
561 acl: acl.allow enabled, 1 entries for user fred
562 acl: acl.deny enabled, 1 entries for user fred
563 acl: branch access granted: "ef1ea85a6374" on branch "default"
564 acl: path access granted: "ef1ea85a6374"
565 acl: branch access granted: "f9cafe1212c8" on branch "default"
566 acl: path access granted: "f9cafe1212c8"
567 acl: branch access granted: "911600dab2ae" on branch "default"
568 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
569 bundle2-input-part: total payload size * (glob)
570 bundle2-input-part: total payload size * (glob)
571 bundle2-input-bundle: 5 parts total
572 transaction abort!
573 rollback completed
574 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
575 no rollback information available
576 0:6675d58eff77
577
578
579 fred is allowed inside foo/, but not foo/Bar/
580
581 $ echo 'foo/Bar/** = fred' >> $config
582 $ do_push fred
583 Pushing as user fred
584 hgrc = """
585 [hooks]
586 pretxnchangegroup.acl = python:hgext.acl.hook
587 prepushkey.acl = python:hgext.acl.hook
588 [acl]
589 sources = push
590 [acl.allow]
591 foo/** = fred
592 [acl.deny]
593 foo/bar/** = fred
594 foo/Bar/** = fred
595 """
596 pushing to ../b
597 query 1; heads
598 searching for changes
599 all remote heads known locally
600 listing keys for "phases"
601 checking for updated bookmarks
602 listing keys for "bookmarks"
603 listing keys for "bookmarks"
604 3 changesets found
605 list of changesets:
606 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
607 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
608 911600dab2ae7a9baff75958b84fe606851ce955
609 bundle2-output-bundle: "HG20", 5 parts total
610 bundle2-output-part: "replycaps" * bytes payload (glob)
611 bundle2-output-part: "check:phases" 24 bytes payload
612 bundle2-output-part: "check:updated-heads" streamed payload
613 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
614 bundle2-output-part: "phase-heads" 24 bytes payload
615 bundle2-input-bundle: with-transaction
616 bundle2-input-part: "replycaps" supported
617 bundle2-input-part: total payload size * (glob)
618 bundle2-input-part: "check:phases" supported
619 bundle2-input-part: total payload size * (glob)
620 bundle2-input-part: "check:updated-heads" supported
621 bundle2-input-part: total payload size * (glob)
622 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
623 adding changesets
624 add changeset ef1ea85a6374
625 add changeset f9cafe1212c8
626 add changeset 911600dab2ae
627 adding manifests
628 adding file changes
629 adding foo/Bar/file.txt revisions
630 adding foo/file.txt revisions
631 adding quux/file.py revisions
632 calling hook pretxnchangegroup.acl: hgext.acl.hook
633 acl: checking access for user "fred"
634 acl: acl.allow.branches not enabled
635 acl: acl.deny.branches not enabled
636 acl: acl.allow enabled, 1 entries for user fred
637 acl: acl.deny enabled, 2 entries for user fred
638 acl: branch access granted: "ef1ea85a6374" on branch "default"
639 acl: path access granted: "ef1ea85a6374"
640 acl: branch access granted: "f9cafe1212c8" on branch "default"
641 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
642 bundle2-input-part: total payload size * (glob)
643 bundle2-input-part: total payload size * (glob)
644 bundle2-input-bundle: 5 parts total
645 transaction abort!
646 rollback completed
647 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
648 no rollback information available
649 0:6675d58eff77
650
651
652 $ echo 'barney is not mentioned => not allowed anywhere'
653 barney is not mentioned => not allowed anywhere
654 $ do_push barney
655 Pushing as user barney
656 hgrc = """
657 [hooks]
658 pretxnchangegroup.acl = python:hgext.acl.hook
659 prepushkey.acl = python:hgext.acl.hook
660 [acl]
661 sources = push
662 [acl.allow]
663 foo/** = fred
664 [acl.deny]
665 foo/bar/** = fred
666 foo/Bar/** = fred
667 """
668 pushing to ../b
669 query 1; heads
670 searching for changes
671 all remote heads known locally
672 listing keys for "phases"
673 checking for updated bookmarks
674 listing keys for "bookmarks"
675 listing keys for "bookmarks"
676 3 changesets found
677 list of changesets:
678 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
679 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
680 911600dab2ae7a9baff75958b84fe606851ce955
681 bundle2-output-bundle: "HG20", 5 parts total
682 bundle2-output-part: "replycaps" * bytes payload (glob)
683 bundle2-output-part: "check:phases" 24 bytes payload
684 bundle2-output-part: "check:updated-heads" streamed payload
685 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
686 bundle2-output-part: "phase-heads" 24 bytes payload
687 bundle2-input-bundle: with-transaction
688 bundle2-input-part: "replycaps" supported
689 bundle2-input-part: total payload size * (glob)
690 bundle2-input-part: "check:phases" supported
691 bundle2-input-part: total payload size * (glob)
692 bundle2-input-part: "check:updated-heads" supported
693 bundle2-input-part: total payload size * (glob)
694 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
695 adding changesets
696 add changeset ef1ea85a6374
697 add changeset f9cafe1212c8
698 add changeset 911600dab2ae
699 adding manifests
700 adding file changes
701 adding foo/Bar/file.txt revisions
702 adding foo/file.txt revisions
703 adding quux/file.py revisions
704 calling hook pretxnchangegroup.acl: hgext.acl.hook
705 acl: checking access for user "barney"
706 acl: acl.allow.branches not enabled
707 acl: acl.deny.branches not enabled
708 acl: acl.allow enabled, 0 entries for user barney
709 acl: acl.deny enabled, 0 entries for user barney
710 acl: branch access granted: "ef1ea85a6374" on branch "default"
711 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
712 bundle2-input-part: total payload size * (glob)
713 bundle2-input-part: total payload size * (glob)
714 bundle2-input-bundle: 5 parts total
715 transaction abort!
716 rollback completed
717 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
718 no rollback information available
719 0:6675d58eff77
720
721
722 fred is not blocked from moving bookmarks
723
724 $ hg -R a book -q moving-bookmark -r 1
725 $ hg -R b book -q moving-bookmark -r 0
726 $ cp $config normalconfig
727 $ do_push fred -r 1
728 Pushing as user fred
729 hgrc = """
730 [hooks]
731 pretxnchangegroup.acl = python:hgext.acl.hook
732 prepushkey.acl = python:hgext.acl.hook
733 [acl]
734 sources = push
735 [acl.allow]
736 foo/** = fred
737 [acl.deny]
738 foo/bar/** = fred
739 foo/Bar/** = fred
740 """
741 pushing to ../b
742 query 1; heads
743 searching for changes
744 all remote heads known locally
745 listing keys for "phases"
746 checking for updated bookmarks
747 listing keys for "bookmarks"
748 listing keys for "bookmarks"
749 1 changesets found
750 list of changesets:
751 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
752 bundle2-output-bundle: "HG20", 7 parts total
753 bundle2-output-part: "replycaps" * bytes payload (glob)
754 bundle2-output-part: "check:bookmarks" 37 bytes payload
755 bundle2-output-part: "check:phases" 24 bytes payload
756 bundle2-output-part: "check:updated-heads" streamed payload
757 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
758 bundle2-output-part: "phase-heads" 24 bytes payload
759 bundle2-output-part: "bookmarks" 37 bytes payload
760 bundle2-input-bundle: with-transaction
761 bundle2-input-part: "replycaps" supported
762 bundle2-input-part: total payload size * (glob)
763 bundle2-input-part: "check:bookmarks" supported
764 bundle2-input-part: total payload size * (glob)
765 bundle2-input-part: "check:phases" supported
766 bundle2-input-part: total payload size * (glob)
767 bundle2-input-part: "check:updated-heads" supported
768 bundle2-input-part: total payload size * (glob)
769 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
770 adding changesets
771 add changeset ef1ea85a6374
772 adding manifests
773 adding file changes
774 adding foo/file.txt revisions
775 calling hook pretxnchangegroup.acl: hgext.acl.hook
776 acl: checking access for user "fred"
777 acl: acl.allow.branches not enabled
778 acl: acl.deny.branches not enabled
779 acl: acl.allow enabled, 1 entries for user fred
780 acl: acl.deny enabled, 2 entries for user fred
781 acl: branch access granted: "ef1ea85a6374" on branch "default"
782 acl: path access granted: "ef1ea85a6374"
783 bundle2-input-part: total payload size * (glob)
784 bundle2-input-part: "phase-heads" supported
785 bundle2-input-part: total payload size * (glob)
786 bundle2-input-part: "bookmarks" supported
787 bundle2-input-part: total payload size * (glob)
788 calling hook prepushkey.acl: hgext.acl.hook
789 acl: checking access for user "fred"
790 acl: acl.allow.bookmarks not enabled
791 acl: acl.deny.bookmarks not enabled
792 acl: bookmark access granted: "ef1ea85a6374b77d6da9dcda9541f498f2d17df7" on bookmark "moving-bookmark"
793 bundle2-input-bundle: 7 parts total
794 updating the branch cache
795 added 1 changesets with 1 changes to 1 files
796 bundle2-output-bundle: "HG20", 1 parts total
797 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
798 bundle2-input-bundle: no-transaction
799 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
800 bundle2-input-bundle: 1 parts total
801 updating bookmark moving-bookmark
802 listing keys for "phases"
803 repository tip rolled back to revision 0 (undo push)
804 0:6675d58eff77
805
806
807 fred is not allowed to move bookmarks
808
809 $ echo '[acl.deny.bookmarks]' >> $config
810 $ echo '* = fred' >> $config
811 $ do_push fred -r 1
812 Pushing as user fred
813 hgrc = """
814 [hooks]
815 pretxnchangegroup.acl = python:hgext.acl.hook
816 prepushkey.acl = python:hgext.acl.hook
817 [acl]
818 sources = push
819 [acl.allow]
820 foo/** = fred
821 [acl.deny]
822 foo/bar/** = fred
823 foo/Bar/** = fred
824 [acl.deny.bookmarks]
825 * = fred
826 """
827 pushing to ../b
828 query 1; heads
829 searching for changes
830 all remote heads known locally
831 listing keys for "phases"
832 checking for updated bookmarks
833 listing keys for "bookmarks"
834 listing keys for "bookmarks"
835 1 changesets found
836 list of changesets:
837 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
838 bundle2-output-bundle: "HG20", 7 parts total
839 bundle2-output-part: "replycaps" * bytes payload (glob)
840 bundle2-output-part: "check:bookmarks" 37 bytes payload
841 bundle2-output-part: "check:phases" 24 bytes payload
842 bundle2-output-part: "check:updated-heads" streamed payload
843 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
844 bundle2-output-part: "phase-heads" 24 bytes payload
845 bundle2-output-part: "bookmarks" 37 bytes payload
846 bundle2-input-bundle: with-transaction
847 bundle2-input-part: "replycaps" supported
848 bundle2-input-part: total payload size * (glob)
849 bundle2-input-part: "check:bookmarks" supported
850 bundle2-input-part: total payload size * (glob)
851 bundle2-input-part: "check:phases" supported
852 bundle2-input-part: total payload size * (glob)
853 bundle2-input-part: "check:updated-heads" supported
854 bundle2-input-part: total payload size * (glob)
855 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
856 adding changesets
857 add changeset ef1ea85a6374
858 adding manifests
859 adding file changes
860 adding foo/file.txt revisions
861 calling hook pretxnchangegroup.acl: hgext.acl.hook
862 acl: checking access for user "fred"
863 acl: acl.allow.branches not enabled
864 acl: acl.deny.branches not enabled
865 acl: acl.allow enabled, 1 entries for user fred
866 acl: acl.deny enabled, 2 entries for user fred
867 acl: branch access granted: "ef1ea85a6374" on branch "default"
868 acl: path access granted: "ef1ea85a6374"
869 bundle2-input-part: total payload size * (glob)
870 bundle2-input-part: "phase-heads" supported
871 bundle2-input-part: total payload size * (glob)
872 bundle2-input-part: "bookmarks" supported
873 bundle2-input-part: total payload size * (glob)
874 calling hook prepushkey.acl: hgext.acl.hook
875 acl: checking access for user "fred"
876 acl: acl.allow.bookmarks not enabled
877 acl: acl.deny.bookmarks enabled, 1 entries for user fred
878 error: prepushkey.acl hook failed: acl: user "fred" denied on bookmark "moving-bookmark" (changeset "ef1ea85a6374b77d6da9dcda9541f498f2d17df7")
879 bundle2-input-bundle: 7 parts total
880 transaction abort!
881 rollback completed
882 resetting content of cache/rbc-revs-v2
883 abort: acl: user "fred" denied on bookmark "moving-bookmark" (changeset "ef1ea85a6374b77d6da9dcda9541f498f2d17df7")
884 no rollback information available
885 0:6675d58eff77
886
887
888 cleanup bookmark stuff
889
890 $ hg book -R a -d moving-bookmark
891 $ hg book -R b -d moving-bookmark
892 $ cp normalconfig $config
893
894 barney is allowed everywhere
895
896 $ echo '[acl.allow]' >> $config
897 $ echo '** = barney' >> $config
898 $ do_push barney
899 Pushing as user barney
900 hgrc = """
901 [hooks]
902 pretxnchangegroup.acl = python:hgext.acl.hook
903 prepushkey.acl = python:hgext.acl.hook
904 [acl]
905 sources = push
906 [acl.allow]
907 foo/** = fred
908 [acl.deny]
909 foo/bar/** = fred
910 foo/Bar/** = fred
911 [acl.allow]
912 ** = barney
913 """
914 pushing to ../b
915 query 1; heads
916 searching for changes
917 all remote heads known locally
918 listing keys for "phases"
919 checking for updated bookmarks
920 listing keys for "bookmarks"
921 listing keys for "bookmarks"
922 3 changesets found
923 list of changesets:
924 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
925 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
926 911600dab2ae7a9baff75958b84fe606851ce955
927 bundle2-output-bundle: "HG20", 5 parts total
928 bundle2-output-part: "replycaps" * bytes payload (glob)
929 bundle2-output-part: "check:phases" 24 bytes payload
930 bundle2-output-part: "check:updated-heads" streamed payload
931 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
932 bundle2-output-part: "phase-heads" 24 bytes payload
933 bundle2-input-bundle: with-transaction
934 bundle2-input-part: "replycaps" supported
935 bundle2-input-part: total payload size * (glob)
936 bundle2-input-part: "check:phases" supported
937 bundle2-input-part: total payload size * (glob)
938 bundle2-input-part: "check:updated-heads" supported
939 bundle2-input-part: total payload size * (glob)
940 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
941 adding changesets
942 add changeset ef1ea85a6374
943 add changeset f9cafe1212c8
944 add changeset 911600dab2ae
945 adding manifests
946 adding file changes
947 adding foo/Bar/file.txt revisions
948 adding foo/file.txt revisions
949 adding quux/file.py revisions
950 calling hook pretxnchangegroup.acl: hgext.acl.hook
951 acl: checking access for user "barney"
952 acl: acl.allow.branches not enabled
953 acl: acl.deny.branches not enabled
954 acl: acl.allow enabled, 1 entries for user barney
955 acl: acl.deny enabled, 0 entries for user barney
956 acl: branch access granted: "ef1ea85a6374" on branch "default"
957 acl: path access granted: "ef1ea85a6374"
958 acl: branch access granted: "f9cafe1212c8" on branch "default"
959 acl: path access granted: "f9cafe1212c8"
960 acl: branch access granted: "911600dab2ae" on branch "default"
961 acl: path access granted: "911600dab2ae"
962 bundle2-input-part: total payload size * (glob)
963 bundle2-input-part: "phase-heads" supported
964 bundle2-input-part: total payload size * (glob)
965 bundle2-input-bundle: 5 parts total
966 updating the branch cache
967 added 3 changesets with 3 changes to 3 files
968 bundle2-output-bundle: "HG20", 1 parts total
969 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
970 bundle2-input-bundle: no-transaction
971 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
972 bundle2-input-bundle: 1 parts total
973 listing keys for "phases"
974 repository tip rolled back to revision 0 (undo push)
975 0:6675d58eff77
976
977
978 wilma can change files with a .txt extension
979
980 $ echo '**/*.txt = wilma' >> $config
981 $ do_push wilma
982 Pushing as user wilma
983 hgrc = """
984 [hooks]
985 pretxnchangegroup.acl = python:hgext.acl.hook
986 prepushkey.acl = python:hgext.acl.hook
987 [acl]
988 sources = push
989 [acl.allow]
990 foo/** = fred
991 [acl.deny]
992 foo/bar/** = fred
993 foo/Bar/** = fred
994 [acl.allow]
995 ** = barney
996 **/*.txt = wilma
997 """
998 pushing to ../b
999 query 1; heads
1000 searching for changes
1001 all remote heads known locally
1002 listing keys for "phases"
1003 checking for updated bookmarks
1004 listing keys for "bookmarks"
1005 listing keys for "bookmarks"
1006 3 changesets found
1007 list of changesets:
1008 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1009 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1010 911600dab2ae7a9baff75958b84fe606851ce955
1011 bundle2-output-bundle: "HG20", 5 parts total
1012 bundle2-output-part: "replycaps" * bytes payload (glob)
1013 bundle2-output-part: "check:phases" 24 bytes payload
1014 bundle2-output-part: "check:updated-heads" streamed payload
1015 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1016 bundle2-output-part: "phase-heads" 24 bytes payload
1017 bundle2-input-bundle: with-transaction
1018 bundle2-input-part: "replycaps" supported
1019 bundle2-input-part: total payload size * (glob)
1020 bundle2-input-part: "check:phases" supported
1021 bundle2-input-part: total payload size * (glob)
1022 bundle2-input-part: "check:updated-heads" supported
1023 bundle2-input-part: total payload size * (glob)
1024 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1025 adding changesets
1026 add changeset ef1ea85a6374
1027 add changeset f9cafe1212c8
1028 add changeset 911600dab2ae
1029 adding manifests
1030 adding file changes
1031 adding foo/Bar/file.txt revisions
1032 adding foo/file.txt revisions
1033 adding quux/file.py revisions
1034 calling hook pretxnchangegroup.acl: hgext.acl.hook
1035 acl: checking access for user "wilma"
1036 acl: acl.allow.branches not enabled
1037 acl: acl.deny.branches not enabled
1038 acl: acl.allow enabled, 1 entries for user wilma
1039 acl: acl.deny enabled, 0 entries for user wilma
1040 acl: branch access granted: "ef1ea85a6374" on branch "default"
1041 acl: path access granted: "ef1ea85a6374"
1042 acl: branch access granted: "f9cafe1212c8" on branch "default"
1043 acl: path access granted: "f9cafe1212c8"
1044 acl: branch access granted: "911600dab2ae" on branch "default"
1045 error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
1046 bundle2-input-part: total payload size * (glob)
1047 bundle2-input-part: total payload size * (glob)
1048 bundle2-input-bundle: 5 parts total
1049 transaction abort!
1050 rollback completed
1051 resetting content of cache/rbc-revs-v2
1052 abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
1053 no rollback information available
1054 0:6675d58eff77
1055
1056
1057 file specified by acl.config does not exist
1058
1059 $ echo '[acl]' >> $config
1060 $ echo 'config = ../acl.config' >> $config
1061 $ do_push barney
1062 Pushing as user barney
1063 hgrc = """
1064 [hooks]
1065 pretxnchangegroup.acl = python:hgext.acl.hook
1066 prepushkey.acl = python:hgext.acl.hook
1067 [acl]
1068 sources = push
1069 [acl.allow]
1070 foo/** = fred
1071 [acl.deny]
1072 foo/bar/** = fred
1073 foo/Bar/** = fred
1074 [acl.allow]
1075 ** = barney
1076 **/*.txt = wilma
1077 [acl]
1078 config = ../acl.config
1079 """
1080 pushing to ../b
1081 query 1; heads
1082 searching for changes
1083 all remote heads known locally
1084 listing keys for "phases"
1085 checking for updated bookmarks
1086 listing keys for "bookmarks"
1087 listing keys for "bookmarks"
1088 3 changesets found
1089 list of changesets:
1090 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1091 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1092 911600dab2ae7a9baff75958b84fe606851ce955
1093 bundle2-output-bundle: "HG20", 5 parts total
1094 bundle2-output-part: "replycaps" * bytes payload (glob)
1095 bundle2-output-part: "check:phases" 24 bytes payload
1096 bundle2-output-part: "check:updated-heads" streamed payload
1097 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1098 bundle2-output-part: "phase-heads" 24 bytes payload
1099 bundle2-input-bundle: with-transaction
1100 bundle2-input-part: "replycaps" supported
1101 bundle2-input-part: total payload size * (glob)
1102 bundle2-input-part: "check:phases" supported
1103 bundle2-input-part: total payload size * (glob)
1104 bundle2-input-part: "check:updated-heads" supported
1105 bundle2-input-part: total payload size * (glob)
1106 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1107 adding changesets
1108 add changeset ef1ea85a6374
1109 add changeset f9cafe1212c8
1110 add changeset 911600dab2ae
1111 adding manifests
1112 adding file changes
1113 adding foo/Bar/file.txt revisions
1114 adding foo/file.txt revisions
1115 adding quux/file.py revisions
1116 calling hook pretxnchangegroup.acl: hgext.acl.hook
1117 acl: checking access for user "barney"
1118 error: pretxnchangegroup.acl hook raised an exception: [Errno *] * (glob)
1119 bundle2-input-part: total payload size * (glob)
1120 bundle2-input-part: total payload size * (glob)
1121 bundle2-input-bundle: 5 parts total
1122 transaction abort!
1123 rollback completed
1124 abort: $ENOENT$: '../acl.config'
1125 no rollback information available
1126 0:6675d58eff77
1127
1128
1129 betty is allowed inside foo/ by a acl.config file
1130
1131 $ echo '[acl.allow]' >> acl.config
1132 $ echo 'foo/** = betty' >> acl.config
1133 $ do_push betty
1134 Pushing as user betty
1135 hgrc = """
1136 [hooks]
1137 pretxnchangegroup.acl = python:hgext.acl.hook
1138 prepushkey.acl = python:hgext.acl.hook
1139 [acl]
1140 sources = push
1141 [acl.allow]
1142 foo/** = fred
1143 [acl.deny]
1144 foo/bar/** = fred
1145 foo/Bar/** = fred
1146 [acl.allow]
1147 ** = barney
1148 **/*.txt = wilma
1149 [acl]
1150 config = ../acl.config
1151 """
1152 acl.config = """
1153 [acl.allow]
1154 foo/** = betty
1155 """
1156 pushing to ../b
1157 query 1; heads
1158 searching for changes
1159 all remote heads known locally
1160 listing keys for "phases"
1161 checking for updated bookmarks
1162 listing keys for "bookmarks"
1163 listing keys for "bookmarks"
1164 3 changesets found
1165 list of changesets:
1166 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1167 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1168 911600dab2ae7a9baff75958b84fe606851ce955
1169 bundle2-output-bundle: "HG20", 5 parts total
1170 bundle2-output-part: "replycaps" * bytes payload (glob)
1171 bundle2-output-part: "check:phases" 24 bytes payload
1172 bundle2-output-part: "check:updated-heads" streamed payload
1173 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1174 bundle2-output-part: "phase-heads" 24 bytes payload
1175 bundle2-input-bundle: with-transaction
1176 bundle2-input-part: "replycaps" supported
1177 bundle2-input-part: total payload size * (glob)
1178 bundle2-input-part: "check:phases" supported
1179 bundle2-input-part: total payload size * (glob)
1180 bundle2-input-part: "check:updated-heads" supported
1181 bundle2-input-part: total payload size * (glob)
1182 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1183 adding changesets
1184 add changeset ef1ea85a6374
1185 add changeset f9cafe1212c8
1186 add changeset 911600dab2ae
1187 adding manifests
1188 adding file changes
1189 adding foo/Bar/file.txt revisions
1190 adding foo/file.txt revisions
1191 adding quux/file.py revisions
1192 calling hook pretxnchangegroup.acl: hgext.acl.hook
1193 acl: checking access for user "betty"
1194 acl: acl.allow.branches not enabled
1195 acl: acl.deny.branches not enabled
1196 acl: acl.allow enabled, 1 entries for user betty
1197 acl: acl.deny enabled, 0 entries for user betty
1198 acl: branch access granted: "ef1ea85a6374" on branch "default"
1199 acl: path access granted: "ef1ea85a6374"
1200 acl: branch access granted: "f9cafe1212c8" on branch "default"
1201 acl: path access granted: "f9cafe1212c8"
1202 acl: branch access granted: "911600dab2ae" on branch "default"
1203 error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
1204 bundle2-input-part: total payload size * (glob)
1205 bundle2-input-part: total payload size * (glob)
1206 bundle2-input-bundle: 5 parts total
1207 transaction abort!
1208 rollback completed
1209 abort: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
1210 no rollback information available
1211 0:6675d58eff77
1212
1213
1214 acl.config can set only [acl.allow]/[acl.deny]
1215
1216 $ echo '[hooks]' >> acl.config
1217 $ echo 'changegroup.acl = false' >> acl.config
1218 $ do_push barney
1219 Pushing as user barney
1220 hgrc = """
1221 [hooks]
1222 pretxnchangegroup.acl = python:hgext.acl.hook
1223 prepushkey.acl = python:hgext.acl.hook
1224 [acl]
1225 sources = push
1226 [acl.allow]
1227 foo/** = fred
1228 [acl.deny]
1229 foo/bar/** = fred
1230 foo/Bar/** = fred
1231 [acl.allow]
1232 ** = barney
1233 **/*.txt = wilma
1234 [acl]
1235 config = ../acl.config
1236 """
1237 acl.config = """
1238 [acl.allow]
1239 foo/** = betty
1240 [hooks]
1241 changegroup.acl = false
1242 """
1243 pushing to ../b
1244 query 1; heads
1245 searching for changes
1246 all remote heads known locally
1247 listing keys for "phases"
1248 checking for updated bookmarks
1249 listing keys for "bookmarks"
1250 listing keys for "bookmarks"
1251 3 changesets found
1252 list of changesets:
1253 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1254 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1255 911600dab2ae7a9baff75958b84fe606851ce955
1256 bundle2-output-bundle: "HG20", 5 parts total
1257 bundle2-output-part: "replycaps" * bytes payload (glob)
1258 bundle2-output-part: "check:phases" 24 bytes payload
1259 bundle2-output-part: "check:updated-heads" streamed payload
1260 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1261 bundle2-output-part: "phase-heads" 24 bytes payload
1262 bundle2-input-bundle: with-transaction
1263 bundle2-input-part: "replycaps" supported
1264 bundle2-input-part: total payload size * (glob)
1265 bundle2-input-part: "check:phases" supported
1266 bundle2-input-part: total payload size * (glob)
1267 bundle2-input-part: "check:updated-heads" supported
1268 bundle2-input-part: total payload size * (glob)
1269 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1270 adding changesets
1271 add changeset ef1ea85a6374
1272 add changeset f9cafe1212c8
1273 add changeset 911600dab2ae
1274 adding manifests
1275 adding file changes
1276 adding foo/Bar/file.txt revisions
1277 adding foo/file.txt revisions
1278 adding quux/file.py revisions
1279 calling hook pretxnchangegroup.acl: hgext.acl.hook
1280 acl: checking access for user "barney"
1281 acl: acl.allow.branches not enabled
1282 acl: acl.deny.branches not enabled
1283 acl: acl.allow enabled, 1 entries for user barney
1284 acl: acl.deny enabled, 0 entries for user barney
1285 acl: branch access granted: "ef1ea85a6374" on branch "default"
1286 acl: path access granted: "ef1ea85a6374"
1287 acl: branch access granted: "f9cafe1212c8" on branch "default"
1288 acl: path access granted: "f9cafe1212c8"
1289 acl: branch access granted: "911600dab2ae" on branch "default"
1290 acl: path access granted: "911600dab2ae"
1291 bundle2-input-part: total payload size * (glob)
1292 bundle2-input-part: "phase-heads" supported
1293 bundle2-input-part: total payload size * (glob)
1294 bundle2-input-bundle: 5 parts total
1295 updating the branch cache
1296 added 3 changesets with 3 changes to 3 files
1297 bundle2-output-bundle: "HG20", 1 parts total
1298 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1299 bundle2-input-bundle: no-transaction
1300 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1301 bundle2-input-bundle: 1 parts total
1302 listing keys for "phases"
1303 repository tip rolled back to revision 0 (undo push)
1304 0:6675d58eff77
1305
1306
1307 asterisk
1308
1309 $ init_config
1310
1311 asterisk test
1312
1313 $ echo '[acl.allow]' >> $config
1314 $ echo "** = fred" >> $config
1315
1316 fred is always allowed
1317
1318 $ do_push fred
1319 Pushing as user fred
1320 hgrc = """
1321 [hooks]
1322 pretxnchangegroup.acl = python:hgext.acl.hook
1323 prepushkey.acl = python:hgext.acl.hook
1324 [acl]
1325 sources = push
1326 [extensions]
1327 posixgetuser=$TESTTMP/posixgetuser.py
1328 [acl.allow]
1329 ** = fred
1330 """
1331 pushing to ../b
1332 query 1; heads
1333 searching for changes
1334 all remote heads known locally
1335 listing keys for "phases"
1336 checking for updated bookmarks
1337 listing keys for "bookmarks"
1338 listing keys for "bookmarks"
1339 3 changesets found
1340 list of changesets:
1341 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1342 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1343 911600dab2ae7a9baff75958b84fe606851ce955
1344 bundle2-output-bundle: "HG20", 5 parts total
1345 bundle2-output-part: "replycaps" * bytes payload (glob)
1346 bundle2-output-part: "check:phases" 24 bytes payload
1347 bundle2-output-part: "check:updated-heads" streamed payload
1348 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1349 bundle2-output-part: "phase-heads" 24 bytes payload
1350 bundle2-input-bundle: with-transaction
1351 bundle2-input-part: "replycaps" supported
1352 bundle2-input-part: total payload size * (glob)
1353 bundle2-input-part: "check:phases" supported
1354 bundle2-input-part: total payload size * (glob)
1355 bundle2-input-part: "check:updated-heads" supported
1356 bundle2-input-part: total payload size * (glob)
1357 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1358 adding changesets
1359 add changeset ef1ea85a6374
1360 add changeset f9cafe1212c8
1361 add changeset 911600dab2ae
1362 adding manifests
1363 adding file changes
1364 adding foo/Bar/file.txt revisions
1365 adding foo/file.txt revisions
1366 adding quux/file.py revisions
1367 calling hook pretxnchangegroup.acl: hgext.acl.hook
1368 acl: checking access for user "fred"
1369 acl: acl.allow.branches not enabled
1370 acl: acl.deny.branches not enabled
1371 acl: acl.allow enabled, 1 entries for user fred
1372 acl: acl.deny not enabled
1373 acl: branch access granted: "ef1ea85a6374" on branch "default"
1374 acl: path access granted: "ef1ea85a6374"
1375 acl: branch access granted: "f9cafe1212c8" on branch "default"
1376 acl: path access granted: "f9cafe1212c8"
1377 acl: branch access granted: "911600dab2ae" on branch "default"
1378 acl: path access granted: "911600dab2ae"
1379 bundle2-input-part: total payload size * (glob)
1380 bundle2-input-part: "phase-heads" supported
1381 bundle2-input-part: total payload size * (glob)
1382 bundle2-input-bundle: 5 parts total
1383 resetting content of cache/rbc-revs-v2
1384 updating the branch cache
1385 added 3 changesets with 3 changes to 3 files
1386 bundle2-output-bundle: "HG20", 1 parts total
1387 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1388 bundle2-input-bundle: no-transaction
1389 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1390 bundle2-input-bundle: 1 parts total
1391 listing keys for "phases"
1392 repository tip rolled back to revision 0 (undo push)
1393 0:6675d58eff77
1394
1395
1396 $ echo '[acl.deny]' >> $config
1397 $ echo "foo/Bar/** = *" >> $config
1398
1399 no one is allowed inside foo/Bar/
1400
1401 $ do_push fred
1402 Pushing as user fred
1403 hgrc = """
1404 [hooks]
1405 pretxnchangegroup.acl = python:hgext.acl.hook
1406 prepushkey.acl = python:hgext.acl.hook
1407 [acl]
1408 sources = push
1409 [extensions]
1410 posixgetuser=$TESTTMP/posixgetuser.py
1411 [acl.allow]
1412 ** = fred
1413 [acl.deny]
1414 foo/Bar/** = *
1415 """
1416 pushing to ../b
1417 query 1; heads
1418 searching for changes
1419 all remote heads known locally
1420 listing keys for "phases"
1421 checking for updated bookmarks
1422 listing keys for "bookmarks"
1423 listing keys for "bookmarks"
1424 3 changesets found
1425 list of changesets:
1426 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1427 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1428 911600dab2ae7a9baff75958b84fe606851ce955
1429 bundle2-output-bundle: "HG20", 5 parts total
1430 bundle2-output-part: "replycaps" * bytes payload (glob)
1431 bundle2-output-part: "check:phases" 24 bytes payload
1432 bundle2-output-part: "check:updated-heads" streamed payload
1433 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1434 bundle2-output-part: "phase-heads" 24 bytes payload
1435 bundle2-input-bundle: with-transaction
1436 bundle2-input-part: "replycaps" supported
1437 bundle2-input-part: total payload size * (glob)
1438 bundle2-input-part: "check:phases" supported
1439 bundle2-input-part: total payload size * (glob)
1440 bundle2-input-part: "check:updated-heads" supported
1441 bundle2-input-part: total payload size * (glob)
1442 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1443 adding changesets
1444 add changeset ef1ea85a6374
1445 add changeset f9cafe1212c8
1446 add changeset 911600dab2ae
1447 adding manifests
1448 adding file changes
1449 adding foo/Bar/file.txt revisions
1450 adding foo/file.txt revisions
1451 adding quux/file.py revisions
1452 calling hook pretxnchangegroup.acl: hgext.acl.hook
1453 acl: checking access for user "fred"
1454 acl: acl.allow.branches not enabled
1455 acl: acl.deny.branches not enabled
1456 acl: acl.allow enabled, 1 entries for user fred
1457 acl: acl.deny enabled, 1 entries for user fred
1458 acl: branch access granted: "ef1ea85a6374" on branch "default"
1459 acl: path access granted: "ef1ea85a6374"
1460 acl: branch access granted: "f9cafe1212c8" on branch "default"
1461 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1462 bundle2-input-part: total payload size * (glob)
1463 bundle2-input-part: total payload size * (glob)
1464 bundle2-input-bundle: 5 parts total
1465 transaction abort!
1466 rollback completed
1467 resetting content of cache/rbc-revs-v2
1468 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1469 no rollback information available
1470 0:6675d58eff77
1471
1472
1473 Groups
1474
1475 $ init_config
1476
1477 OS-level groups
1478
1479 $ echo '[acl.allow]' >> $config
1480 $ echo "** = @group1" >> $config
1481
1482 @group1 is always allowed
1483
1484 $ do_push fred
1485 Pushing as user fred
1486 hgrc = """
1487 [hooks]
1488 pretxnchangegroup.acl = python:hgext.acl.hook
1489 prepushkey.acl = python:hgext.acl.hook
1490 [acl]
1491 sources = push
1492 [extensions]
1493 posixgetuser=$TESTTMP/posixgetuser.py
1494 [acl.allow]
1495 ** = @group1
1496 """
1497 pushing to ../b
1498 query 1; heads
1499 searching for changes
1500 all remote heads known locally
1501 listing keys for "phases"
1502 checking for updated bookmarks
1503 listing keys for "bookmarks"
1504 listing keys for "bookmarks"
1505 3 changesets found
1506 list of changesets:
1507 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1508 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1509 911600dab2ae7a9baff75958b84fe606851ce955
1510 bundle2-output-bundle: "HG20", 5 parts total
1511 bundle2-output-part: "replycaps" * bytes payload (glob)
1512 bundle2-output-part: "check:phases" 24 bytes payload
1513 bundle2-output-part: "check:updated-heads" streamed payload
1514 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1515 bundle2-output-part: "phase-heads" 24 bytes payload
1516 bundle2-input-bundle: with-transaction
1517 bundle2-input-part: "replycaps" supported
1518 bundle2-input-part: total payload size * (glob)
1519 bundle2-input-part: "check:phases" supported
1520 bundle2-input-part: total payload size * (glob)
1521 bundle2-input-part: "check:updated-heads" supported
1522 bundle2-input-part: total payload size * (glob)
1523 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1524 adding changesets
1525 add changeset ef1ea85a6374
1526 add changeset f9cafe1212c8
1527 add changeset 911600dab2ae
1528 adding manifests
1529 adding file changes
1530 adding foo/Bar/file.txt revisions
1531 adding foo/file.txt revisions
1532 adding quux/file.py revisions
1533 calling hook pretxnchangegroup.acl: hgext.acl.hook
1534 acl: checking access for user "fred"
1535 acl: acl.allow.branches not enabled
1536 acl: acl.deny.branches not enabled
1537 acl: "group1" not defined in [acl.groups]
1538 acl: acl.allow enabled, 1 entries for user fred
1539 acl: acl.deny not enabled
1540 acl: branch access granted: "ef1ea85a6374" on branch "default"
1541 acl: path access granted: "ef1ea85a6374"
1542 acl: branch access granted: "f9cafe1212c8" on branch "default"
1543 acl: path access granted: "f9cafe1212c8"
1544 acl: branch access granted: "911600dab2ae" on branch "default"
1545 acl: path access granted: "911600dab2ae"
1546 bundle2-input-part: total payload size * (glob)
1547 bundle2-input-part: "phase-heads" supported
1548 bundle2-input-part: total payload size * (glob)
1549 bundle2-input-bundle: 5 parts total
1550 updating the branch cache
1551 added 3 changesets with 3 changes to 3 files
1552 bundle2-output-bundle: "HG20", 1 parts total
1553 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1554 bundle2-input-bundle: no-transaction
1555 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1556 bundle2-input-bundle: 1 parts total
1557 listing keys for "phases"
1558 repository tip rolled back to revision 0 (undo push)
1559 0:6675d58eff77
1560
1561
1562 $ echo '[acl.deny]' >> $config
1563 $ echo "foo/Bar/** = @group1" >> $config
1564
1565 @group is allowed inside anything but foo/Bar/
1566
1567 $ do_push fred
1568 Pushing as user fred
1569 hgrc = """
1570 [hooks]
1571 pretxnchangegroup.acl = python:hgext.acl.hook
1572 prepushkey.acl = python:hgext.acl.hook
1573 [acl]
1574 sources = push
1575 [extensions]
1576 posixgetuser=$TESTTMP/posixgetuser.py
1577 [acl.allow]
1578 ** = @group1
1579 [acl.deny]
1580 foo/Bar/** = @group1
1581 """
1582 pushing to ../b
1583 query 1; heads
1584 searching for changes
1585 all remote heads known locally
1586 listing keys for "phases"
1587 checking for updated bookmarks
1588 listing keys for "bookmarks"
1589 listing keys for "bookmarks"
1590 3 changesets found
1591 list of changesets:
1592 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1593 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1594 911600dab2ae7a9baff75958b84fe606851ce955
1595 bundle2-output-bundle: "HG20", 5 parts total
1596 bundle2-output-part: "replycaps" * bytes payload (glob)
1597 bundle2-output-part: "check:phases" 24 bytes payload
1598 bundle2-output-part: "check:updated-heads" streamed payload
1599 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1600 bundle2-output-part: "phase-heads" 24 bytes payload
1601 bundle2-input-bundle: with-transaction
1602 bundle2-input-part: "replycaps" supported
1603 bundle2-input-part: total payload size * (glob)
1604 bundle2-input-part: "check:phases" supported
1605 bundle2-input-part: total payload size * (glob)
1606 bundle2-input-part: "check:updated-heads" supported
1607 bundle2-input-part: total payload size * (glob)
1608 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1609 adding changesets
1610 add changeset ef1ea85a6374
1611 add changeset f9cafe1212c8
1612 add changeset 911600dab2ae
1613 adding manifests
1614 adding file changes
1615 adding foo/Bar/file.txt revisions
1616 adding foo/file.txt revisions
1617 adding quux/file.py revisions
1618 calling hook pretxnchangegroup.acl: hgext.acl.hook
1619 acl: checking access for user "fred"
1620 acl: acl.allow.branches not enabled
1621 acl: acl.deny.branches not enabled
1622 acl: "group1" not defined in [acl.groups]
1623 acl: acl.allow enabled, 1 entries for user fred
1624 acl: "group1" not defined in [acl.groups]
1625 acl: acl.deny enabled, 1 entries for user fred
1626 acl: branch access granted: "ef1ea85a6374" on branch "default"
1627 acl: path access granted: "ef1ea85a6374"
1628 acl: branch access granted: "f9cafe1212c8" on branch "default"
1629 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1630 bundle2-input-part: total payload size * (glob)
1631 bundle2-input-part: total payload size * (glob)
1632 bundle2-input-bundle: 5 parts total
1633 transaction abort!
1634 rollback completed
1635 resetting content of cache/rbc-revs-v2
1636 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1637 no rollback information available
1638 0:6675d58eff77
1639
1640
1641 Invalid group
1642
1643 Disable the fakegroups trick to get real failures
1644
1645 $ grep -v fakegroups $config > config.tmp
1646 $ mv config.tmp $config
1647 $ echo '[acl.allow]' >> $config
1648 $ echo "** = @unlikelytoexist" >> $config
1649 $ do_push fred 2>&1 | grep unlikelytoexist
1650 ** = @unlikelytoexist
1651 acl: "unlikelytoexist" not defined in [acl.groups]
1652 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1653 abort: group 'unlikelytoexist' is undefined
1654
1655
1656 Branch acl tests setup
1657
1658 $ init_config
1659 $ cd b
1660 $ hg up
1661 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1662 $ hg branch foobar
1663 marked working directory as branch foobar
1664 (branches are permanent and global, did you want a bookmark?)
1665 $ hg commit -m 'create foobar'
1666 $ echo 'foo contents' > abc.txt
1667 $ hg add abc.txt
1668 $ hg commit -m 'foobar contents'
1669 $ cd ..
1670 $ hg --cwd a pull ../b
1671 pulling from ../b
1672 searching for changes
1673 adding changesets
1674 adding manifests
1675 adding file changes
1676 added 2 changesets with 1 changes to 1 files (+1 heads)
1677 new changesets 81fbf4469322:fb35475503ef
1678 (run 'hg heads' to see heads)
1679
1680 Create additional changeset on foobar branch
1681
1682 $ cd a
1683 $ hg up -C foobar
1684 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1685 $ echo 'foo contents2' > abc.txt
1686 $ hg commit -m 'foobar contents2'
1687 $ cd ..
1688
1689
1690 No branch acls specified
1691
1692 $ do_push astro
1693 Pushing as user astro
1694 hgrc = """
1695 [hooks]
1696 pretxnchangegroup.acl = python:hgext.acl.hook
1697 prepushkey.acl = python:hgext.acl.hook
1698 [acl]
1699 sources = push
1700 [extensions]
1701 posixgetuser=$TESTTMP/posixgetuser.py
1702 """
1703 pushing to ../b
1704 query 1; heads
1705 searching for changes
1706 all remote heads known locally
1707 listing keys for "phases"
1708 checking for updated bookmarks
1709 listing keys for "bookmarks"
1710 listing keys for "bookmarks"
1711 4 changesets found
1712 list of changesets:
1713 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1714 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1715 911600dab2ae7a9baff75958b84fe606851ce955
1716 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1717 bundle2-output-bundle: "HG20", 5 parts total
1718 bundle2-output-part: "replycaps" * bytes payload (glob)
1719 bundle2-output-part: "check:phases" 48 bytes payload
1720 bundle2-output-part: "check:updated-heads" streamed payload
1721 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1722 bundle2-output-part: "phase-heads" 48 bytes payload
1723 bundle2-input-bundle: with-transaction
1724 bundle2-input-part: "replycaps" supported
1725 bundle2-input-part: total payload size * (glob)
1726 bundle2-input-part: "check:phases" supported
1727 bundle2-input-part: total payload size * (glob)
1728 bundle2-input-part: "check:updated-heads" supported
1729 bundle2-input-part: total payload size * (glob)
1730 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1731 adding changesets
1732 add changeset ef1ea85a6374
1733 add changeset f9cafe1212c8
1734 add changeset 911600dab2ae
1735 add changeset e8fc755d4d82
1736 adding manifests
1737 adding file changes
1738 adding abc.txt revisions
1739 adding foo/Bar/file.txt revisions
1740 adding foo/file.txt revisions
1741 adding quux/file.py revisions
1742 calling hook pretxnchangegroup.acl: hgext.acl.hook
1743 acl: checking access for user "astro"
1744 acl: acl.allow.branches not enabled
1745 acl: acl.deny.branches not enabled
1746 acl: acl.allow not enabled
1747 acl: acl.deny not enabled
1748 acl: branch access granted: "ef1ea85a6374" on branch "default"
1749 acl: path access granted: "ef1ea85a6374"
1750 acl: branch access granted: "f9cafe1212c8" on branch "default"
1751 acl: path access granted: "f9cafe1212c8"
1752 acl: branch access granted: "911600dab2ae" on branch "default"
1753 acl: path access granted: "911600dab2ae"
1754 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1755 acl: path access granted: "e8fc755d4d82"
1756 bundle2-input-part: total payload size * (glob)
1757 bundle2-input-part: "phase-heads" supported
1758 bundle2-input-part: total payload size * (glob)
1759 bundle2-input-bundle: 5 parts total
1760 updating the branch cache
1761 added 4 changesets with 4 changes to 4 files (+1 heads)
1762 bundle2-output-bundle: "HG20", 1 parts total
1763 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1764 bundle2-input-bundle: no-transaction
1765 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1766 bundle2-input-bundle: 1 parts total
1767 listing keys for "phases"
1768 repository tip rolled back to revision 2 (undo push)
1769 2:fb35475503ef
1770
1771
1772 Branch acl deny test
1773
1774 $ echo "[acl.deny.branches]" >> $config
1775 $ echo "foobar = *" >> $config
1776 $ do_push astro
1777 Pushing as user astro
1778 hgrc = """
1779 [hooks]
1780 pretxnchangegroup.acl = python:hgext.acl.hook
1781 prepushkey.acl = python:hgext.acl.hook
1782 [acl]
1783 sources = push
1784 [extensions]
1785 posixgetuser=$TESTTMP/posixgetuser.py
1786 [acl.deny.branches]
1787 foobar = *
1788 """
1789 pushing to ../b
1790 query 1; heads
1791 searching for changes
1792 all remote heads known locally
1793 listing keys for "phases"
1794 checking for updated bookmarks
1795 listing keys for "bookmarks"
1796 listing keys for "bookmarks"
1797 4 changesets found
1798 list of changesets:
1799 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1800 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1801 911600dab2ae7a9baff75958b84fe606851ce955
1802 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1803 bundle2-output-bundle: "HG20", 5 parts total
1804 bundle2-output-part: "replycaps" * bytes payload (glob)
1805 bundle2-output-part: "check:phases" 48 bytes payload
1806 bundle2-output-part: "check:updated-heads" streamed payload
1807 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1808 bundle2-output-part: "phase-heads" 48 bytes payload
1809 bundle2-input-bundle: with-transaction
1810 bundle2-input-part: "replycaps" supported
1811 bundle2-input-part: total payload size * (glob)
1812 bundle2-input-part: "check:phases" supported
1813 bundle2-input-part: total payload size * (glob)
1814 bundle2-input-part: "check:updated-heads" supported
1815 bundle2-input-part: total payload size * (glob)
1816 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1817 adding changesets
1818 add changeset ef1ea85a6374
1819 add changeset f9cafe1212c8
1820 add changeset 911600dab2ae
1821 add changeset e8fc755d4d82
1822 adding manifests
1823 adding file changes
1824 adding abc.txt revisions
1825 adding foo/Bar/file.txt revisions
1826 adding foo/file.txt revisions
1827 adding quux/file.py revisions
1828 calling hook pretxnchangegroup.acl: hgext.acl.hook
1829 acl: checking access for user "astro"
1830 acl: acl.allow.branches not enabled
1831 acl: acl.deny.branches enabled, 1 entries for user astro
1832 acl: acl.allow not enabled
1833 acl: acl.deny not enabled
1834 acl: branch access granted: "ef1ea85a6374" on branch "default"
1835 acl: path access granted: "ef1ea85a6374"
1836 acl: branch access granted: "f9cafe1212c8" on branch "default"
1837 acl: path access granted: "f9cafe1212c8"
1838 acl: branch access granted: "911600dab2ae" on branch "default"
1839 acl: path access granted: "911600dab2ae"
1840 error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1841 bundle2-input-part: total payload size * (glob)
1842 bundle2-input-part: total payload size * (glob)
1843 bundle2-input-bundle: 5 parts total
1844 transaction abort!
1845 rollback completed
1846 abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1847 no rollback information available
1848 2:fb35475503ef
1849
1850
1851 Branch acl empty allow test
1852
1853 $ init_config
1854 $ echo "[acl.allow.branches]" >> $config
1855 $ do_push astro
1856 Pushing as user astro
1857 hgrc = """
1858 [hooks]
1859 pretxnchangegroup.acl = python:hgext.acl.hook
1860 prepushkey.acl = python:hgext.acl.hook
1861 [acl]
1862 sources = push
1863 [extensions]
1864 posixgetuser=$TESTTMP/posixgetuser.py
1865 [acl.allow.branches]
1866 """
1867 pushing to ../b
1868 query 1; heads
1869 searching for changes
1870 all remote heads known locally
1871 listing keys for "phases"
1872 checking for updated bookmarks
1873 listing keys for "bookmarks"
1874 listing keys for "bookmarks"
1875 4 changesets found
1876 list of changesets:
1877 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1878 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1879 911600dab2ae7a9baff75958b84fe606851ce955
1880 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1881 bundle2-output-bundle: "HG20", 5 parts total
1882 bundle2-output-part: "replycaps" * bytes payload (glob)
1883 bundle2-output-part: "check:phases" 48 bytes payload
1884 bundle2-output-part: "check:updated-heads" streamed payload
1885 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1886 bundle2-output-part: "phase-heads" 48 bytes payload
1887 bundle2-input-bundle: with-transaction
1888 bundle2-input-part: "replycaps" supported
1889 bundle2-input-part: total payload size * (glob)
1890 bundle2-input-part: "check:phases" supported
1891 bundle2-input-part: total payload size * (glob)
1892 bundle2-input-part: "check:updated-heads" supported
1893 bundle2-input-part: total payload size * (glob)
1894 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1895 adding changesets
1896 add changeset ef1ea85a6374
1897 add changeset f9cafe1212c8
1898 add changeset 911600dab2ae
1899 add changeset e8fc755d4d82
1900 adding manifests
1901 adding file changes
1902 adding abc.txt revisions
1903 adding foo/Bar/file.txt revisions
1904 adding foo/file.txt revisions
1905 adding quux/file.py revisions
1906 calling hook pretxnchangegroup.acl: hgext.acl.hook
1907 acl: checking access for user "astro"
1908 acl: acl.allow.branches enabled, 0 entries for user astro
1909 acl: acl.deny.branches not enabled
1910 acl: acl.allow not enabled
1911 acl: acl.deny not enabled
1912 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1913 bundle2-input-part: total payload size * (glob)
1914 bundle2-input-part: total payload size * (glob)
1915 bundle2-input-bundle: 5 parts total
1916 transaction abort!
1917 rollback completed
1918 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1919 no rollback information available
1920 2:fb35475503ef
1921
1922
1923 Branch acl allow other
1924
1925 $ init_config
1926 $ echo "[acl.allow.branches]" >> $config
1927 $ echo "* = george" >> $config
1928 $ do_push astro
1929 Pushing as user astro
1930 hgrc = """
1931 [hooks]
1932 pretxnchangegroup.acl = python:hgext.acl.hook
1933 prepushkey.acl = python:hgext.acl.hook
1934 [acl]
1935 sources = push
1936 [extensions]
1937 posixgetuser=$TESTTMP/posixgetuser.py
1938 [acl.allow.branches]
1939 * = george
1940 """
1941 pushing to ../b
1942 query 1; heads
1943 searching for changes
1944 all remote heads known locally
1945 listing keys for "phases"
1946 checking for updated bookmarks
1947 listing keys for "bookmarks"
1948 listing keys for "bookmarks"
1949 4 changesets found
1950 list of changesets:
1951 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1952 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1953 911600dab2ae7a9baff75958b84fe606851ce955
1954 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1955 bundle2-output-bundle: "HG20", 5 parts total
1956 bundle2-output-part: "replycaps" * bytes payload (glob)
1957 bundle2-output-part: "check:phases" 48 bytes payload
1958 bundle2-output-part: "check:updated-heads" streamed payload
1959 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1960 bundle2-output-part: "phase-heads" 48 bytes payload
1961 bundle2-input-bundle: with-transaction
1962 bundle2-input-part: "replycaps" supported
1963 bundle2-input-part: total payload size * (glob)
1964 bundle2-input-part: "check:phases" supported
1965 bundle2-input-part: total payload size * (glob)
1966 bundle2-input-part: "check:updated-heads" supported
1967 bundle2-input-part: total payload size * (glob)
1968 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1969 adding changesets
1970 add changeset ef1ea85a6374
1971 add changeset f9cafe1212c8
1972 add changeset 911600dab2ae
1973 add changeset e8fc755d4d82
1974 adding manifests
1975 adding file changes
1976 adding abc.txt revisions
1977 adding foo/Bar/file.txt revisions
1978 adding foo/file.txt revisions
1979 adding quux/file.py revisions
1980 calling hook pretxnchangegroup.acl: hgext.acl.hook
1981 acl: checking access for user "astro"
1982 acl: acl.allow.branches enabled, 0 entries for user astro
1983 acl: acl.deny.branches not enabled
1984 acl: acl.allow not enabled
1985 acl: acl.deny not enabled
1986 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1987 bundle2-input-part: total payload size * (glob)
1988 bundle2-input-part: total payload size * (glob)
1989 bundle2-input-bundle: 5 parts total
1990 transaction abort!
1991 rollback completed
1992 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1993 no rollback information available
1994 2:fb35475503ef
1995
1996 $ do_push george
1997 Pushing as user george
1998 hgrc = """
1999 [hooks]
2000 pretxnchangegroup.acl = python:hgext.acl.hook
2001 prepushkey.acl = python:hgext.acl.hook
2002 [acl]
2003 sources = push
2004 [extensions]
2005 posixgetuser=$TESTTMP/posixgetuser.py
2006 [acl.allow.branches]
2007 * = george
2008 """
2009 pushing to ../b
2010 query 1; heads
2011 searching for changes
2012 all remote heads known locally
2013 listing keys for "phases"
2014 checking for updated bookmarks
2015 listing keys for "bookmarks"
2016 listing keys for "bookmarks"
2017 4 changesets found
2018 list of changesets:
2019 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2020 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2021 911600dab2ae7a9baff75958b84fe606851ce955
2022 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2023 bundle2-output-bundle: "HG20", 5 parts total
2024 bundle2-output-part: "replycaps" * bytes payload (glob)
2025 bundle2-output-part: "check:phases" 48 bytes payload
2026 bundle2-output-part: "check:updated-heads" streamed payload
2027 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2028 bundle2-output-part: "phase-heads" 48 bytes payload
2029 bundle2-input-bundle: with-transaction
2030 bundle2-input-part: "replycaps" supported
2031 bundle2-input-part: total payload size * (glob)
2032 bundle2-input-part: "check:phases" supported
2033 bundle2-input-part: total payload size * (glob)
2034 bundle2-input-part: "check:updated-heads" supported
2035 bundle2-input-part: total payload size * (glob)
2036 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2037 adding changesets
2038 add changeset ef1ea85a6374
2039 add changeset f9cafe1212c8
2040 add changeset 911600dab2ae
2041 add changeset e8fc755d4d82
2042 adding manifests
2043 adding file changes
2044 adding abc.txt revisions
2045 adding foo/Bar/file.txt revisions
2046 adding foo/file.txt revisions
2047 adding quux/file.py revisions
2048 calling hook pretxnchangegroup.acl: hgext.acl.hook
2049 acl: checking access for user "george"
2050 acl: acl.allow.branches enabled, 1 entries for user george
2051 acl: acl.deny.branches not enabled
2052 acl: acl.allow not enabled
2053 acl: acl.deny not enabled
2054 acl: branch access granted: "ef1ea85a6374" on branch "default"
2055 acl: path access granted: "ef1ea85a6374"
2056 acl: branch access granted: "f9cafe1212c8" on branch "default"
2057 acl: path access granted: "f9cafe1212c8"
2058 acl: branch access granted: "911600dab2ae" on branch "default"
2059 acl: path access granted: "911600dab2ae"
2060 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2061 acl: path access granted: "e8fc755d4d82"
2062 bundle2-input-part: total payload size * (glob)
2063 bundle2-input-part: "phase-heads" supported
2064 bundle2-input-part: total payload size * (glob)
2065 bundle2-input-bundle: 5 parts total
2066 updating the branch cache
2067 added 4 changesets with 4 changes to 4 files (+1 heads)
2068 bundle2-output-bundle: "HG20", 1 parts total
2069 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
2070 bundle2-input-bundle: no-transaction
2071 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
2072 bundle2-input-bundle: 1 parts total
2073 listing keys for "phases"
2074 repository tip rolled back to revision 2 (undo push)
2075 2:fb35475503ef
2076
2077
2078 Branch acl conflicting allow
2079 asterisk ends up applying to all branches and allowing george to
2080 push foobar into the remote
2081
2082 $ init_config
2083 $ echo "[acl.allow.branches]" >> $config
2084 $ echo "foobar = astro" >> $config
2085 $ echo "* = george" >> $config
2086 $ do_push george
2087 Pushing as user george
2088 hgrc = """
2089 [hooks]
2090 pretxnchangegroup.acl = python:hgext.acl.hook
2091 prepushkey.acl = python:hgext.acl.hook
2092 [acl]
2093 sources = push
2094 [extensions]
2095 posixgetuser=$TESTTMP/posixgetuser.py
2096 [acl.allow.branches]
2097 foobar = astro
2098 * = george
2099 """
2100 pushing to ../b
2101 query 1; heads
2102 searching for changes
2103 all remote heads known locally
2104 listing keys for "phases"
2105 checking for updated bookmarks
2106 listing keys for "bookmarks"
2107 listing keys for "bookmarks"
2108 4 changesets found
2109 list of changesets:
2110 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2111 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2112 911600dab2ae7a9baff75958b84fe606851ce955
2113 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2114 bundle2-output-bundle: "HG20", 5 parts total
2115 bundle2-output-part: "replycaps" * bytes payload (glob)
2116 bundle2-output-part: "check:phases" 48 bytes payload
2117 bundle2-output-part: "check:updated-heads" streamed payload
2118 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2119 bundle2-output-part: "phase-heads" 48 bytes payload
2120 bundle2-input-bundle: with-transaction
2121 bundle2-input-part: "replycaps" supported
2122 bundle2-input-part: total payload size * (glob)
2123 bundle2-input-part: "check:phases" supported
2124 bundle2-input-part: total payload size * (glob)
2125 bundle2-input-part: "check:updated-heads" supported
2126 bundle2-input-part: total payload size * (glob)
2127 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2128 adding changesets
2129 add changeset ef1ea85a6374
2130 add changeset f9cafe1212c8
2131 add changeset 911600dab2ae
2132 add changeset e8fc755d4d82
2133 adding manifests
2134 adding file changes
2135 adding abc.txt revisions
2136 adding foo/Bar/file.txt revisions
2137 adding foo/file.txt revisions
2138 adding quux/file.py revisions
2139 calling hook pretxnchangegroup.acl: hgext.acl.hook
2140 acl: checking access for user "george"
2141 acl: acl.allow.branches enabled, 1 entries for user george
2142 acl: acl.deny.branches not enabled
2143 acl: acl.allow not enabled
2144 acl: acl.deny not enabled
2145 acl: branch access granted: "ef1ea85a6374" on branch "default"
2146 acl: path access granted: "ef1ea85a6374"
2147 acl: branch access granted: "f9cafe1212c8" on branch "default"
2148 acl: path access granted: "f9cafe1212c8"
2149 acl: branch access granted: "911600dab2ae" on branch "default"
2150 acl: path access granted: "911600dab2ae"
2151 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2152 acl: path access granted: "e8fc755d4d82"
2153 bundle2-input-part: total payload size * (glob)
2154 bundle2-input-part: "phase-heads" supported
2155 bundle2-input-part: total payload size * (glob)
2156 bundle2-input-bundle: 5 parts total
2157 updating the branch cache
2158 added 4 changesets with 4 changes to 4 files (+1 heads)
2159 bundle2-output-bundle: "HG20", 1 parts total
2160 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
2161 bundle2-input-bundle: no-transaction
2162 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
2163 bundle2-input-bundle: 1 parts total
2164 listing keys for "phases"
2165 repository tip rolled back to revision 2 (undo push)
2166 2:fb35475503ef
2167
2168 Branch acl conflicting deny
2169
2170 $ init_config
2171 $ echo "[acl.deny.branches]" >> $config
2172 $ echo "foobar = astro" >> $config
2173 $ echo "default = astro" >> $config
2174 $ echo "* = george" >> $config
2175 $ do_push george
2176 Pushing as user george
2177 hgrc = """
2178 [hooks]
2179 pretxnchangegroup.acl = python:hgext.acl.hook
2180 prepushkey.acl = python:hgext.acl.hook
2181 [acl]
2182 sources = push
2183 [extensions]
2184 posixgetuser=$TESTTMP/posixgetuser.py
2185 [acl.deny.branches]
2186 foobar = astro
2187 default = astro
2188 * = george
2189 """
2190 pushing to ../b
2191 query 1; heads
2192 searching for changes
2193 all remote heads known locally
2194 listing keys for "phases"
2195 checking for updated bookmarks
2196 listing keys for "bookmarks"
2197 listing keys for "bookmarks"
2198 4 changesets found
2199 list of changesets:
2200 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2201 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2202 911600dab2ae7a9baff75958b84fe606851ce955
2203 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2204 bundle2-output-bundle: "HG20", 5 parts total
2205 bundle2-output-part: "replycaps" * bytes payload (glob)
2206 bundle2-output-part: "check:phases" 48 bytes payload
2207 bundle2-output-part: "check:updated-heads" streamed payload
2208 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2209 bundle2-output-part: "phase-heads" 48 bytes payload
2210 bundle2-input-bundle: with-transaction
2211 bundle2-input-part: "replycaps" supported
2212 bundle2-input-part: total payload size * (glob)
2213 bundle2-input-part: "check:phases" supported
2214 bundle2-input-part: total payload size * (glob)
2215 bundle2-input-part: "check:updated-heads" supported
2216 bundle2-input-part: total payload size * (glob)
2217 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2218 adding changesets
2219 add changeset ef1ea85a6374
2220 add changeset f9cafe1212c8
2221 add changeset 911600dab2ae
2222 add changeset e8fc755d4d82
2223 adding manifests
2224 adding file changes
2225 adding abc.txt revisions
2226 adding foo/Bar/file.txt revisions
2227 adding foo/file.txt revisions
2228 adding quux/file.py revisions
2229 calling hook pretxnchangegroup.acl: hgext.acl.hook
2230 acl: checking access for user "george"
2231 acl: acl.allow.branches not enabled
2232 acl: acl.deny.branches enabled, 1 entries for user george
2233 acl: acl.allow not enabled
2234 acl: acl.deny not enabled
2235 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2236 bundle2-input-part: total payload size * (glob)
2237 bundle2-input-part: total payload size * (glob)
2238 bundle2-input-bundle: 5 parts total
2239 transaction abort!
2240 rollback completed
2241 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2242 no rollback information available
2243 2:fb35475503ef
2244
2245 User 'astro' must not be denied
2246
2247 $ init_config
2248 $ echo "[acl.deny.branches]" >> $config
2249 $ echo "default = !astro" >> $config
2250 $ do_push astro
2251 Pushing as user astro
2252 hgrc = """
2253 [hooks]
2254 pretxnchangegroup.acl = python:hgext.acl.hook
2255 prepushkey.acl = python:hgext.acl.hook
2256 [acl]
2257 sources = push
2258 [extensions]
2259 posixgetuser=$TESTTMP/posixgetuser.py
2260 [acl.deny.branches]
2261 default = !astro
2262 """
2263 pushing to ../b
2264 query 1; heads
2265 searching for changes
2266 all remote heads known locally
2267 listing keys for "phases"
2268 checking for updated bookmarks
2269 listing keys for "bookmarks"
2270 listing keys for "bookmarks"
2271 4 changesets found
2272 list of changesets:
2273 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2274 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2275 911600dab2ae7a9baff75958b84fe606851ce955
2276 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2277 bundle2-output-bundle: "HG20", 5 parts total
2278 bundle2-output-part: "replycaps" * bytes payload (glob)
2279 bundle2-output-part: "check:phases" 48 bytes payload
2280 bundle2-output-part: "check:updated-heads" streamed payload
2281 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2282 bundle2-output-part: "phase-heads" 48 bytes payload
2283 bundle2-input-bundle: with-transaction
2284 bundle2-input-part: "replycaps" supported
2285 bundle2-input-part: total payload size * (glob)
2286 bundle2-input-part: "check:phases" supported
2287 bundle2-input-part: total payload size * (glob)
2288 bundle2-input-part: "check:updated-heads" supported
2289 bundle2-input-part: total payload size * (glob)
2290 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2291 adding changesets
2292 add changeset ef1ea85a6374
2293 add changeset f9cafe1212c8
2294 add changeset 911600dab2ae
2295 add changeset e8fc755d4d82
2296 adding manifests
2297 adding file changes
2298 adding abc.txt revisions
2299 adding foo/Bar/file.txt revisions
2300 adding foo/file.txt revisions
2301 adding quux/file.py revisions
2302 calling hook pretxnchangegroup.acl: hgext.acl.hook
2303 acl: checking access for user "astro"
2304 acl: acl.allow.branches not enabled
2305 acl: acl.deny.branches enabled, 0 entries for user astro
2306 acl: acl.allow not enabled
2307 acl: acl.deny not enabled
2308 acl: branch access granted: "ef1ea85a6374" on branch "default"
2309 acl: path access granted: "ef1ea85a6374"
2310 acl: branch access granted: "f9cafe1212c8" on branch "default"
2311 acl: path access granted: "f9cafe1212c8"
2312 acl: branch access granted: "911600dab2ae" on branch "default"
2313 acl: path access granted: "911600dab2ae"
2314 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2315 acl: path access granted: "e8fc755d4d82"
2316 bundle2-input-part: total payload size * (glob)
2317 bundle2-input-part: "phase-heads" supported
2318 bundle2-input-part: total payload size * (glob)
2319 bundle2-input-bundle: 5 parts total
2320 updating the branch cache
2321 added 4 changesets with 4 changes to 4 files (+1 heads)
2322 bundle2-output-bundle: "HG20", 1 parts total
2323 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
2324 bundle2-input-bundle: no-transaction
2325 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
2326 bundle2-input-bundle: 1 parts total
2327 listing keys for "phases"
2328 repository tip rolled back to revision 2 (undo push)
2329 2:fb35475503ef
2330
2331
2332 Non-astro users must be denied
2333
2334 $ do_push george
2335 Pushing as user george
2336 hgrc = """
2337 [hooks]
2338 pretxnchangegroup.acl = python:hgext.acl.hook
2339 prepushkey.acl = python:hgext.acl.hook
2340 [acl]
2341 sources = push
2342 [extensions]
2343 posixgetuser=$TESTTMP/posixgetuser.py
2344 [acl.deny.branches]
2345 default = !astro
2346 """
2347 pushing to ../b
2348 query 1; heads
2349 searching for changes
2350 all remote heads known locally
2351 listing keys for "phases"
2352 checking for updated bookmarks
2353 listing keys for "bookmarks"
2354 listing keys for "bookmarks"
2355 4 changesets found
2356 list of changesets:
2357 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2358 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2359 911600dab2ae7a9baff75958b84fe606851ce955
2360 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2361 bundle2-output-bundle: "HG20", 5 parts total
2362 bundle2-output-part: "replycaps" * bytes payload (glob)
2363 bundle2-output-part: "check:phases" 48 bytes payload
2364 bundle2-output-part: "check:updated-heads" streamed payload
2365 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2366 bundle2-output-part: "phase-heads" 48 bytes payload
2367 bundle2-input-bundle: with-transaction
2368 bundle2-input-part: "replycaps" supported
2369 bundle2-input-part: total payload size * (glob)
2370 bundle2-input-part: "check:phases" supported
2371 bundle2-input-part: total payload size * (glob)
2372 bundle2-input-part: "check:updated-heads" supported
2373 bundle2-input-part: total payload size * (glob)
2374 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2375 adding changesets
2376 add changeset ef1ea85a6374
2377 add changeset f9cafe1212c8
2378 add changeset 911600dab2ae
2379 add changeset e8fc755d4d82
2380 adding manifests
2381 adding file changes
2382 adding abc.txt revisions
2383 adding foo/Bar/file.txt revisions
2384 adding foo/file.txt revisions
2385 adding quux/file.py revisions
2386 calling hook pretxnchangegroup.acl: hgext.acl.hook
2387 acl: checking access for user "george"
2388 acl: acl.allow.branches not enabled
2389 acl: acl.deny.branches enabled, 1 entries for user george
2390 acl: acl.allow not enabled
2391 acl: acl.deny not enabled
2392 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2393 bundle2-input-part: total payload size * (glob)
2394 bundle2-input-part: total payload size * (glob)
2395 bundle2-input-bundle: 5 parts total
2396 transaction abort!
2397 rollback completed
2398 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2399 no rollback information available
2400 2:fb35475503ef
2401
2402