2

我正在编写一个存储库转换工具。问题是 git-to-darcs 部分。Git 可以有空提交;达克斯不能。对于空的 Mercurial 提交,我刚刚创建了一个标签。我知道 Darcs 有标签,但我不知道如何从消息中删除带标签的前缀。

4

1 回答 1

2

您可以通过创建一个非空补丁然后使用amend-record向它添加反向更改来欺骗 Darcs 制作一个空补丁:

ganesh@scafell ~/temp/1
$ touch foo

ganesh@scafell ~/temp/1
$ darcs add foo
Adding 'foo'

ganesh@scafell ~/temp/1
$ darcs rec
addfile ./foo
Shall I record this change? (1/1)  [ynW...], or ? for more options: y
Do you want to record these changes? [Yglqk...], or ? for more options: y
What is the patch name? foo
Finished recording patch 'foo'

ganesh@scafell ~/temp/1
$ rm foo

ganesh@scafell ~/temp/1
$ darcs amend
Wed May 28 06:49:22 GMT Daylight Time 2014  Ganesh Sittampalam <ganesh@earth.li>
  * foo
Shall I amend this patch? [yNjk...], or ? for more options: y
rmfile ./foo
Shall I record this change? (1/1)  [ynW...], or ? for more options: y
Do you want to record these changes? [Yglqk...], or ? for more options: y
Finished amending patch:
Wed May 28 06:49:31 GMT Daylight Time 2014  Ganesh Sittampalam <ganesh@earth.li>
  * foo
于 2014-05-28T05:51:35.010 回答