使用convert从Mercurial Repo的子文件夹中创建一个新的repo [英] Create a new repo from sub folder in Mercurial Repo using convert

查看:76
本文介绍了使用convert从Mercurial Repo的子文件夹中创建一个新的repo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用将Mercurial转换为Mercurial的扩展程序,从现有的Mercurial Repo(调用 MainRepo )中提取一个文件夹(称为 Project1 ).我遵循了Windows XP下Mercurial开发人员(以及网络上其他地方)描述的方法:

I am trying to extract a folder (call it Project1) from an existing Mercurial Repo (call in MainRepo) using the Convert extension for Mercurial to Mercurial conversion. I have followed the methods described by Mercurial developers (and elsewhere on the web) under Windows XP:

 C:\MainRepo>echo include Project1 > ~myfilemap
 C:\MainRepo>echo rename Project1 . >> ~myfilemap
 C:\MainRepo>hg convert --filemap ~myfilemap . C:\Project1Repo
 C:\MainRepo>cd \Project1Repo
 C:\Project1Repo>hg update

这将使用Mercurial文件夹/文件创建新的存储库(Project1Repo). 但事实并非如此:

This creates the new repo (Project1Repo) with the Mercurial folder/files in place. But it does not:

1)在文件夹Project1中携带与对该项目所做的更改有关的历史记录. (仅显示MainRepo的第一个历史记录条目和一个Convert项).

1) Carry across the History relating to the changes made for the Project in folder Project1. (Only the very first history entry for MainRepo and a Convert item are present).

2)将所有源代码文件从MainRepo \ Project1复制到Project1Repo.

2) Copy across all the source code files from the MainRepo\Project1 to Project1Repo.

我在stackoverflow中看到了其他类似的问题和答案,但是这些似乎并没有帮助(我遵循其中讨论的方法): 我可以克隆Mercurial存储库的一部分吗?

I have seen the other similar questions and answers in stackoverflow but these do not appear to help (I have followed methods discussed in them): Can I clone part of a Mercurial repository?

所以问题是:如何从MainRepo中提取一个子文件夹,并且只保留完整的子文件夹历史记录,并完成到新的Repo并同时传输源文件? (尽管我想直接复制会做最后一个).保留重要的历史记录-在这种情况下,我可以在日期或变更集编号之后进行设置.

So the question is: How do I extract a sub-folder from MainRepo with only the sub folder history intact and complete to a new Repo and transfer the source files at the same time? (though I guess a straight copy will do the last). It's keeping the history that is important - In this case I can make this after a date or Changeset number.

任何帮助都值得赞赏,因为我还比较陌生

Any help much appreciated as I'm relatively new to this

谢谢

推荐答案

您列出的工作流程是正确的.这就是convert扩展名的工作方式.

The workflow you listed is correct. That is the way the convert extension is intended to work.

您的问题指出hg convert的回购输出实际上为空(" MainRepo的第一个历史记录条目和一个转换项"除外).这表明convert找不到文件映射中指定的路径.

Your question states that the repo output by hg convert is actually empty (except for "the very first history entry for MainRepo and a Convert item"). This would indicate that convert was not able to find the path specified in your filemap.

您确定include语句给出的路径正确吗?

Are you certain that the path given your include statement is correct?

include语句中给定的目录名称必须是存储库根目录的完整路径.例如,您的include语句:

The directory name given in your include statement must be the full path from your repository root. For example, your include statement:

include Project1

要求Project1的路径实际上是:

requires that the path to Project1 actually be:

C:\MainRepo\Project1

如果Project1实际上位于MainRepo中的其他位置,则转换后最终将得到一个空的存储库.

If Project1 is actually located somewhere else in MainRepo, you will end up with an empty repo after the conversion.

这篇关于使用convert从Mercurial Repo的子文件夹中创建一个新的repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆