我怎样才能强制Mercurial接受一个空的提交 [英] How can I force mercurial to accept an empty commit
问题描述
我正在尝试使用hgsvn
转换SVN存储库,并且在修改了SVN属性的情况下进行了一些提交,但是由于Mercurial不使用这些提交,因此它将其视为空提交并中止.有什么方法可以强制此hg commit
接受不做任何更改的提交?
I'm trying to convert an SVN repo with hgsvn
and I have some commits where SVN properties where modified, but since Mercurial doesn't use those, it sees this as an empty commit and aborts. Is there any way to force this hg commit
to accept a commit that doesn't change anything?
我对hgsvn
的内部知识并不熟悉,无法破解它以跳过空提交.
I'm not familiar enough with the internals of hgsvn
to hack it to skip empty commits.
推荐答案
如果将本地svn.$ REVNUM标记添加到主要修订版(=也具有svn的修订版,则可以跳过此提交.($ REVNUM- 1)立即标记).然后,您可以继续使用hgpullsvn.
You can skip this commit if you add a local svn.$REVNUM tag to the head revision (=the revision which also has the svn.($REVNUM-1) tag now). Then you can continue with hgpullsvn.
假设您的导入处于此状态(上次导入的转速为15800,纯属性转速为15801):
Say your import is at this state (last imported rev is 15800, the property-only rev is 15801):
$ hg log -l1
changeset: 1234:123456789abc
branch: trunk
tag: tip
tag: svn.15800
parent: 1233:cba987654321
user: Rudi <rudi@example.com>
date: Tue Aug 24 11:42:23 2010 +0200
summary: Foobar
$ svn info
Path: .
URL: svn+ssh://example.com/foobar/trunk
Repository Root: svn+ssh://example.com/foobar
Repository UUID: 26c7c274-8ed1-4e7f-bdc1-5c767a948b10
Revision: 15801
Node Kind: directory
Schedule: normal
Last Changed Author: rudi
Last Changed Rev: 15801
Last Changed Date: 2010-08-24 14:00:29 +0200 (Di, 24 Aug 2010)
然后,您只需添加svn.15801标签:
Then you simply add the svn.15801 tag:
$ hg tag -l -r 123456789abc svn.15801
和要导入的消息.
但是请先进行备份.
这篇关于我怎样才能强制Mercurial接受一个空的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!