ACL in Mercurial

2.5k views Asked by At

I'm trying to get ACL working in Mercurial. Now, I'm not positive that it will work at all because I'm using hg 1.5.1. (I'm working on figuring out who I have to talk to to get someone to upgrade that for me)

Assuming that 1.5.1 will support it, my hgrc file looks like:

[extensions]
acl =

[hooks]

# Use this if you want to check access restrictions at commit time
pretxncommit = python:hgext.acl.hook

# Use this if you want to check access restrictions for pull, push,
# bundle and serve.
pretxnchangegroup = python:hgext.acl.hook

[acl]
# Check whether the source of incoming changes is in this list where
# "serve" == ssh or http, and "push", "pull" and "bundle" are the
# corresponding hg commands.

sources = serve push pull

etc

I'm getting:

error: pretxnchangegroup hook failed: acl: access denied for changeset 242c80d5c009
transaction abort!
rollback completed
abort: acl: access denied for changeset 242c80d5c009

Currently, I'm just doing this on a tiny non-server repo, but eventually this will be on a normal large HTTPS server...

thanks

EDIT: [ changed hgrc file] Ok, now I seem to be 1/2 there. When I try to push on a branch I'm not allowed to, I get:

error: pretxnchangegroup.acl hook failed: acl: user "brian_postow" not allowed on branch "branch-b" (changeset "597eddef10a1")
transaction abort!
rollback completed
abort: acl: user "brian_postow" not allowed on branch "branch-b" (changeset "597eddef10a1")

Which looks correct (maybe?) However, when I push from a branch that I AM allowed to, I get:

error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 242c80d5c009
transaction abort!
rollback completed
abort: acl: access denied for changeset 242c80d5c009

so, I still don't appear to be able to push... Any ideas?

1

There are 1 answers

0
Brian Postow On BEST ANSWER

Actually I solved this problem. The problem was that I had [acl allow] but nothing in it... I thought that branches.allow would supercede allow, but I guess not.

thanks.!