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