How do people manage changes to common library files stored across mutiple (Mercurial) repositories?

后端 未结 3 2057
孤城傲影
孤城傲影 2021-01-03 09:04

This is perhaps not a question unique to Mercurial, but that\'s the SCM that I\'ve been using most lately.

I work on multiple projects and tend to copy source code f

相关标签:
3条回答
  • 2021-01-03 09:35

    use the transplant extension

    0 讨论(0)
  • 2021-01-03 09:36

    I'd recommend against your "copy the sourcecode" practice but use binary distribution for your custom libraries instead. These binaries are checked in along the sourcecode.

    • reduces build-time
    • no overhead of tracking changes in all copies of the library
    • you can use different versions of the same library in different projects.

    EDIT: And for the issue with "common" or "toolbox" libaries in general, read this post from ayende.

    0 讨论(0)
  • 2021-01-03 09:42

    Three solutions, pick your favorite:

    1. Put all projects into one repository.
    2. Make a separate repository for shared code and different repository for each project.
    3. One repository with Subrepositories: https://www.mercurial-scm.org/wiki/subrepos, keep all common code in one subrepo and different subrepos for each project.

    Copying actual files between repositories with no common ancestors will never be optimal as history is not preserved.

    0 讨论(0)
提交回复
热议问题