Darcs记录空补丁

时间:2014-05-28 01:45:09

标签: version-control darcs

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

1 个答案:

答案 0 :(得分: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