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