开发者

Group permissions reset on mercurial update

I've configured my hg repository according to the docs described here: 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


I had this same problem and solved it by setting the sticky bit on the remote repo directory.

chmod +s `find . -type d`

That will solve the problem that the OP ran into.


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 ( https://www.mercurial-scm.org/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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜