如何使用 Mercurial 合并存储库外部所做的更改?
我加入了一个拥有绿地代码的团队。当我加入时,他们没有一个通用的存储库,他们通过电子邮件给我发送了他最新的 tarball。 (是的,我知道...)我一直在处理该 tarball,进行更改并添加文件。现在,团队拥有了 Mercurial 存储库(万岁!),并且它已填充了相同的代码,其中包含其他人最近所做的更改。换句话说,我的原始 tarball 代码位于一个目录中,我的更改位于另一个目录中,而 hg 克隆位于第三个目录中,其中原始 tarball 代码是共同的祖先。
将我的更改合并到 Mercurial 存储库的好方法是什么? Mercurial 没有共同祖先的历史。我是 Mercurial 的新手。我的 VCS 经验是使用 CVS、Perforce 和一些 SVN。我可以再创建两个本地 hg 克隆,并用原始代码重写一个,用我更改的代码重写另一个,然后使用 Mercurial 以某种方式合并它们吗? (如果是这样,如何?)或者我应该考虑使用独立的合并工具,然后将合并的版本复制到我的克隆目录中?还是别的什么?
这一切都在 RHE Linux 上。
谢谢。
I joined a team with greenfield code. When I joined, they did not have a common repository, and they emailed me a tarball of his latest. (yeah, I know...) I've been working off that tarball, making changes and adding files. Now the team has a Mercurial repository (hooray!), and it's been populated with the same code containing more recent changes by other people. In other words, I have the original tarballed code in on directory, my changes in another directory, and an hg clone in a third directory, where the original tarballed code is the common ancestor.
What is a good way to merge my changes into the Mercurial repository? Mercurial has no history of the common ancestor. I am brand new to Mercurial. My VCS experience is with CVS, Perforce, and some SVN. Can I create two more local hg clones and rewrite one with the original code, the other with my changed code, and use Mercurial to merge them somehow? (and if so, how?) Or should I consider using an independant merge tool and then copying the merged version into my clone's directory? Or something else?
This is all on RHE Linux.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以尝试的一个选择是这样的:
将您迄今为止的所有工作作为新的变更集导入,基于他们拥有的最旧的修订版,然后将该工作与他们开始使用后在 Mercurial 中的工作合并。
理想情况下,他们的 r0 应该是他们给你的 tarball,但希望它没有太大不同。
One option to try is something like this:
That's taking all your work to date, importing it as a new changeset based on the oldest revision they do have, and then merging that work with their work in mercurial since they started using it.
Ideally their r0 would be the tarball they gave you, but one hope's it's not too different.