hg Convert - 尝试将目录从一个存储库移动到另一个存储库
所以我有一个名为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
hg Convert
不会更新目标存储库中的工作目录(它将其保留为原始空修订版本),因此请在其中执行hg update
来查看文件。另外,按照您运行它的方式,它会复制文件;您可以通过hgforget
或hgremove
从原始存储库中删除它们,或者使用带有以下行的文件映射再次使用hgconvert
:hg convert
doesn't update the working directory in the destination repository (it leaves it at the original null revision), so do ahg 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 viahg forget
orhg remove
, or usehg convert
again using a filemap with the line:要复制到现有存储库,您需要首先将 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.