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