使用 Mercurial 启动一个与现有项目类似的新项目

发布于 2024-09-11 02:46:07 字数 289 浏览 1 评论 0 原文

我有一个关于 Mercurial (HG) 存储库的项目。我即将开始一个新项目,我想通过使用与上述项目完全相同的代码来开始。这两个项目完全无关。尽管他们做类似的事情,但每一件都是针对不同的客户,具有不同的名称、不同的品牌和不同的艺术。

我的问题是:

推荐的方法是什么:

  1. 克隆(hg clone)项目并开始进行更改?
  2. 归档(hg archive)项目并在归档副本上创建一个新的存储库(hg init)?
  3. 还有其他我没有考虑的选择吗?

多谢。

I have a project on a Mercurial (HG) repository. I am about to start a new project that I would like to start by using the exact same code as the mentioned project. The two projects are completely unrelated. Even though they do similar stuff, each one is for a different client, carry different names, different branding, different art.

My question is:

What would be the recommended approach:

  1. Cloning (hg clone) the project and start making changes?
  2. Archiving (hg archive) the project and making a new repository (hg init) on the archived copy?
  3. Any other option I am not considering?

Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

嘿看小鸭子会跑 2024-09-18 02:46:07

我将扩展我之前提出的评论,建议将通用功能放入库中,以避免在两个地方维护相同代码库的重复工作,并建议您是否可以将每个实例作为一个分支通用代码库,那么这可能是理想的。希望这样,如果您修复一个分支中的错误,那么合并分支应该很容易,或者至少可以轻松地以一致的方式应用更改。

I'm going to expand on the comment I made earlier suggesting that common functionality should be put into a library to avoid duplicated effort in maintaining the same code base in two places and suggest that if you can get away with making each instance a branch of the common codebase, then that's probably ideal. Hopefully that way if you fix a bug in one branch, it should be easy enough to merge branches or at least apply the changes in consistent ways easily.

一花一树开 2024-09-18 02:46:07

如果它使用“与提到的项目完全相同的代码”并且仅在品牌上有所不同,那么您可能希望从原始项目中分支出来。尽管最初情况是相同的,但稍后客户需求可能会有所不同(读取分支)。此外,内容文件也会开始有所不同。

简短的回答:是的,克隆并分支每个项目。通过分布式修订控制,您可以随时合并(如果需要)。

If it uses the "exact same code as the mentioned project" and differs only in branding then you would probably want to branch off from the original project. Although initially things are identical client requirements may diverge (read branch) later on. Also the content files would begin to differ.

Short answer: Yes clone and branch off each project. With distributed revision control you can always merge if you need to.

反话 2024-09-18 02:46:07

在您接受任何人(正确的!)建议进行分支之前,请阅读这篇文章:http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ 并决定在 Mercurial 中进行分支的众多有效方法中的哪一种是适合您。人们听到“branch”并使用 hgbranch,这是一种分支方式,但不是唯一的一种,也不一定是正确的一种。

如果我是你,我只会克隆,开始在克隆中工作,然后当你可以(根据 Gian 的伟大建议)重构到一个公共基础库时协调它们。

Before you take anyone's (correct!) advice to branch, please read this article: http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ and decide which of the many, valid ways to branch in mercurial is right for you. People hear "branch" and use hg branch which is one way to branch, but not the only one or necessarily the right one.

Were I you I'd just clone, start working in the clone, and reconcile them later when you can (per Gian's great advice) refactor into a common base library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文