使用命名分支机构你所描述是一个不错的选择(尽管not the only choice),但我还是建议使用一些单独的克隆在众所周知的地点促进这一过程。假装http://host/hg/
是hgweb(原hgwebdir)为您的安装(虽然SSH://伟大工程太,等等),你有这样的事情:
http://host/hg/vendor
http://host/hg/custom
两个独立的仓库,其中数据从供应商流向定制,但从来没有其他方向。指定分支default
将是vendor
和custom
中的唯一一个,您将同时拥有default
和stable
。
当你从供应商一个新的代码降你把它解压到vendor
回购的工作目录,然后运行:
hg addremove
hg commit -m 'new drop from vendor, version number x.x.x'
你在vendor
回购历史将是线性的,并它永远不会有你写的东西。
在
custom
的本地克隆
现在回购你会怎么做:
hg update default # update to the latest head in your default branch
hg pull http://host/hg/vendor # bring in the new changes from vendor as a new head
hg merge tip # merge _your_ most recent default cset with their new drop
然后,你做他们的新代码滴上默认合并本地机会的工作。当你对合并感到满意时(测试通过等),你从本地克隆推回到http://host/hg/custom
。
该过程可以根据需要重复进行,将您的历史记录与他们的历史记录分离开来,并且让团队中的每个人都不负责接受来自供应商的新代码丢失,只关心一个正常的default/stable
安装回购,http://host/hg/custom
。
发现了一个类似的情况,但对于Subversion的问题。 (http://stackoverflow.com/questions/2447591) – 2010-10-22 15:33:18
有人会建议Mercurial队列(mq) - 忽略它们。准备补丁时,个人使用这项技术是一项很好的技术,但不适合您的流程的核心。 – 2010-10-22 15:56:51