在Mercurial队列目录上使用git

时间:2016-01-04 21:21:20

标签: git mercurial mercurial-queue

我有一个包含Mercurial队列(mq)格式的差异文件列表的文件夹,我想要应用这些补丁。

起初我尝试了git am --patch-format=hg -- "path/to/files/",但这给了我错误Patch is empty. Was it split wrong?。我尝试git am --continue,希望这是一个不停的错误,但它会抱怨Patch does not have a valid e-mail address.。然后我输入了git am --abort

我还尝试使用git am --patch-format=hg -- "path/to/files/*.diff"git am -- "path/to/files/*.diff",但这些人抱怨No such file or directory。我必须使用更好的git工具,还是我误解了git am的工作原理?

1 个答案:

答案 0 :(得分:0)

git am是从电子邮件(mbox或Maildir格式)应用补丁和补丁序列的命令,而MQ只是设置为"裸体"路径,没有包装成电子邮件(在电子邮件中有额外的元数据) - 在"简单的情况下"或hg-repository(如果补丁版本化)。

不希望此格式适用于git am("应用邮件")命令

如果你想从(普通的无版本)Mercurial Queue应用补丁,你必须仔细查看git apply(AFAICR,它只能应用每个命令的单个补丁,但是TBT! !!)