tags:

views:

80

answers:

3

I have a centralized Mercurial repository which I want to provide access to via SSH.

I did a chown root:developers repository -R on the repository directory, so all users in group 'developers' should have access.

So, I clone, add my initial files to the repository as user A, commit, push, done. Now, I go as user B, clone, add a file, commit, and push. But then, when I do a pull, an update, and change that file as user A and then try to push, I get

pushing to /var/hg/repository
searching for changes
1 changesets found
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: Permission denied: /var/hg/repository/.hg/store/data/test.i

Am I missing a configuration step? Should I not be using SSH?

EDIT I found that using the sticky bit solves the problem: http://stackoverflow.com/questions/2846742/how-to-set-permissions-so-two-users-can-work-on-the-same-hg-repository/2848613#2848613. Is this a bad solution?

+1  A: 

The official Mercurial documentation says using the setgid flag is okay: http://mercurial.selenic.com/wiki/MultipleCommitters.

Chad Johnson
+1  A: 

Sticky group bit is the right way to do this. Also, it used to be the case that user's umasks needed to be set such that group read/write would be on for new files they add, but for the last year or two mercurial copies the permissions (not ownership) of the .hg directory in the repo itself on to newly created files, so the umask isn't as important.

Ry4an
+1  A: 

Maybe you could be interested by mercurial-server: http://www.lshift.net/mercurial-server.html

mercurial-server is useful if you don't want to provide a shell to developers on server hosting mercurial central repository.

Patrice Tisserand