views:

35

answers:

1

I've configured my hg repository according to the docs described here:

http://mercurial.selenic.com/wiki/MultipleCommitters

However, when I execute "hg update -C" to recreate the working copy locally, the file permissions have changed such that it eventually causes errors on push when other developers attempt to commit changes. Supposidly, when configured properly, hg update will preserve file permissions. Yet it doesn't appear to be doing so:

-rwxrwxr-x 1 root mercurial 2948 2010-06-24 15:27 .hg/store/data/src/public/index.php.i

vs. (actual source file, after deleting the working copy and recreating with "hg update -C")

-rw-r--r-- 1 root mercurial 820 2010-06-28 12:07 src/public/index.php

How can mercurial be configured such that when users create new files or modify existing files, the group and it's permissions are preserved?


UPDATE

2010.06.28

Here is a sample of the errors I'm seeing:

remote: resolving manifests
remote: getting src/configs/application.ini
remote: abort: Permission denied: /hg/repo/path/src/configs/application.ini
remote: warning: changegroup hook exited with status 255
remote: calling hook changegroup.notify: hgext.notify.hook
A: 

Which method exactly you've used? Describe more what is your setup.

Yes, mercurial does remember file permissions on commit. When you do hg update -C, it will recreate files with permissions that were set on last commit.

Your error message seems to be telling that repository files on repository server have wrong permissions/owner, so you cannot modify them with hg push. This could be because someone commited and pushed files as a different repository server user.

I would reccomend shared ssh method ( http://mercurial.selenic.com/wiki/SharedSSH ): you set up separate user account for repository management, add developer's ssh public keys (you should restrict them to be used only with mercurial with specific repositories) and then use ssh://hguser@server/path/to/repository as an url.

BTW: by default mercurial doesn't run any hooks if a user used to do push/pull is not in trusted list. See trusted section in man hgrc.

BTW2: don't run any regular software as a root. use normal account for that.

cezio
Mercurial only tracks the 'executable' permission, not user or group. The `.hg/store/data` files of the original poster's clone that change their owner are probably *touched* by a script that *runs* as `root`.
Giorgos Keramidas

related questions