hg Convert - 尝试将目录从一个存储库移动到另一个存储库

发布于 2024-09-18 15:54:46 字数 1013 浏览 9 评论 0原文

所以我有一个名为 flash 的目录。我想将其从位于 ~/wdm 的现有 Mercurial 存储库完全移至位于 ~/wdm-js 的另一个现有 Mercurial 存储库。

有人告诉我这可以通过 hg Convert 实现,但我真的不知道这是如何工作的。我尝试了以下方法,但认为我可能做错了什么。

阅读 Mercurial 文档的 hg 转换后,我创建了一个文件映射,其内容如下:

include flash

然后我转到 ~/wdm 并运行以下命令:

$ hg convert . ~/wdm-js --filemap ~/filemap.txt

我看到了如下输出负载:

scanning source...
sorting...
converting...
413 [doc/design][m]: first stab at a design doc for model (sent to list).
[412 more history items]

所以这看起来相当有希望。但是当我查看 wdm-js 时,那里没有 flash 目录。并且 flash 目录文件均未从 wdm 目录移出。两个存储库的 hg status 看起来没有什么不同。

我是否仍然需要手动复制 flash 目录,并将 hg add/hg remove 所有文件手动复制到两个存储库?

或者……这应该是为我做的,这意味着我在某种程度上搞砸了?

So I have a directory called flash. I'd like to move it totally from an existing Mercurial repo located at ~/wdm to another existing Mercurial repo, located at ~/wdm-js.

I've been told this is possible with hg convert, but I don't really know how this works. I have tried the following, but think I may have got something wrong.

Having read up on the hg convert for Mercurial docs, I've created a filemap, which reads as follows:

include flash

Then I've gone to ~/wdm and run the following command:

$ hg convert . ~/wdm-js --filemap ~/filemap.txt

I've seen a load of output as follows:

scanning source...
sorting...
converting...
413 [doc/design][m]: first stab at a design doc for model (sent to list).
[412 more history items]

So this looks fairly promising. But when I look at wdm-js there is no flash directory there. And none of the flash directory files have moved from the wdm directory. And the hg status of both repos looks no different.

Do I still have to copy the flash directory across manually, and hg add/hg remove all the files manually to both repos?

Or... should this have been done for me, meaning that I have messed up in some way?

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

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

发布评论

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

评论(2

姐不稀罕 2024-09-25 15:54:46

hg Convert 不会更新目标存储库中的工作目录(它将其保留为原始空修订版本),因此请在其中执行 hg update 来查看文件。另外,按照您运行它的方式,它会复制文件;您可以通过 hgforgethgremove 从原始存储库中删除它们,或者使用带有以下行的文件映射再次使用 hgconvert

exclude flash

hg convert doesn't update the working directory in the destination repository (it leaves it at the original null revision), so do a hg update there to see the files. Also, the way you ran it, it copies the files; you can either delete them from the original repository via hg forget or hg remove, or use hg convert again using a filemap with the line:

exclude flash
情徒 2024-09-25 15:54:46

要复制到现有存储库,您需要首先将 flash 文件夹复制到新存储库,就像使用转换命令一样,然后将更改从新存储库推送到现有目标存储库。

To copy into existing repository you need first copy flash folder into new repository as you did it with convert command and then push the changes from new repository into existing target repository.

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