Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
860 views
in Technique[技术] by (71.8m points)

svn - How can I force mercurial to accept an empty 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?

I'm not familiar enough with the internals of hgsvn to hack it to skip empty commits.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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)

Then you simply add the svn.15801 tag:

$ hg tag -l -r 123456789abc svn.15801

and contunie to import.

But make a backup before you try this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...