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.
When I've needed empty commits in p4 and hg before, I've simply used a file that was set aside to 'be' the empty commit. Just dump a random string of some sort (I usually use the time and date) into the throwaway file, and
hg commit
away....Perhaps, the following will not help you in the situation, but perheps other reader.
You can make an "empty" commit via import of a nearly empty patch. I exported a patch, removed all changes in it, leaveing only 3 lines (diff..., ---... and +++ ...), and imported it with
hg import --bypass --message ...
I think you can't do empty commit in mercurial. Here's a thread explaining why.
As per @vorrtex's comment on the original question, the simplest method to force an empty commit in Mercurial is as follows:
Dummy.txt
) and commit.hg forget Dummy.txt
hg commit --amend
This will remove
Dummy.txt
from the previous commit, leaving it empty. (You can use e.g. TortoiseHg for step 1 but you'll need to use a command line tool for steps 2 and 3.)I'm adding this as a new answer because when scanning this thread originally I missed the comment, and the existing answers don't create a truly empty commit.
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):
Then you simply add the svn.15801 tag:
and contunie to import.
But make a backup before you try this.