Mercurial > hg
annotate tests/test-acl.t @ 12998:91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
With this patch applied, Mercurial will list the hashes of new remote heads
if push --debug aborts because of new remote heads (option -f/--force not set).
Example:
$ hg push --debug repo1
using http://example.org/repo1
http auth: user johndoe, password not set
sending between command
pushing to http://example.org/repo1
sending capabilities command
capabilities: changegroupsubset stream=1 lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN branchmap
sending heads command
searching for changes
common changesets up to 609edbc7853f
sending branchmap command
new remote heads on branch 'default' <- new output line
new remote head 5862c07f53a2 <- new output line
abort: push creates new remote heads on branch 'default'!
(did you forget to merge? use push -f to force)
Compare to without --debug (not changed by this patch, including it here
for reference purposes only):
$ hg push repo1
pushing to http://example.org/repo1
searching for changes
abort: push creates new remote heads on branch 'default'!
(did you forget to merge? use push -f to force)
Motivation for this change:
'hg outgoing' may list a whole lot of benign changesets plus an odd changeset
that will trigger the "new remote heads" abort. It can be hard to spot that
single unwanted changeset (it may be an old forgotten experiment, lingering
in the local repo).
"hg log -r 'heads(outgoing())'" might be useful, but that also lists a head
that may be benign on push.
Inside prepush(), we already know which heads are causing troubles on 'hg push'.
Why not make that info available (at least on --debug)?
This would also be helpful for doing remote support, as the supporter can ask
the user to paste the output of 'hg push --debug' on error and then ask further
questions about the heads listed.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Thu, 11 Nov 2010 15:51:20 +0100 |
parents | b00eda50ad2b |
children | c36dad4f6e54 |
rev | line source |
---|---|
11849 | 1 > do_push() |
2 > { | |
3 > user=$1 | |
4 > shift | |
5 > echo "Pushing as user $user" | |
6 > echo 'hgrc = """' | |
7 > sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py | |
8 > echo '"""' | |
9 > if test -f acl.config; then | |
10 > echo 'acl.config = """' | |
11 > cat acl.config | |
12 > echo '"""' | |
13 > fi | |
14 > # On AIX /etc/profile sets LOGNAME read-only. So | |
15 > # LOGNAME=$user hg --cws a --debug push ../b | |
16 > # fails with "This variable is read only." | |
17 > # Use env to work around this. | |
18 > env LOGNAME=$user hg --cwd a --debug push ../b | |
19 > hg --cwd b rollback | |
20 > hg --cwd b --quiet tip | |
21 > echo | |
22 > } | |
23 | |
24 > init_config() | |
25 > { | |
26 > cat > fakegroups.py <<EOF | |
27 > from hgext import acl | |
28 > def fakegetusers(ui, group): | |
29 > try: | |
30 > return acl._getusersorig(ui, group) | |
31 > except: | |
32 > return ["fred", "betty"] | |
33 > acl._getusersorig = acl._getusers | |
34 > acl._getusers = fakegetusers | |
35 > EOF | |
36 > rm -f acl.config | |
37 > cat > $config <<EOF | |
38 > [hooks] | |
39 > pretxnchangegroup.acl = python:hgext.acl.hook | |
40 > [acl] | |
41 > sources = push | |
42 > [extensions] | |
43 > f=`pwd`/fakegroups.py | |
44 > EOF | |
45 > } | |
46 | |
47 $ hg init a | |
48 $ cd a | |
49 $ mkdir foo foo/Bar quux | |
50 $ echo 'in foo' > foo/file.txt | |
51 $ echo 'in foo/Bar' > foo/Bar/file.txt | |
52 $ echo 'in quux' > quux/file.py | |
53 $ hg add -q | |
54 $ hg ci -m 'add files' -d '1000000 0' | |
55 $ echo >> foo/file.txt | |
56 $ hg ci -m 'change foo/file' -d '1000001 0' | |
57 $ echo >> foo/Bar/file.txt | |
58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0' | |
59 $ echo >> quux/file.py | |
60 $ hg ci -m 'change quux/file' -d '1000003 0' | |
61 $ hg tip --quiet | |
62 3:911600dab2ae | |
63 | |
64 $ cd .. | |
65 $ hg clone -r 0 a b | |
66 adding changesets | |
67 adding manifests | |
68 adding file changes | |
69 added 1 changesets with 3 changes to 3 files | |
70 updating to branch default | |
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
72 | |
73 $ echo '[extensions]' >> $HGRCPATH | |
74 $ echo 'acl =' >> $HGRCPATH | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
75 |
11849 | 76 $ config=b/.hg/hgrc |
77 | |
78 Extension disabled for lack of a hook | |
79 | |
80 $ do_push fred | |
81 Pushing as user fred | |
82 hgrc = """ | |
83 """ | |
84 pushing to ../b | |
85 searching for changes | |
86 common changesets up to 6675d58eff77 | |
87 3 changesets found | |
88 list of changesets: | |
89 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
90 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
91 911600dab2ae7a9baff75958b84fe606851ce955 | |
92 adding changesets | |
93 bundling changes: 0 chunks | |
94 bundling changes: 1 chunks | |
95 bundling changes: 2 chunks | |
96 bundling changes: 3 chunks | |
97 bundling changes: 4 chunks | |
98 bundling changes: 5 chunks | |
99 bundling changes: 6 chunks | |
100 bundling changes: 7 chunks | |
101 bundling changes: 8 chunks | |
102 bundling changes: 9 chunks | |
103 bundling manifests: 0 chunks | |
104 bundling manifests: 1 chunks | |
105 bundling manifests: 2 chunks | |
106 bundling manifests: 3 chunks | |
107 bundling manifests: 4 chunks | |
108 bundling manifests: 5 chunks | |
109 bundling manifests: 6 chunks | |
110 bundling manifests: 7 chunks | |
111 bundling manifests: 8 chunks | |
112 bundling manifests: 9 chunks | |
113 bundling files: foo/Bar/file.txt 0 chunks | |
114 bundling files: foo/Bar/file.txt 1 chunks | |
115 bundling files: foo/Bar/file.txt 2 chunks | |
116 bundling files: foo/Bar/file.txt 3 chunks | |
117 bundling files: foo/file.txt 4 chunks | |
118 bundling files: foo/file.txt 5 chunks | |
119 bundling files: foo/file.txt 6 chunks | |
120 bundling files: foo/file.txt 7 chunks | |
121 bundling files: quux/file.py 8 chunks | |
122 bundling files: quux/file.py 9 chunks | |
123 bundling files: quux/file.py 10 chunks | |
124 bundling files: quux/file.py 11 chunks | |
125 changesets: 1 chunks | |
126 add changeset ef1ea85a6374 | |
127 changesets: 2 chunks | |
128 add changeset f9cafe1212c8 | |
129 changesets: 3 chunks | |
130 add changeset 911600dab2ae | |
131 adding manifests | |
132 manifests: 1/3 chunks (33.33%) | |
133 manifests: 2/3 chunks (66.67%) | |
134 manifests: 3/3 chunks (100.00%) | |
135 adding file changes | |
136 adding foo/Bar/file.txt revisions | |
137 files: 1/3 chunks (33.33%) | |
138 adding foo/file.txt revisions | |
139 files: 2/3 chunks (66.67%) | |
140 adding quux/file.py revisions | |
141 files: 3/3 chunks (100.00%) | |
142 added 3 changesets with 3 changes to 3 files | |
143 updating the branch cache | |
144 rolling back to revision 0 (undo push) | |
145 0:6675d58eff77 | |
146 | |
147 | |
148 $ echo '[hooks]' >> $config | |
149 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config | |
150 | |
151 Extension disabled for lack of acl.sources | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
152 |
11849 | 153 $ do_push fred |
154 Pushing as user fred | |
155 hgrc = """ | |
156 [hooks] | |
157 pretxnchangegroup.acl = python:hgext.acl.hook | |
158 """ | |
159 pushing to ../b | |
160 searching for changes | |
161 common changesets up to 6675d58eff77 | |
162 invalidating branch cache (tip differs) | |
163 3 changesets found | |
164 list of changesets: | |
165 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
166 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
167 911600dab2ae7a9baff75958b84fe606851ce955 | |
168 adding changesets | |
169 bundling changes: 0 chunks | |
170 bundling changes: 1 chunks | |
171 bundling changes: 2 chunks | |
172 bundling changes: 3 chunks | |
173 bundling changes: 4 chunks | |
174 bundling changes: 5 chunks | |
175 bundling changes: 6 chunks | |
176 bundling changes: 7 chunks | |
177 bundling changes: 8 chunks | |
178 bundling changes: 9 chunks | |
179 bundling manifests: 0 chunks | |
180 bundling manifests: 1 chunks | |
181 bundling manifests: 2 chunks | |
182 bundling manifests: 3 chunks | |
183 bundling manifests: 4 chunks | |
184 bundling manifests: 5 chunks | |
185 bundling manifests: 6 chunks | |
186 bundling manifests: 7 chunks | |
187 bundling manifests: 8 chunks | |
188 bundling manifests: 9 chunks | |
189 bundling files: foo/Bar/file.txt 0 chunks | |
190 bundling files: foo/Bar/file.txt 1 chunks | |
191 bundling files: foo/Bar/file.txt 2 chunks | |
192 bundling files: foo/Bar/file.txt 3 chunks | |
193 bundling files: foo/file.txt 4 chunks | |
194 bundling files: foo/file.txt 5 chunks | |
195 bundling files: foo/file.txt 6 chunks | |
196 bundling files: foo/file.txt 7 chunks | |
197 bundling files: quux/file.py 8 chunks | |
198 bundling files: quux/file.py 9 chunks | |
199 bundling files: quux/file.py 10 chunks | |
200 bundling files: quux/file.py 11 chunks | |
201 changesets: 1 chunks | |
202 add changeset ef1ea85a6374 | |
203 changesets: 2 chunks | |
204 add changeset f9cafe1212c8 | |
205 changesets: 3 chunks | |
206 add changeset 911600dab2ae | |
207 adding manifests | |
208 manifests: 1/3 chunks (33.33%) | |
209 manifests: 2/3 chunks (66.67%) | |
210 manifests: 3/3 chunks (100.00%) | |
211 adding file changes | |
212 adding foo/Bar/file.txt revisions | |
213 files: 1/3 chunks (33.33%) | |
214 adding foo/file.txt revisions | |
215 files: 2/3 chunks (66.67%) | |
216 adding quux/file.py revisions | |
217 files: 3/3 chunks (100.00%) | |
218 added 3 changesets with 3 changes to 3 files | |
219 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
220 acl: changes have source "push" - skipping | |
221 updating the branch cache | |
222 rolling back to revision 0 (undo push) | |
223 0:6675d58eff77 | |
224 | |
225 | |
226 No [acl.allow]/[acl.deny] | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
227 |
11849 | 228 $ echo '[acl]' >> $config |
229 $ echo 'sources = push' >> $config | |
230 $ do_push fred | |
231 Pushing as user fred | |
232 hgrc = """ | |
233 [hooks] | |
234 pretxnchangegroup.acl = python:hgext.acl.hook | |
235 [acl] | |
236 sources = push | |
237 """ | |
238 pushing to ../b | |
239 searching for changes | |
240 common changesets up to 6675d58eff77 | |
241 invalidating branch cache (tip differs) | |
242 3 changesets found | |
243 list of changesets: | |
244 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
245 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
246 911600dab2ae7a9baff75958b84fe606851ce955 | |
247 adding changesets | |
248 bundling changes: 0 chunks | |
249 bundling changes: 1 chunks | |
250 bundling changes: 2 chunks | |
251 bundling changes: 3 chunks | |
252 bundling changes: 4 chunks | |
253 bundling changes: 5 chunks | |
254 bundling changes: 6 chunks | |
255 bundling changes: 7 chunks | |
256 bundling changes: 8 chunks | |
257 bundling changes: 9 chunks | |
258 bundling manifests: 0 chunks | |
259 bundling manifests: 1 chunks | |
260 bundling manifests: 2 chunks | |
261 bundling manifests: 3 chunks | |
262 bundling manifests: 4 chunks | |
263 bundling manifests: 5 chunks | |
264 bundling manifests: 6 chunks | |
265 bundling manifests: 7 chunks | |
266 bundling manifests: 8 chunks | |
267 bundling manifests: 9 chunks | |
268 bundling files: foo/Bar/file.txt 0 chunks | |
269 bundling files: foo/Bar/file.txt 1 chunks | |
270 bundling files: foo/Bar/file.txt 2 chunks | |
271 bundling files: foo/Bar/file.txt 3 chunks | |
272 bundling files: foo/file.txt 4 chunks | |
273 bundling files: foo/file.txt 5 chunks | |
274 bundling files: foo/file.txt 6 chunks | |
275 bundling files: foo/file.txt 7 chunks | |
276 bundling files: quux/file.py 8 chunks | |
277 bundling files: quux/file.py 9 chunks | |
278 bundling files: quux/file.py 10 chunks | |
279 bundling files: quux/file.py 11 chunks | |
280 changesets: 1 chunks | |
281 add changeset ef1ea85a6374 | |
282 changesets: 2 chunks | |
283 add changeset f9cafe1212c8 | |
284 changesets: 3 chunks | |
285 add changeset 911600dab2ae | |
286 adding manifests | |
287 manifests: 1/3 chunks (33.33%) | |
288 manifests: 2/3 chunks (66.67%) | |
289 manifests: 3/3 chunks (100.00%) | |
290 adding file changes | |
291 adding foo/Bar/file.txt revisions | |
292 files: 1/3 chunks (33.33%) | |
293 adding foo/file.txt revisions | |
294 files: 2/3 chunks (66.67%) | |
295 adding quux/file.py revisions | |
296 files: 3/3 chunks (100.00%) | |
297 added 3 changesets with 3 changes to 3 files | |
298 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
299 acl: acl.allow.branches not enabled | |
300 acl: acl.deny.branches not enabled | |
301 acl: acl.allow not enabled | |
302 acl: acl.deny not enabled | |
303 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
304 acl: allowing changeset ef1ea85a6374 | |
305 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
306 acl: allowing changeset f9cafe1212c8 | |
307 acl: branch access granted: "911600dab2ae" on branch "default" | |
308 acl: allowing changeset 911600dab2ae | |
309 updating the branch cache | |
310 rolling back to revision 0 (undo push) | |
311 0:6675d58eff77 | |
312 | |
313 | |
314 Empty [acl.allow] | |
315 | |
316 $ echo '[acl.allow]' >> $config | |
317 $ do_push fred | |
318 Pushing as user fred | |
319 hgrc = """ | |
320 [hooks] | |
321 pretxnchangegroup.acl = python:hgext.acl.hook | |
322 [acl] | |
323 sources = push | |
324 [acl.allow] | |
325 """ | |
326 pushing to ../b | |
327 searching for changes | |
328 common changesets up to 6675d58eff77 | |
329 invalidating branch cache (tip differs) | |
330 3 changesets found | |
331 list of changesets: | |
332 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
333 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
334 911600dab2ae7a9baff75958b84fe606851ce955 | |
335 adding changesets | |
336 bundling changes: 0 chunks | |
337 bundling changes: 1 chunks | |
338 bundling changes: 2 chunks | |
339 bundling changes: 3 chunks | |
340 bundling changes: 4 chunks | |
341 bundling changes: 5 chunks | |
342 bundling changes: 6 chunks | |
343 bundling changes: 7 chunks | |
344 bundling changes: 8 chunks | |
345 bundling changes: 9 chunks | |
346 bundling manifests: 0 chunks | |
347 bundling manifests: 1 chunks | |
348 bundling manifests: 2 chunks | |
349 bundling manifests: 3 chunks | |
350 bundling manifests: 4 chunks | |
351 bundling manifests: 5 chunks | |
352 bundling manifests: 6 chunks | |
353 bundling manifests: 7 chunks | |
354 bundling manifests: 8 chunks | |
355 bundling manifests: 9 chunks | |
356 bundling files: foo/Bar/file.txt 0 chunks | |
357 bundling files: foo/Bar/file.txt 1 chunks | |
358 bundling files: foo/Bar/file.txt 2 chunks | |
359 bundling files: foo/Bar/file.txt 3 chunks | |
360 bundling files: foo/file.txt 4 chunks | |
361 bundling files: foo/file.txt 5 chunks | |
362 bundling files: foo/file.txt 6 chunks | |
363 bundling files: foo/file.txt 7 chunks | |
364 bundling files: quux/file.py 8 chunks | |
365 bundling files: quux/file.py 9 chunks | |
366 bundling files: quux/file.py 10 chunks | |
367 bundling files: quux/file.py 11 chunks | |
368 changesets: 1 chunks | |
369 add changeset ef1ea85a6374 | |
370 changesets: 2 chunks | |
371 add changeset f9cafe1212c8 | |
372 changesets: 3 chunks | |
373 add changeset 911600dab2ae | |
374 adding manifests | |
375 manifests: 1/3 chunks (33.33%) | |
376 manifests: 2/3 chunks (66.67%) | |
377 manifests: 3/3 chunks (100.00%) | |
378 adding file changes | |
379 adding foo/Bar/file.txt revisions | |
380 files: 1/3 chunks (33.33%) | |
381 adding foo/file.txt revisions | |
382 files: 2/3 chunks (66.67%) | |
383 adding quux/file.py revisions | |
384 files: 3/3 chunks (100.00%) | |
385 added 3 changesets with 3 changes to 3 files | |
386 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
387 acl: acl.allow.branches not enabled | |
388 acl: acl.deny.branches not enabled | |
389 acl: acl.allow enabled, 0 entries for user fred | |
390 acl: acl.deny not enabled | |
391 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
392 acl: user fred not allowed on foo/file.txt | |
393 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374 | |
394 transaction abort! | |
395 rollback completed | |
396 abort: acl: access denied for changeset ef1ea85a6374 | |
397 no rollback information available | |
398 0:6675d58eff77 | |
399 | |
400 | |
401 fred is allowed inside foo/ | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
402 |
11849 | 403 $ echo 'foo/** = fred' >> $config |
404 $ do_push fred | |
405 Pushing as user fred | |
406 hgrc = """ | |
407 [hooks] | |
408 pretxnchangegroup.acl = python:hgext.acl.hook | |
409 [acl] | |
410 sources = push | |
411 [acl.allow] | |
412 foo/** = fred | |
413 """ | |
414 pushing to ../b | |
415 searching for changes | |
416 common changesets up to 6675d58eff77 | |
417 3 changesets found | |
418 list of changesets: | |
419 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
420 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
421 911600dab2ae7a9baff75958b84fe606851ce955 | |
422 adding changesets | |
423 bundling changes: 0 chunks | |
424 bundling changes: 1 chunks | |
425 bundling changes: 2 chunks | |
426 bundling changes: 3 chunks | |
427 bundling changes: 4 chunks | |
428 bundling changes: 5 chunks | |
429 bundling changes: 6 chunks | |
430 bundling changes: 7 chunks | |
431 bundling changes: 8 chunks | |
432 bundling changes: 9 chunks | |
433 bundling manifests: 0 chunks | |
434 bundling manifests: 1 chunks | |
435 bundling manifests: 2 chunks | |
436 bundling manifests: 3 chunks | |
437 bundling manifests: 4 chunks | |
438 bundling manifests: 5 chunks | |
439 bundling manifests: 6 chunks | |
440 bundling manifests: 7 chunks | |
441 bundling manifests: 8 chunks | |
442 bundling manifests: 9 chunks | |
443 bundling files: foo/Bar/file.txt 0 chunks | |
444 bundling files: foo/Bar/file.txt 1 chunks | |
445 bundling files: foo/Bar/file.txt 2 chunks | |
446 bundling files: foo/Bar/file.txt 3 chunks | |
447 bundling files: foo/file.txt 4 chunks | |
448 bundling files: foo/file.txt 5 chunks | |
449 bundling files: foo/file.txt 6 chunks | |
450 bundling files: foo/file.txt 7 chunks | |
451 bundling files: quux/file.py 8 chunks | |
452 bundling files: quux/file.py 9 chunks | |
453 bundling files: quux/file.py 10 chunks | |
454 bundling files: quux/file.py 11 chunks | |
455 changesets: 1 chunks | |
456 add changeset ef1ea85a6374 | |
457 changesets: 2 chunks | |
458 add changeset f9cafe1212c8 | |
459 changesets: 3 chunks | |
460 add changeset 911600dab2ae | |
461 adding manifests | |
462 manifests: 1/3 chunks (33.33%) | |
463 manifests: 2/3 chunks (66.67%) | |
464 manifests: 3/3 chunks (100.00%) | |
465 adding file changes | |
466 adding foo/Bar/file.txt revisions | |
467 files: 1/3 chunks (33.33%) | |
468 adding foo/file.txt revisions | |
469 files: 2/3 chunks (66.67%) | |
470 adding quux/file.py revisions | |
471 files: 3/3 chunks (100.00%) | |
472 added 3 changesets with 3 changes to 3 files | |
473 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
474 acl: acl.allow.branches not enabled | |
475 acl: acl.deny.branches not enabled | |
476 acl: acl.allow enabled, 1 entries for user fred | |
477 acl: acl.deny not enabled | |
478 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
479 acl: allowing changeset ef1ea85a6374 | |
480 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
481 acl: allowing changeset f9cafe1212c8 | |
482 acl: branch access granted: "911600dab2ae" on branch "default" | |
483 acl: user fred not allowed on quux/file.py | |
484 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae | |
485 transaction abort! | |
486 rollback completed | |
487 abort: acl: access denied for changeset 911600dab2ae | |
488 no rollback information available | |
489 0:6675d58eff77 | |
490 | |
491 | |
492 Empty [acl.deny] | |
493 | |
494 $ echo '[acl.deny]' >> $config | |
495 $ do_push barney | |
496 Pushing as user barney | |
497 hgrc = """ | |
498 [hooks] | |
499 pretxnchangegroup.acl = python:hgext.acl.hook | |
500 [acl] | |
501 sources = push | |
502 [acl.allow] | |
503 foo/** = fred | |
504 [acl.deny] | |
505 """ | |
506 pushing to ../b | |
507 searching for changes | |
508 common changesets up to 6675d58eff77 | |
509 3 changesets found | |
510 list of changesets: | |
511 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
512 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
513 911600dab2ae7a9baff75958b84fe606851ce955 | |
514 adding changesets | |
515 bundling changes: 0 chunks | |
516 bundling changes: 1 chunks | |
517 bundling changes: 2 chunks | |
518 bundling changes: 3 chunks | |
519 bundling changes: 4 chunks | |
520 bundling changes: 5 chunks | |
521 bundling changes: 6 chunks | |
522 bundling changes: 7 chunks | |
523 bundling changes: 8 chunks | |
524 bundling changes: 9 chunks | |
525 bundling manifests: 0 chunks | |
526 bundling manifests: 1 chunks | |
527 bundling manifests: 2 chunks | |
528 bundling manifests: 3 chunks | |
529 bundling manifests: 4 chunks | |
530 bundling manifests: 5 chunks | |
531 bundling manifests: 6 chunks | |
532 bundling manifests: 7 chunks | |
533 bundling manifests: 8 chunks | |
534 bundling manifests: 9 chunks | |
535 bundling files: foo/Bar/file.txt 0 chunks | |
536 bundling files: foo/Bar/file.txt 1 chunks | |
537 bundling files: foo/Bar/file.txt 2 chunks | |
538 bundling files: foo/Bar/file.txt 3 chunks | |
539 bundling files: foo/file.txt 4 chunks | |
540 bundling files: foo/file.txt 5 chunks | |
541 bundling files: foo/file.txt 6 chunks | |
542 bundling files: foo/file.txt 7 chunks | |
543 bundling files: quux/file.py 8 chunks | |
544 bundling files: quux/file.py 9 chunks | |
545 bundling files: quux/file.py 10 chunks | |
546 bundling files: quux/file.py 11 chunks | |
547 changesets: 1 chunks | |
548 add changeset ef1ea85a6374 | |
549 changesets: 2 chunks | |
550 add changeset f9cafe1212c8 | |
551 changesets: 3 chunks | |
552 add changeset 911600dab2ae | |
553 adding manifests | |
554 manifests: 1/3 chunks (33.33%) | |
555 manifests: 2/3 chunks (66.67%) | |
556 manifests: 3/3 chunks (100.00%) | |
557 adding file changes | |
558 adding foo/Bar/file.txt revisions | |
559 files: 1/3 chunks (33.33%) | |
560 adding foo/file.txt revisions | |
561 files: 2/3 chunks (66.67%) | |
562 adding quux/file.py revisions | |
563 files: 3/3 chunks (100.00%) | |
564 added 3 changesets with 3 changes to 3 files | |
565 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
566 acl: acl.allow.branches not enabled | |
567 acl: acl.deny.branches not enabled | |
568 acl: acl.allow enabled, 0 entries for user barney | |
569 acl: acl.deny enabled, 0 entries for user barney | |
570 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
571 acl: user barney not allowed on foo/file.txt | |
572 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374 | |
573 transaction abort! | |
574 rollback completed | |
575 abort: acl: access denied for changeset ef1ea85a6374 | |
576 no rollback information available | |
577 0:6675d58eff77 | |
578 | |
579 | |
580 fred is allowed inside foo/, but not foo/bar/ (case matters) | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
581 |
11849 | 582 $ echo 'foo/bar/** = fred' >> $config |
583 $ do_push fred | |
584 Pushing as user fred | |
585 hgrc = """ | |
586 [hooks] | |
587 pretxnchangegroup.acl = python:hgext.acl.hook | |
588 [acl] | |
589 sources = push | |
590 [acl.allow] | |
591 foo/** = fred | |
592 [acl.deny] | |
593 foo/bar/** = fred | |
594 """ | |
595 pushing to ../b | |
596 searching for changes | |
597 common changesets up to 6675d58eff77 | |
598 3 changesets found | |
599 list of changesets: | |
600 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
601 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
602 911600dab2ae7a9baff75958b84fe606851ce955 | |
603 adding changesets | |
604 bundling changes: 0 chunks | |
605 bundling changes: 1 chunks | |
606 bundling changes: 2 chunks | |
607 bundling changes: 3 chunks | |
608 bundling changes: 4 chunks | |
609 bundling changes: 5 chunks | |
610 bundling changes: 6 chunks | |
611 bundling changes: 7 chunks | |
612 bundling changes: 8 chunks | |
613 bundling changes: 9 chunks | |
614 bundling manifests: 0 chunks | |
615 bundling manifests: 1 chunks | |
616 bundling manifests: 2 chunks | |
617 bundling manifests: 3 chunks | |
618 bundling manifests: 4 chunks | |
619 bundling manifests: 5 chunks | |
620 bundling manifests: 6 chunks | |
621 bundling manifests: 7 chunks | |
622 bundling manifests: 8 chunks | |
623 bundling manifests: 9 chunks | |
624 bundling files: foo/Bar/file.txt 0 chunks | |
625 bundling files: foo/Bar/file.txt 1 chunks | |
626 bundling files: foo/Bar/file.txt 2 chunks | |
627 bundling files: foo/Bar/file.txt 3 chunks | |
628 bundling files: foo/file.txt 4 chunks | |
629 bundling files: foo/file.txt 5 chunks | |
630 bundling files: foo/file.txt 6 chunks | |
631 bundling files: foo/file.txt 7 chunks | |
632 bundling files: quux/file.py 8 chunks | |
633 bundling files: quux/file.py 9 chunks | |
634 bundling files: quux/file.py 10 chunks | |
635 bundling files: quux/file.py 11 chunks | |
636 changesets: 1 chunks | |
637 add changeset ef1ea85a6374 | |
638 changesets: 2 chunks | |
639 add changeset f9cafe1212c8 | |
640 changesets: 3 chunks | |
641 add changeset 911600dab2ae | |
642 adding manifests | |
643 manifests: 1/3 chunks (33.33%) | |
644 manifests: 2/3 chunks (66.67%) | |
645 manifests: 3/3 chunks (100.00%) | |
646 adding file changes | |
647 adding foo/Bar/file.txt revisions | |
648 files: 1/3 chunks (33.33%) | |
649 adding foo/file.txt revisions | |
650 files: 2/3 chunks (66.67%) | |
651 adding quux/file.py revisions | |
652 files: 3/3 chunks (100.00%) | |
653 added 3 changesets with 3 changes to 3 files | |
654 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
655 acl: acl.allow.branches not enabled | |
656 acl: acl.deny.branches not enabled | |
657 acl: acl.allow enabled, 1 entries for user fred | |
658 acl: acl.deny enabled, 1 entries for user fred | |
659 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
660 acl: allowing changeset ef1ea85a6374 | |
661 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
662 acl: allowing changeset f9cafe1212c8 | |
663 acl: branch access granted: "911600dab2ae" on branch "default" | |
664 acl: user fred not allowed on quux/file.py | |
665 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae | |
666 transaction abort! | |
667 rollback completed | |
668 abort: acl: access denied for changeset 911600dab2ae | |
669 no rollback information available | |
670 0:6675d58eff77 | |
671 | |
672 | |
673 fred is allowed inside foo/, but not foo/Bar/ | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
674 |
11849 | 675 $ echo 'foo/Bar/** = fred' >> $config |
676 $ do_push fred | |
677 Pushing as user fred | |
678 hgrc = """ | |
679 [hooks] | |
680 pretxnchangegroup.acl = python:hgext.acl.hook | |
681 [acl] | |
682 sources = push | |
683 [acl.allow] | |
684 foo/** = fred | |
685 [acl.deny] | |
686 foo/bar/** = fred | |
687 foo/Bar/** = fred | |
688 """ | |
689 pushing to ../b | |
690 searching for changes | |
691 common changesets up to 6675d58eff77 | |
692 3 changesets found | |
693 list of changesets: | |
694 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
695 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
696 911600dab2ae7a9baff75958b84fe606851ce955 | |
697 adding changesets | |
698 bundling changes: 0 chunks | |
699 bundling changes: 1 chunks | |
700 bundling changes: 2 chunks | |
701 bundling changes: 3 chunks | |
702 bundling changes: 4 chunks | |
703 bundling changes: 5 chunks | |
704 bundling changes: 6 chunks | |
705 bundling changes: 7 chunks | |
706 bundling changes: 8 chunks | |
707 bundling changes: 9 chunks | |
708 bundling manifests: 0 chunks | |
709 bundling manifests: 1 chunks | |
710 bundling manifests: 2 chunks | |
711 bundling manifests: 3 chunks | |
712 bundling manifests: 4 chunks | |
713 bundling manifests: 5 chunks | |
714 bundling manifests: 6 chunks | |
715 bundling manifests: 7 chunks | |
716 bundling manifests: 8 chunks | |
717 bundling manifests: 9 chunks | |
718 bundling files: foo/Bar/file.txt 0 chunks | |
719 bundling files: foo/Bar/file.txt 1 chunks | |
720 bundling files: foo/Bar/file.txt 2 chunks | |
721 bundling files: foo/Bar/file.txt 3 chunks | |
722 bundling files: foo/file.txt 4 chunks | |
723 bundling files: foo/file.txt 5 chunks | |
724 bundling files: foo/file.txt 6 chunks | |
725 bundling files: foo/file.txt 7 chunks | |
726 bundling files: quux/file.py 8 chunks | |
727 bundling files: quux/file.py 9 chunks | |
728 bundling files: quux/file.py 10 chunks | |
729 bundling files: quux/file.py 11 chunks | |
730 changesets: 1 chunks | |
731 add changeset ef1ea85a6374 | |
732 changesets: 2 chunks | |
733 add changeset f9cafe1212c8 | |
734 changesets: 3 chunks | |
735 add changeset 911600dab2ae | |
736 adding manifests | |
737 manifests: 1/3 chunks (33.33%) | |
738 manifests: 2/3 chunks (66.67%) | |
739 manifests: 3/3 chunks (100.00%) | |
740 adding file changes | |
741 adding foo/Bar/file.txt revisions | |
742 files: 1/3 chunks (33.33%) | |
743 adding foo/file.txt revisions | |
744 files: 2/3 chunks (66.67%) | |
745 adding quux/file.py revisions | |
746 files: 3/3 chunks (100.00%) | |
747 added 3 changesets with 3 changes to 3 files | |
748 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
749 acl: acl.allow.branches not enabled | |
750 acl: acl.deny.branches not enabled | |
751 acl: acl.allow enabled, 1 entries for user fred | |
752 acl: acl.deny enabled, 2 entries for user fred | |
753 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
754 acl: allowing changeset ef1ea85a6374 | |
755 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
756 acl: user fred denied on foo/Bar/file.txt | |
757 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8 | |
758 transaction abort! | |
759 rollback completed | |
760 abort: acl: access denied for changeset f9cafe1212c8 | |
761 no rollback information available | |
762 0:6675d58eff77 | |
763 | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
764 |
11849 | 765 $ echo 'barney is not mentioned => not allowed anywhere' |
766 barney is not mentioned => not allowed anywhere | |
767 $ do_push barney | |
768 Pushing as user barney | |
769 hgrc = """ | |
770 [hooks] | |
771 pretxnchangegroup.acl = python:hgext.acl.hook | |
772 [acl] | |
773 sources = push | |
774 [acl.allow] | |
775 foo/** = fred | |
776 [acl.deny] | |
777 foo/bar/** = fred | |
778 foo/Bar/** = fred | |
779 """ | |
780 pushing to ../b | |
781 searching for changes | |
782 common changesets up to 6675d58eff77 | |
783 3 changesets found | |
784 list of changesets: | |
785 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
786 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
787 911600dab2ae7a9baff75958b84fe606851ce955 | |
788 adding changesets | |
789 bundling changes: 0 chunks | |
790 bundling changes: 1 chunks | |
791 bundling changes: 2 chunks | |
792 bundling changes: 3 chunks | |
793 bundling changes: 4 chunks | |
794 bundling changes: 5 chunks | |
795 bundling changes: 6 chunks | |
796 bundling changes: 7 chunks | |
797 bundling changes: 8 chunks | |
798 bundling changes: 9 chunks | |
799 bundling manifests: 0 chunks | |
800 bundling manifests: 1 chunks | |
801 bundling manifests: 2 chunks | |
802 bundling manifests: 3 chunks | |
803 bundling manifests: 4 chunks | |
804 bundling manifests: 5 chunks | |
805 bundling manifests: 6 chunks | |
806 bundling manifests: 7 chunks | |
807 bundling manifests: 8 chunks | |
808 bundling manifests: 9 chunks | |
809 bundling files: foo/Bar/file.txt 0 chunks | |
810 bundling files: foo/Bar/file.txt 1 chunks | |
811 bundling files: foo/Bar/file.txt 2 chunks | |
812 bundling files: foo/Bar/file.txt 3 chunks | |
813 bundling files: foo/file.txt 4 chunks | |
814 bundling files: foo/file.txt 5 chunks | |
815 bundling files: foo/file.txt 6 chunks | |
816 bundling files: foo/file.txt 7 chunks | |
817 bundling files: quux/file.py 8 chunks | |
818 bundling files: quux/file.py 9 chunks | |
819 bundling files: quux/file.py 10 chunks | |
820 bundling files: quux/file.py 11 chunks | |
821 changesets: 1 chunks | |
822 add changeset ef1ea85a6374 | |
823 changesets: 2 chunks | |
824 add changeset f9cafe1212c8 | |
825 changesets: 3 chunks | |
826 add changeset 911600dab2ae | |
827 adding manifests | |
828 manifests: 1/3 chunks (33.33%) | |
829 manifests: 2/3 chunks (66.67%) | |
830 manifests: 3/3 chunks (100.00%) | |
831 adding file changes | |
832 adding foo/Bar/file.txt revisions | |
833 files: 1/3 chunks (33.33%) | |
834 adding foo/file.txt revisions | |
835 files: 2/3 chunks (66.67%) | |
836 adding quux/file.py revisions | |
837 files: 3/3 chunks (100.00%) | |
838 added 3 changesets with 3 changes to 3 files | |
839 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
840 acl: acl.allow.branches not enabled | |
841 acl: acl.deny.branches not enabled | |
842 acl: acl.allow enabled, 0 entries for user barney | |
843 acl: acl.deny enabled, 0 entries for user barney | |
844 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
845 acl: user barney not allowed on foo/file.txt | |
846 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374 | |
847 transaction abort! | |
848 rollback completed | |
849 abort: acl: access denied for changeset ef1ea85a6374 | |
850 no rollback information available | |
851 0:6675d58eff77 | |
852 | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
853 |
11849 | 854 barney is allowed everywhere |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
855 |
11849 | 856 $ echo '[acl.allow]' >> $config |
857 $ echo '** = barney' >> $config | |
858 $ do_push barney | |
859 Pushing as user barney | |
860 hgrc = """ | |
861 [hooks] | |
862 pretxnchangegroup.acl = python:hgext.acl.hook | |
863 [acl] | |
864 sources = push | |
865 [acl.allow] | |
866 foo/** = fred | |
867 [acl.deny] | |
868 foo/bar/** = fred | |
869 foo/Bar/** = fred | |
870 [acl.allow] | |
871 ** = barney | |
872 """ | |
873 pushing to ../b | |
874 searching for changes | |
875 common changesets up to 6675d58eff77 | |
876 3 changesets found | |
877 list of changesets: | |
878 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
879 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
880 911600dab2ae7a9baff75958b84fe606851ce955 | |
881 adding changesets | |
882 bundling changes: 0 chunks | |
883 bundling changes: 1 chunks | |
884 bundling changes: 2 chunks | |
885 bundling changes: 3 chunks | |
886 bundling changes: 4 chunks | |
887 bundling changes: 5 chunks | |
888 bundling changes: 6 chunks | |
889 bundling changes: 7 chunks | |
890 bundling changes: 8 chunks | |
891 bundling changes: 9 chunks | |
892 bundling manifests: 0 chunks | |
893 bundling manifests: 1 chunks | |
894 bundling manifests: 2 chunks | |
895 bundling manifests: 3 chunks | |
896 bundling manifests: 4 chunks | |
897 bundling manifests: 5 chunks | |
898 bundling manifests: 6 chunks | |
899 bundling manifests: 7 chunks | |
900 bundling manifests: 8 chunks | |
901 bundling manifests: 9 chunks | |
902 bundling files: foo/Bar/file.txt 0 chunks | |
903 bundling files: foo/Bar/file.txt 1 chunks | |
904 bundling files: foo/Bar/file.txt 2 chunks | |
905 bundling files: foo/Bar/file.txt 3 chunks | |
906 bundling files: foo/file.txt 4 chunks | |
907 bundling files: foo/file.txt 5 chunks | |
908 bundling files: foo/file.txt 6 chunks | |
909 bundling files: foo/file.txt 7 chunks | |
910 bundling files: quux/file.py 8 chunks | |
911 bundling files: quux/file.py 9 chunks | |
912 bundling files: quux/file.py 10 chunks | |
913 bundling files: quux/file.py 11 chunks | |
914 changesets: 1 chunks | |
915 add changeset ef1ea85a6374 | |
916 changesets: 2 chunks | |
917 add changeset f9cafe1212c8 | |
918 changesets: 3 chunks | |
919 add changeset 911600dab2ae | |
920 adding manifests | |
921 manifests: 1/3 chunks (33.33%) | |
922 manifests: 2/3 chunks (66.67%) | |
923 manifests: 3/3 chunks (100.00%) | |
924 adding file changes | |
925 adding foo/Bar/file.txt revisions | |
926 files: 1/3 chunks (33.33%) | |
927 adding foo/file.txt revisions | |
928 files: 2/3 chunks (66.67%) | |
929 adding quux/file.py revisions | |
930 files: 3/3 chunks (100.00%) | |
931 added 3 changesets with 3 changes to 3 files | |
932 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
933 acl: acl.allow.branches not enabled | |
934 acl: acl.deny.branches not enabled | |
935 acl: acl.allow enabled, 1 entries for user barney | |
936 acl: acl.deny enabled, 0 entries for user barney | |
937 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
938 acl: allowing changeset ef1ea85a6374 | |
939 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
940 acl: allowing changeset f9cafe1212c8 | |
941 acl: branch access granted: "911600dab2ae" on branch "default" | |
942 acl: allowing changeset 911600dab2ae | |
943 updating the branch cache | |
944 rolling back to revision 0 (undo push) | |
945 0:6675d58eff77 | |
946 | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
947 |
11849 | 948 wilma can change files with a .txt extension |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
949 |
11849 | 950 $ echo '**/*.txt = wilma' >> $config |
951 $ do_push wilma | |
952 Pushing as user wilma | |
953 hgrc = """ | |
954 [hooks] | |
955 pretxnchangegroup.acl = python:hgext.acl.hook | |
956 [acl] | |
957 sources = push | |
958 [acl.allow] | |
959 foo/** = fred | |
960 [acl.deny] | |
961 foo/bar/** = fred | |
962 foo/Bar/** = fred | |
963 [acl.allow] | |
964 ** = barney | |
965 **/*.txt = wilma | |
966 """ | |
967 pushing to ../b | |
968 searching for changes | |
969 common changesets up to 6675d58eff77 | |
970 invalidating branch cache (tip differs) | |
971 3 changesets found | |
972 list of changesets: | |
973 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
974 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
975 911600dab2ae7a9baff75958b84fe606851ce955 | |
976 adding changesets | |
977 bundling changes: 0 chunks | |
978 bundling changes: 1 chunks | |
979 bundling changes: 2 chunks | |
980 bundling changes: 3 chunks | |
981 bundling changes: 4 chunks | |
982 bundling changes: 5 chunks | |
983 bundling changes: 6 chunks | |
984 bundling changes: 7 chunks | |
985 bundling changes: 8 chunks | |
986 bundling changes: 9 chunks | |
987 bundling manifests: 0 chunks | |
988 bundling manifests: 1 chunks | |
989 bundling manifests: 2 chunks | |
990 bundling manifests: 3 chunks | |
991 bundling manifests: 4 chunks | |
992 bundling manifests: 5 chunks | |
993 bundling manifests: 6 chunks | |
994 bundling manifests: 7 chunks | |
995 bundling manifests: 8 chunks | |
996 bundling manifests: 9 chunks | |
997 bundling files: foo/Bar/file.txt 0 chunks | |
998 bundling files: foo/Bar/file.txt 1 chunks | |
999 bundling files: foo/Bar/file.txt 2 chunks | |
1000 bundling files: foo/Bar/file.txt 3 chunks | |
1001 bundling files: foo/file.txt 4 chunks | |
1002 bundling files: foo/file.txt 5 chunks | |
1003 bundling files: foo/file.txt 6 chunks | |
1004 bundling files: foo/file.txt 7 chunks | |
1005 bundling files: quux/file.py 8 chunks | |
1006 bundling files: quux/file.py 9 chunks | |
1007 bundling files: quux/file.py 10 chunks | |
1008 bundling files: quux/file.py 11 chunks | |
1009 changesets: 1 chunks | |
1010 add changeset ef1ea85a6374 | |
1011 changesets: 2 chunks | |
1012 add changeset f9cafe1212c8 | |
1013 changesets: 3 chunks | |
1014 add changeset 911600dab2ae | |
1015 adding manifests | |
1016 manifests: 1/3 chunks (33.33%) | |
1017 manifests: 2/3 chunks (66.67%) | |
1018 manifests: 3/3 chunks (100.00%) | |
1019 adding file changes | |
1020 adding foo/Bar/file.txt revisions | |
1021 files: 1/3 chunks (33.33%) | |
1022 adding foo/file.txt revisions | |
1023 files: 2/3 chunks (66.67%) | |
1024 adding quux/file.py revisions | |
1025 files: 3/3 chunks (100.00%) | |
1026 added 3 changesets with 3 changes to 3 files | |
1027 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1028 acl: acl.allow.branches not enabled | |
1029 acl: acl.deny.branches not enabled | |
1030 acl: acl.allow enabled, 1 entries for user wilma | |
1031 acl: acl.deny enabled, 0 entries for user wilma | |
1032 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1033 acl: allowing changeset ef1ea85a6374 | |
1034 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1035 acl: allowing changeset f9cafe1212c8 | |
1036 acl: branch access granted: "911600dab2ae" on branch "default" | |
1037 acl: user wilma not allowed on quux/file.py | |
1038 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae | |
1039 transaction abort! | |
1040 rollback completed | |
1041 abort: acl: access denied for changeset 911600dab2ae | |
1042 no rollback information available | |
1043 0:6675d58eff77 | |
1044 | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1045 |
11849 | 1046 file specified by acl.config does not exist |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1047 |
11849 | 1048 $ echo '[acl]' >> $config |
1049 $ echo 'config = ../acl.config' >> $config | |
1050 $ do_push barney | |
1051 Pushing as user barney | |
1052 hgrc = """ | |
1053 [hooks] | |
1054 pretxnchangegroup.acl = python:hgext.acl.hook | |
1055 [acl] | |
1056 sources = push | |
1057 [acl.allow] | |
1058 foo/** = fred | |
1059 [acl.deny] | |
1060 foo/bar/** = fred | |
1061 foo/Bar/** = fred | |
1062 [acl.allow] | |
1063 ** = barney | |
1064 **/*.txt = wilma | |
1065 [acl] | |
1066 config = ../acl.config | |
1067 """ | |
1068 pushing to ../b | |
1069 searching for changes | |
1070 common changesets up to 6675d58eff77 | |
1071 3 changesets found | |
1072 list of changesets: | |
1073 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1074 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1075 911600dab2ae7a9baff75958b84fe606851ce955 | |
1076 adding changesets | |
1077 bundling changes: 0 chunks | |
1078 bundling changes: 1 chunks | |
1079 bundling changes: 2 chunks | |
1080 bundling changes: 3 chunks | |
1081 bundling changes: 4 chunks | |
1082 bundling changes: 5 chunks | |
1083 bundling changes: 6 chunks | |
1084 bundling changes: 7 chunks | |
1085 bundling changes: 8 chunks | |
1086 bundling changes: 9 chunks | |
1087 bundling manifests: 0 chunks | |
1088 bundling manifests: 1 chunks | |
1089 bundling manifests: 2 chunks | |
1090 bundling manifests: 3 chunks | |
1091 bundling manifests: 4 chunks | |
1092 bundling manifests: 5 chunks | |
1093 bundling manifests: 6 chunks | |
1094 bundling manifests: 7 chunks | |
1095 bundling manifests: 8 chunks | |
1096 bundling manifests: 9 chunks | |
1097 bundling files: foo/Bar/file.txt 0 chunks | |
1098 bundling files: foo/Bar/file.txt 1 chunks | |
1099 bundling files: foo/Bar/file.txt 2 chunks | |
1100 bundling files: foo/Bar/file.txt 3 chunks | |
1101 bundling files: foo/file.txt 4 chunks | |
1102 bundling files: foo/file.txt 5 chunks | |
1103 bundling files: foo/file.txt 6 chunks | |
1104 bundling files: foo/file.txt 7 chunks | |
1105 bundling files: quux/file.py 8 chunks | |
1106 bundling files: quux/file.py 9 chunks | |
1107 bundling files: quux/file.py 10 chunks | |
1108 bundling files: quux/file.py 11 chunks | |
1109 changesets: 1 chunks | |
1110 add changeset ef1ea85a6374 | |
1111 changesets: 2 chunks | |
1112 add changeset f9cafe1212c8 | |
1113 changesets: 3 chunks | |
1114 add changeset 911600dab2ae | |
1115 adding manifests | |
1116 manifests: 1/3 chunks (33.33%) | |
1117 manifests: 2/3 chunks (66.67%) | |
1118 manifests: 3/3 chunks (100.00%) | |
1119 adding file changes | |
1120 adding foo/Bar/file.txt revisions | |
1121 files: 1/3 chunks (33.33%) | |
1122 adding foo/file.txt revisions | |
1123 files: 2/3 chunks (66.67%) | |
1124 adding quux/file.py revisions | |
1125 files: 3/3 chunks (100.00%) | |
1126 added 3 changesets with 3 changes to 3 files | |
1127 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1128 error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config' | |
1129 transaction abort! | |
1130 rollback completed | |
1131 abort: No such file or directory: ../acl.config | |
1132 no rollback information available | |
1133 0:6675d58eff77 | |
1134 | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1135 |
11849 | 1136 betty is allowed inside foo/ by a acl.config file |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1137 |
11849 | 1138 $ echo '[acl.allow]' >> acl.config |
1139 $ echo 'foo/** = betty' >> acl.config | |
1140 $ do_push betty | |
1141 Pushing as user betty | |
1142 hgrc = """ | |
1143 [hooks] | |
1144 pretxnchangegroup.acl = python:hgext.acl.hook | |
1145 [acl] | |
1146 sources = push | |
1147 [acl.allow] | |
1148 foo/** = fred | |
1149 [acl.deny] | |
1150 foo/bar/** = fred | |
1151 foo/Bar/** = fred | |
1152 [acl.allow] | |
1153 ** = barney | |
1154 **/*.txt = wilma | |
1155 [acl] | |
1156 config = ../acl.config | |
1157 """ | |
1158 acl.config = """ | |
1159 [acl.allow] | |
1160 foo/** = betty | |
1161 """ | |
1162 pushing to ../b | |
1163 searching for changes | |
1164 common changesets up to 6675d58eff77 | |
1165 3 changesets found | |
1166 list of changesets: | |
1167 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1168 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1169 911600dab2ae7a9baff75958b84fe606851ce955 | |
1170 adding changesets | |
1171 bundling changes: 0 chunks | |
1172 bundling changes: 1 chunks | |
1173 bundling changes: 2 chunks | |
1174 bundling changes: 3 chunks | |
1175 bundling changes: 4 chunks | |
1176 bundling changes: 5 chunks | |
1177 bundling changes: 6 chunks | |
1178 bundling changes: 7 chunks | |
1179 bundling changes: 8 chunks | |
1180 bundling changes: 9 chunks | |
1181 bundling manifests: 0 chunks | |
1182 bundling manifests: 1 chunks | |
1183 bundling manifests: 2 chunks | |
1184 bundling manifests: 3 chunks | |
1185 bundling manifests: 4 chunks | |
1186 bundling manifests: 5 chunks | |
1187 bundling manifests: 6 chunks | |
1188 bundling manifests: 7 chunks | |
1189 bundling manifests: 8 chunks | |
1190 bundling manifests: 9 chunks | |
1191 bundling files: foo/Bar/file.txt 0 chunks | |
1192 bundling files: foo/Bar/file.txt 1 chunks | |
1193 bundling files: foo/Bar/file.txt 2 chunks | |
1194 bundling files: foo/Bar/file.txt 3 chunks | |
1195 bundling files: foo/file.txt 4 chunks | |
1196 bundling files: foo/file.txt 5 chunks | |
1197 bundling files: foo/file.txt 6 chunks | |
1198 bundling files: foo/file.txt 7 chunks | |
1199 bundling files: quux/file.py 8 chunks | |
1200 bundling files: quux/file.py 9 chunks | |
1201 bundling files: quux/file.py 10 chunks | |
1202 bundling files: quux/file.py 11 chunks | |
1203 changesets: 1 chunks | |
1204 add changeset ef1ea85a6374 | |
1205 changesets: 2 chunks | |
1206 add changeset f9cafe1212c8 | |
1207 changesets: 3 chunks | |
1208 add changeset 911600dab2ae | |
1209 adding manifests | |
1210 manifests: 1/3 chunks (33.33%) | |
1211 manifests: 2/3 chunks (66.67%) | |
1212 manifests: 3/3 chunks (100.00%) | |
1213 adding file changes | |
1214 adding foo/Bar/file.txt revisions | |
1215 files: 1/3 chunks (33.33%) | |
1216 adding foo/file.txt revisions | |
1217 files: 2/3 chunks (66.67%) | |
1218 adding quux/file.py revisions | |
1219 files: 3/3 chunks (100.00%) | |
1220 added 3 changesets with 3 changes to 3 files | |
1221 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1222 acl: acl.allow.branches not enabled | |
1223 acl: acl.deny.branches not enabled | |
1224 acl: acl.allow enabled, 1 entries for user betty | |
1225 acl: acl.deny enabled, 0 entries for user betty | |
1226 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1227 acl: allowing changeset ef1ea85a6374 | |
1228 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1229 acl: allowing changeset f9cafe1212c8 | |
1230 acl: branch access granted: "911600dab2ae" on branch "default" | |
1231 acl: user betty not allowed on quux/file.py | |
1232 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae | |
1233 transaction abort! | |
1234 rollback completed | |
1235 abort: acl: access denied for changeset 911600dab2ae | |
1236 no rollback information available | |
1237 0:6675d58eff77 | |
1238 | |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1239 |
11849 | 1240 acl.config can set only [acl.allow]/[acl.deny] |
3426
bb00a5a92c30
Add a test for the acl extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1241 |
11849 | 1242 $ echo '[hooks]' >> acl.config |
1243 $ echo 'changegroup.acl = false' >> acl.config | |
1244 $ do_push barney | |
1245 Pushing as user barney | |
1246 hgrc = """ | |
1247 [hooks] | |
1248 pretxnchangegroup.acl = python:hgext.acl.hook | |
1249 [acl] | |
1250 sources = push | |
1251 [acl.allow] | |
1252 foo/** = fred | |
1253 [acl.deny] | |
1254 foo/bar/** = fred | |
1255 foo/Bar/** = fred | |
1256 [acl.allow] | |
1257 ** = barney | |
1258 **/*.txt = wilma | |
1259 [acl] | |
1260 config = ../acl.config | |
1261 """ | |
1262 acl.config = """ | |
1263 [acl.allow] | |
1264 foo/** = betty | |
1265 [hooks] | |
1266 changegroup.acl = false | |
1267 """ | |
1268 pushing to ../b | |
1269 searching for changes | |
1270 common changesets up to 6675d58eff77 | |
1271 3 changesets found | |
1272 list of changesets: | |
1273 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1274 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1275 911600dab2ae7a9baff75958b84fe606851ce955 | |
1276 adding changesets | |
1277 bundling changes: 0 chunks | |
1278 bundling changes: 1 chunks | |
1279 bundling changes: 2 chunks | |
1280 bundling changes: 3 chunks | |
1281 bundling changes: 4 chunks | |
1282 bundling changes: 5 chunks | |
1283 bundling changes: 6 chunks | |
1284 bundling changes: 7 chunks | |
1285 bundling changes: 8 chunks | |
1286 bundling changes: 9 chunks | |
1287 bundling manifests: 0 chunks | |
1288 bundling manifests: 1 chunks | |
1289 bundling manifests: 2 chunks | |
1290 bundling manifests: 3 chunks | |
1291 bundling manifests: 4 chunks | |
1292 bundling manifests: 5 chunks | |
1293 bundling manifests: 6 chunks | |
1294 bundling manifests: 7 chunks | |
1295 bundling manifests: 8 chunks | |
1296 bundling manifests: 9 chunks | |
1297 bundling files: foo/Bar/file.txt 0 chunks | |
1298 bundling files: foo/Bar/file.txt 1 chunks | |
1299 bundling files: foo/Bar/file.txt 2 chunks | |
1300 bundling files: foo/Bar/file.txt 3 chunks | |
1301 bundling files: foo/file.txt 4 chunks | |
1302 bundling files: foo/file.txt 5 chunks | |
1303 bundling files: foo/file.txt 6 chunks | |
1304 bundling files: foo/file.txt 7 chunks | |
1305 bundling files: quux/file.py 8 chunks | |
1306 bundling files: quux/file.py 9 chunks | |
1307 bundling files: quux/file.py 10 chunks | |
1308 bundling files: quux/file.py 11 chunks | |
1309 changesets: 1 chunks | |
1310 add changeset ef1ea85a6374 | |
1311 changesets: 2 chunks | |
1312 add changeset f9cafe1212c8 | |
1313 changesets: 3 chunks | |
1314 add changeset 911600dab2ae | |
1315 adding manifests | |
1316 manifests: 1/3 chunks (33.33%) | |
1317 manifests: 2/3 chunks (66.67%) | |
1318 manifests: 3/3 chunks (100.00%) | |
1319 adding file changes | |
1320 adding foo/Bar/file.txt revisions | |
1321 files: 1/3 chunks (33.33%) | |
1322 adding foo/file.txt revisions | |
1323 files: 2/3 chunks (66.67%) | |
1324 adding quux/file.py revisions | |
1325 files: 3/3 chunks (100.00%) | |
1326 added 3 changesets with 3 changes to 3 files | |
1327 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1328 acl: acl.allow.branches not enabled | |
1329 acl: acl.deny.branches not enabled | |
1330 acl: acl.allow enabled, 1 entries for user barney | |
1331 acl: acl.deny enabled, 0 entries for user barney | |
1332 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1333 acl: allowing changeset ef1ea85a6374 | |
1334 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1335 acl: allowing changeset f9cafe1212c8 | |
1336 acl: branch access granted: "911600dab2ae" on branch "default" | |
1337 acl: allowing changeset 911600dab2ae | |
1338 updating the branch cache | |
1339 rolling back to revision 0 (undo push) | |
1340 0:6675d58eff77 | |
1341 | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1342 |
11849 | 1343 asterisk |
1344 | |
1345 $ init_config | |
1346 | |
1347 asterisk test | |
1348 | |
1349 $ echo '[acl.allow]' >> $config | |
1350 $ echo "** = fred" >> $config | |
1351 | |
1352 fred is always allowed | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1353 |
11849 | 1354 $ do_push fred |
1355 Pushing as user fred | |
1356 hgrc = """ | |
1357 [acl] | |
1358 sources = push | |
1359 [extensions] | |
1360 [acl.allow] | |
1361 ** = fred | |
1362 """ | |
1363 pushing to ../b | |
1364 searching for changes | |
1365 common changesets up to 6675d58eff77 | |
1366 invalidating branch cache (tip differs) | |
1367 3 changesets found | |
1368 list of changesets: | |
1369 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1370 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1371 911600dab2ae7a9baff75958b84fe606851ce955 | |
1372 adding changesets | |
1373 bundling changes: 0 chunks | |
1374 bundling changes: 1 chunks | |
1375 bundling changes: 2 chunks | |
1376 bundling changes: 3 chunks | |
1377 bundling changes: 4 chunks | |
1378 bundling changes: 5 chunks | |
1379 bundling changes: 6 chunks | |
1380 bundling changes: 7 chunks | |
1381 bundling changes: 8 chunks | |
1382 bundling changes: 9 chunks | |
1383 bundling manifests: 0 chunks | |
1384 bundling manifests: 1 chunks | |
1385 bundling manifests: 2 chunks | |
1386 bundling manifests: 3 chunks | |
1387 bundling manifests: 4 chunks | |
1388 bundling manifests: 5 chunks | |
1389 bundling manifests: 6 chunks | |
1390 bundling manifests: 7 chunks | |
1391 bundling manifests: 8 chunks | |
1392 bundling manifests: 9 chunks | |
1393 bundling files: foo/Bar/file.txt 0 chunks | |
1394 bundling files: foo/Bar/file.txt 1 chunks | |
1395 bundling files: foo/Bar/file.txt 2 chunks | |
1396 bundling files: foo/Bar/file.txt 3 chunks | |
1397 bundling files: foo/file.txt 4 chunks | |
1398 bundling files: foo/file.txt 5 chunks | |
1399 bundling files: foo/file.txt 6 chunks | |
1400 bundling files: foo/file.txt 7 chunks | |
1401 bundling files: quux/file.py 8 chunks | |
1402 bundling files: quux/file.py 9 chunks | |
1403 bundling files: quux/file.py 10 chunks | |
1404 bundling files: quux/file.py 11 chunks | |
1405 changesets: 1 chunks | |
1406 add changeset ef1ea85a6374 | |
1407 changesets: 2 chunks | |
1408 add changeset f9cafe1212c8 | |
1409 changesets: 3 chunks | |
1410 add changeset 911600dab2ae | |
1411 adding manifests | |
1412 manifests: 1/3 chunks (33.33%) | |
1413 manifests: 2/3 chunks (66.67%) | |
1414 manifests: 3/3 chunks (100.00%) | |
1415 adding file changes | |
1416 adding foo/Bar/file.txt revisions | |
1417 files: 1/3 chunks (33.33%) | |
1418 adding foo/file.txt revisions | |
1419 files: 2/3 chunks (66.67%) | |
1420 adding quux/file.py revisions | |
1421 files: 3/3 chunks (100.00%) | |
1422 added 3 changesets with 3 changes to 3 files | |
1423 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1424 acl: acl.allow.branches not enabled | |
1425 acl: acl.deny.branches not enabled | |
1426 acl: acl.allow enabled, 1 entries for user fred | |
1427 acl: acl.deny not enabled | |
1428 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1429 acl: allowing changeset ef1ea85a6374 | |
1430 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1431 acl: allowing changeset f9cafe1212c8 | |
1432 acl: branch access granted: "911600dab2ae" on branch "default" | |
1433 acl: allowing changeset 911600dab2ae | |
1434 updating the branch cache | |
1435 rolling back to revision 0 (undo push) | |
1436 0:6675d58eff77 | |
1437 | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1438 |
11849 | 1439 $ echo '[acl.deny]' >> $config |
1440 $ echo "foo/Bar/** = *" >> $config | |
1441 | |
1442 no one is allowed inside foo/Bar/ | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1443 |
11849 | 1444 $ do_push fred |
1445 Pushing as user fred | |
1446 hgrc = """ | |
1447 [acl] | |
1448 sources = push | |
1449 [extensions] | |
1450 [acl.allow] | |
1451 ** = fred | |
1452 [acl.deny] | |
1453 foo/Bar/** = * | |
1454 """ | |
1455 pushing to ../b | |
1456 searching for changes | |
1457 common changesets up to 6675d58eff77 | |
1458 invalidating branch cache (tip differs) | |
1459 3 changesets found | |
1460 list of changesets: | |
1461 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1462 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1463 911600dab2ae7a9baff75958b84fe606851ce955 | |
1464 adding changesets | |
1465 bundling changes: 0 chunks | |
1466 bundling changes: 1 chunks | |
1467 bundling changes: 2 chunks | |
1468 bundling changes: 3 chunks | |
1469 bundling changes: 4 chunks | |
1470 bundling changes: 5 chunks | |
1471 bundling changes: 6 chunks | |
1472 bundling changes: 7 chunks | |
1473 bundling changes: 8 chunks | |
1474 bundling changes: 9 chunks | |
1475 bundling manifests: 0 chunks | |
1476 bundling manifests: 1 chunks | |
1477 bundling manifests: 2 chunks | |
1478 bundling manifests: 3 chunks | |
1479 bundling manifests: 4 chunks | |
1480 bundling manifests: 5 chunks | |
1481 bundling manifests: 6 chunks | |
1482 bundling manifests: 7 chunks | |
1483 bundling manifests: 8 chunks | |
1484 bundling manifests: 9 chunks | |
1485 bundling files: foo/Bar/file.txt 0 chunks | |
1486 bundling files: foo/Bar/file.txt 1 chunks | |
1487 bundling files: foo/Bar/file.txt 2 chunks | |
1488 bundling files: foo/Bar/file.txt 3 chunks | |
1489 bundling files: foo/file.txt 4 chunks | |
1490 bundling files: foo/file.txt 5 chunks | |
1491 bundling files: foo/file.txt 6 chunks | |
1492 bundling files: foo/file.txt 7 chunks | |
1493 bundling files: quux/file.py 8 chunks | |
1494 bundling files: quux/file.py 9 chunks | |
1495 bundling files: quux/file.py 10 chunks | |
1496 bundling files: quux/file.py 11 chunks | |
1497 changesets: 1 chunks | |
1498 add changeset ef1ea85a6374 | |
1499 changesets: 2 chunks | |
1500 add changeset f9cafe1212c8 | |
1501 changesets: 3 chunks | |
1502 add changeset 911600dab2ae | |
1503 adding manifests | |
1504 manifests: 1/3 chunks (33.33%) | |
1505 manifests: 2/3 chunks (66.67%) | |
1506 manifests: 3/3 chunks (100.00%) | |
1507 adding file changes | |
1508 adding foo/Bar/file.txt revisions | |
1509 files: 1/3 chunks (33.33%) | |
1510 adding foo/file.txt revisions | |
1511 files: 2/3 chunks (66.67%) | |
1512 adding quux/file.py revisions | |
1513 files: 3/3 chunks (100.00%) | |
1514 added 3 changesets with 3 changes to 3 files | |
1515 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1516 acl: acl.allow.branches not enabled | |
1517 acl: acl.deny.branches not enabled | |
1518 acl: acl.allow enabled, 1 entries for user fred | |
1519 acl: acl.deny enabled, 1 entries for user fred | |
1520 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1521 acl: allowing changeset ef1ea85a6374 | |
1522 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1523 acl: user fred denied on foo/Bar/file.txt | |
1524 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8 | |
1525 transaction abort! | |
1526 rollback completed | |
1527 abort: acl: access denied for changeset f9cafe1212c8 | |
1528 no rollback information available | |
1529 0:6675d58eff77 | |
1530 | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1531 |
11849 | 1532 Groups |
1533 | |
1534 $ init_config | |
1535 | |
1536 OS-level groups | |
1537 | |
1538 $ echo '[acl.allow]' >> $config | |
1539 $ echo "** = @group1" >> $config | |
1540 | |
1541 @group1 is always allowed | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1542 |
11849 | 1543 $ do_push fred |
1544 Pushing as user fred | |
1545 hgrc = """ | |
1546 [acl] | |
1547 sources = push | |
1548 [extensions] | |
1549 [acl.allow] | |
1550 ** = @group1 | |
1551 """ | |
1552 pushing to ../b | |
1553 searching for changes | |
1554 common changesets up to 6675d58eff77 | |
1555 3 changesets found | |
1556 list of changesets: | |
1557 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1558 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1559 911600dab2ae7a9baff75958b84fe606851ce955 | |
1560 adding changesets | |
1561 bundling changes: 0 chunks | |
1562 bundling changes: 1 chunks | |
1563 bundling changes: 2 chunks | |
1564 bundling changes: 3 chunks | |
1565 bundling changes: 4 chunks | |
1566 bundling changes: 5 chunks | |
1567 bundling changes: 6 chunks | |
1568 bundling changes: 7 chunks | |
1569 bundling changes: 8 chunks | |
1570 bundling changes: 9 chunks | |
1571 bundling manifests: 0 chunks | |
1572 bundling manifests: 1 chunks | |
1573 bundling manifests: 2 chunks | |
1574 bundling manifests: 3 chunks | |
1575 bundling manifests: 4 chunks | |
1576 bundling manifests: 5 chunks | |
1577 bundling manifests: 6 chunks | |
1578 bundling manifests: 7 chunks | |
1579 bundling manifests: 8 chunks | |
1580 bundling manifests: 9 chunks | |
1581 bundling files: foo/Bar/file.txt 0 chunks | |
1582 bundling files: foo/Bar/file.txt 1 chunks | |
1583 bundling files: foo/Bar/file.txt 2 chunks | |
1584 bundling files: foo/Bar/file.txt 3 chunks | |
1585 bundling files: foo/file.txt 4 chunks | |
1586 bundling files: foo/file.txt 5 chunks | |
1587 bundling files: foo/file.txt 6 chunks | |
1588 bundling files: foo/file.txt 7 chunks | |
1589 bundling files: quux/file.py 8 chunks | |
1590 bundling files: quux/file.py 9 chunks | |
1591 bundling files: quux/file.py 10 chunks | |
1592 bundling files: quux/file.py 11 chunks | |
1593 changesets: 1 chunks | |
1594 add changeset ef1ea85a6374 | |
1595 changesets: 2 chunks | |
1596 add changeset f9cafe1212c8 | |
1597 changesets: 3 chunks | |
1598 add changeset 911600dab2ae | |
1599 adding manifests | |
1600 manifests: 1/3 chunks (33.33%) | |
1601 manifests: 2/3 chunks (66.67%) | |
1602 manifests: 3/3 chunks (100.00%) | |
1603 adding file changes | |
1604 adding foo/Bar/file.txt revisions | |
1605 files: 1/3 chunks (33.33%) | |
1606 adding foo/file.txt revisions | |
1607 files: 2/3 chunks (66.67%) | |
1608 adding quux/file.py revisions | |
1609 files: 3/3 chunks (100.00%) | |
1610 added 3 changesets with 3 changes to 3 files | |
1611 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1612 acl: acl.allow.branches not enabled | |
1613 acl: acl.deny.branches not enabled | |
1614 acl: "group1" not defined in [acl.groups] | |
1615 acl: acl.allow enabled, 1 entries for user fred | |
1616 acl: acl.deny not enabled | |
1617 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1618 acl: allowing changeset ef1ea85a6374 | |
1619 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1620 acl: allowing changeset f9cafe1212c8 | |
1621 acl: branch access granted: "911600dab2ae" on branch "default" | |
1622 acl: allowing changeset 911600dab2ae | |
1623 updating the branch cache | |
1624 rolling back to revision 0 (undo push) | |
1625 0:6675d58eff77 | |
1626 | |
1627 | |
1628 $ echo '[acl.deny]' >> $config | |
1629 $ echo "foo/Bar/** = @group1" >> $config | |
1630 | |
1631 @group is allowed inside anything but foo/Bar/ | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1632 |
11849 | 1633 $ do_push fred |
1634 Pushing as user fred | |
1635 hgrc = """ | |
1636 [acl] | |
1637 sources = push | |
1638 [extensions] | |
1639 [acl.allow] | |
1640 ** = @group1 | |
1641 [acl.deny] | |
1642 foo/Bar/** = @group1 | |
1643 """ | |
1644 pushing to ../b | |
1645 searching for changes | |
1646 common changesets up to 6675d58eff77 | |
1647 invalidating branch cache (tip differs) | |
1648 3 changesets found | |
1649 list of changesets: | |
1650 ef1ea85a6374b77d6da9dcda9541f498f2d17df7 | |
1651 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd | |
1652 911600dab2ae7a9baff75958b84fe606851ce955 | |
1653 adding changesets | |
1654 bundling changes: 0 chunks | |
1655 bundling changes: 1 chunks | |
1656 bundling changes: 2 chunks | |
1657 bundling changes: 3 chunks | |
1658 bundling changes: 4 chunks | |
1659 bundling changes: 5 chunks | |
1660 bundling changes: 6 chunks | |
1661 bundling changes: 7 chunks | |
1662 bundling changes: 8 chunks | |
1663 bundling changes: 9 chunks | |
1664 bundling manifests: 0 chunks | |
1665 bundling manifests: 1 chunks | |
1666 bundling manifests: 2 chunks | |
1667 bundling manifests: 3 chunks | |
1668 bundling manifests: 4 chunks | |
1669 bundling manifests: 5 chunks | |
1670 bundling manifests: 6 chunks | |
1671 bundling manifests: 7 chunks | |
1672 bundling manifests: 8 chunks | |
1673 bundling manifests: 9 chunks | |
1674 bundling files: foo/Bar/file.txt 0 chunks | |
1675 bundling files: foo/Bar/file.txt 1 chunks | |
1676 bundling files: foo/Bar/file.txt 2 chunks | |
1677 bundling files: foo/Bar/file.txt 3 chunks | |
1678 bundling files: foo/file.txt 4 chunks | |
1679 bundling files: foo/file.txt 5 chunks | |
1680 bundling files: foo/file.txt 6 chunks | |
1681 bundling files: foo/file.txt 7 chunks | |
1682 bundling files: quux/file.py 8 chunks | |
1683 bundling files: quux/file.py 9 chunks | |
1684 bundling files: quux/file.py 10 chunks | |
1685 bundling files: quux/file.py 11 chunks | |
1686 changesets: 1 chunks | |
1687 add changeset ef1ea85a6374 | |
1688 changesets: 2 chunks | |
1689 add changeset f9cafe1212c8 | |
1690 changesets: 3 chunks | |
1691 add changeset 911600dab2ae | |
1692 adding manifests | |
1693 manifests: 1/3 chunks (33.33%) | |
1694 manifests: 2/3 chunks (66.67%) | |
1695 manifests: 3/3 chunks (100.00%) | |
1696 adding file changes | |
1697 adding foo/Bar/file.txt revisions | |
1698 files: 1/3 chunks (33.33%) | |
1699 adding foo/file.txt revisions | |
1700 files: 2/3 chunks (66.67%) | |
1701 adding quux/file.py revisions | |
1702 files: 3/3 chunks (100.00%) | |
1703 added 3 changesets with 3 changes to 3 files | |
1704 calling hook pretxnchangegroup.acl: hgext.acl.hook | |
1705 acl: acl.allow.branches not enabled | |
1706 acl: acl.deny.branches not enabled | |
1707 acl: "group1" not defined in [acl.groups] | |
1708 acl: acl.allow enabled, 1 entries for user fred | |
1709 acl: "group1" not defined in [acl.groups] | |
1710 acl: acl.deny enabled, 1 entries for user fred | |
1711 acl: branch access granted: "ef1ea85a6374" on branch "default" | |
1712 acl: allowing changeset ef1ea85a6374 | |
1713 acl: branch access granted: "f9cafe1212c8" on branch "default" | |
1714 acl: user fred denied on foo/Bar/file.txt | |
1715 error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8 | |
1716 transaction abort! | |
1717 rollback completed | |
1718 abort: acl: access denied for changeset f9cafe1212c8 | |
1719 no rollback information available | |
1720 0:6675d58eff77 | |
1721 | |
11043
08681cb66231
acl: add tests for asterisk and for OS-level groups
Elifarley Callado Coelho Cruz <elifarley@gmail.com>
parents:
10119
diff
changeset
|
1722 |
11849 | 1723 Invalid group |
1724 | |
1725 Disable the fakegroups trick to get real failures | |
1726 | |
1727 $ grep -v fakegroups $config > config.tmp | |
1728 $ mv config.tmp $config | |
1729 $ echo '[acl.allow]' >> $config | |
1730 $ echo "** = @unlikelytoexist" >> $config | |
1731 $ do_push fred 2>&1 | grep unlikelytoexist | |
1732 ** = @unlikelytoexist | |
1733 acl: "unlikelytoexist" not defined in [acl.groups] | |
1734 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined | |
1735 abort: group 'unlikelytoexist' is undefined |