Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-user Mercurial repositories over SSH?

Tags:

mercurial

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: How to set permissions so two users can work on the same hg repository?. Is this a bad solution?

like image 700
Chad Johnson Avatar asked Jul 27 '10 21:07

Chad Johnson


3 Answers

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.

like image 149
Ry4an Brase Avatar answered Nov 11 '22 23:11

Ry4an Brase


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.

like image 20
Patrice Tisserand Avatar answered Nov 12 '22 00:11

Patrice Tisserand


The Mercurial documentation says using the setgid flag is okay.

like image 2
Chad Johnson Avatar answered Nov 11 '22 23:11

Chad Johnson