开发者

Mercurial common/local files

开发者 https://www.devze.com 2023-04-11 09:52 出处:网络
I\'m an hg user since a couple a years and I\'m happy about that! I have to start a project as I never did before.

I'm an hg user since a couple a years and I'm happy about that!

I have to start a project as I never did before. The idea is to develop a software with a batch mode and an GUI.

S开发者_如何学Co there will be common sources to both batch and GUI mode but each one will also contain specific sources. And, basically, I would like my coworkers to be able to clone the GUI version, work on it an commit changes. Then, I'd like to be able to merge their changes on the common files with the batch version.

How can I deal with that?

Since I've been reading a bit on this topic, I would really appreciate any help!!

Thank you. binoua


As the creator of subrepos, I strongly recommend against using subrepos for this.

While subrepos can be used for breaking up a larger project into smaller pieces, the benefits of this are often outweighed by the additional complexity and fragility that subrepos involve. Unless your project is going to be really large, you should just stick to one project repo for simplicity.

So what are subrepos for, then? Subrepos are best for managing collections of otherwise independent projects. For instance, let's say you're building a large GUI tool that wraps around an existing SCM. I'd recommend you structure it something like this:

scm-gui-build/ <- master build repo with subrepos:
  scm-gui/     <- independent repo for all the code in your GUI tool
  scm/         <- repo for the third-party SCM itself
  gui-toolkit/ <- a third-party GUI toolkit you depend on
  extensions/  <- some third-party extension to bundle
    extension-foo/  

Here you do all your work in a plain old repo (scm-gui), but use a master repo at a higher level to manage building/packaging/versioning/tagging/releasing the whole collection. The master scm-gui-build repo is just a thin wrapper around other normal repos, which means that if something breaks (like one of the repo's URLs goes offline) you can keep working in your project without problems.

(see also: https://www.mercurial-scm.org/wiki/Subrepository#Recommendations)

0

精彩评论

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

关注公众号