开发者

How should binary artifacts (e.g. documents) be handled in Mercurial

开发者 https://www.devze.com 2023-03-17 17:47 出处:网络
We\'re currently mostly SVN users with a well defined workflow. We use central/mirrored repos, locking to prevent accidental simultaneous edit of binary artifacts, branching/merging in a defined way f

We're currently mostly SVN users with a well defined workflow. We use central/mirrored repos, locking to prevent accidental simultaneous edit of binary artifacts, branching/merging in a defined way for code, etc.

We've used hg (and git) in some experiments and they're very nice. We would like to make more extensive use of them on real projects.

开发者_开发技巧

How though should we handle hard/impossible to merge binary artifacts, like docs from various tools, or images, etc?

What workflow is recommended for preventing users making changes to such items out in their various repos, and avoiding a hard manual change reconciliation process later?


I think that easy merging binary files in general is impossible, because it depends on the type of binary data. Therefore it would need to be done manually in the application that is able to deal with the specific file format.

In general for preventing users to making changes to some items at the same time you will need to implement a locking mechanism. Correct locking can only be accomplished if all clients know that something is locked (eg. by contacting a central server or broadcasting a question if it is locked or not). At the moment I have no useful idea on how to accomplish this without writing specialized software (that is triggered by actions or a constantly running background process or something like that).

In case the binary files are just the compiled output of some other source code, you may also add them to .hgignore and not deal with them in the repository.

0

精彩评论

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