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