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?
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.
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.
The Mercurial documentation says using the setgid
flag is okay.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With