如何从 Mercurial (hg) 迁移到 Perforce (p4)?

发布于 2024-10-08 15:15:44 字数 68 浏览 3 评论 0原文

我有一个 Mercurial 数据库,我想将其迁移到 Perforce 并保留所有更改。告诉我一个方法,我可以做到这一点。

I've got a Mercurial database that I want to migrate to Perforce and preserve all the changes. Tell me a way I can do this.

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

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

发布评论

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

评论(4

月亮是我掰弯的 2024-10-15 15:15:44

2013 年 3 月更新:

只是为了使信息更新:

svn -> p4

有一个新工具叫做 p4convert-svn:
p4convert-svn doc

注意文件系统大小写/敏感性。

汞-> p4

以下工具没有被太多提及,但 perforce 支持推荐:

hg Convert p4 sink depot

它将 p4 sink 添加到 hg Convert 扩展中。缺点是它适合 Mercurial 1.7.3,到今天为止已经有点过时了(当前是 2.2.5)。它可以轻松地手动合并到 2.0.2 版本中,即使对于大文件扩展用户来说也足够了。

有关更多信息,请阅读软件仓库中的 Readme-P4.txt 文件。

Update Mar/2013:

Just to make the informations up to date:

svn -> p4

There is a new tool called p4convert-svn:
p4convert-svn doc

Beware of filesystem case in/sensitivity.

hg -> p4

Following tool is not mentioned a lot, but it's recommended by perforce support:

hg convert p4 sink depot

It adds p4 sink into hg convert extension. Disadvantage is that it fits in mercurial 1.7.3 which is a bit outdated as of today (current is 2.2.5). It can be merged by hand easily into 2.0.2 version which may be sufficient even for largefile extension users.

For more information read file Readme-P4.txt in the depot.

笑忘罢 2024-10-15 15:15:44

我想到的一种方法是将存储库克隆到我的工作区中并执行 python 脚本来进行迁移。该脚本将循环遍历从 0 开始到tip 结束的每个修订版本,并在此过程中将文件签入到 p4。

我认为我可以通过 log 命令获取所有变更集注释,然后我可以使用 hg log -ri --template {rev}: {file_adds}|{file_dels}|{file_mods }\n,其中 i 是当前修订版本,用于获取已添加、删除、重命名等的文件。当我注意到我位于新分支时,我可以检查 P4 中的分支并在必要时创建它。

一天结束时,所有这些东西都应该根据 P4 进行检查。

One way that I thought of doing this is to clone the repository into my workspace and execute a python script to do the migration. The script would loop through each revision starting with 0 and ending with the tip, checking in files to p4 along the way.

I figure that I can get all the changeset comments via the log command, then I can use hg log -r i --template {rev}: {file_adds}|{file_dels}|{file_mods}\n, where i is the current revision, to get the files that were added, removed, renamed, etc. When I notice that I'm on a new branch, I can check for the branch in P4 and create it if necessary.

At the end of the day, all that stuff should be checked in accordingly to P4.

醉生梦死 2024-10-15 15:15:44

查看 Mercurial wiki 的 Perforce 部分转换存储库页面。似乎有人支持推动从 Mercurial 到 Perforce 的变革。

Take a look at the Perforce section of the Mercurial wiki page on Converting Repositories. There seems to be support for pushing changes from Mercurial to Perforce.

混浊又暗下来 2024-10-15 15:15:44

我最近开始研究如何将 Alienbrain 存储库迁移到 Perforce。由于没有可用的工具公开来执行此操作,我的研究导致了一些关于如何编写迁移程序的资源。

  • 阅读 Perforce 网站上的“迁移规划指南”(pdf 链接 )。该文档是为 ClearCase 到 Perforce 编写的,但是这三种方法仍然相关。特别是,请查看“基线分支导入”技术,看看这对您是否有意义。

  • 从 Tigris 下载 svn2p4sync 的副本(链接),因为它是经过最严格测试的可用迁移脚本之一。在 Tigris 站点上,阅读 svn2p4sync 发行说明/问题页面,了解有关脚本开发方式的详细历史 (链接)。

  • 我还刚刚在 Mercurial wiki 上找到了通用转换页面(链接)(感谢 Wim Coenen 答案中的链接)。

编辑:对于有脚本的特定情况,我建议您使用 Wim Coenen 答案中的链接(链接)。

哈特哈,

I have recently started researching how to migrate an Alienbrain repository to Perforce. As there are no tools publicity available to do this, my research had lead to several resources on how to write your migration program.

  • Read the "Migration Planning Guide" on the Perforce website (pdf link). The document is written for ClearCase to Perforce, however the three approaches are still relevant. In particular, have a look at the "Baseline Branch Import" technique to see if that would make sense for you.

  • Download a copy of svn2p4sync from Tigris (link) as it is one of the most tested migration scripts available. Whilst on the Tigris site, read the svn2p4sync release notes/issues page for a good history of how the script was developed (link).

  • I've also just found the Generic Conversion page (link) on the Mercurial wiki (thanks to the link in Wim Coenen answer).

Edit: for your specific case where there is a script, I would recommend you use the linked in Wim Coenen answer (link).

HTH,

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