Jader Dias
Jader Dias

Reputation: 90475

How to commit the .svn folder to a Mercurial repository?

I want to commit the .svn folder, of each code folder, to the Hg repository. The problem is that many .svn subfolders are empty and, because of that, can't be committed to the mercurial repository.

One solution I found is to add an empty file to each of those folders, but this is cumbersome. Isn't there an easier way?

Upvotes: 1

Views: 217

Answers (2)

Rudi
Rudi

Reputation: 19940

When you want to use hg on top of a svn repo, you can try the hgsubversion extension. Hgsubversion gives mercurial the ability to talk to svn servers like a svn client.

OTOH if you insist to have .svn folders everywhere, you can use hgsvn to manage your parallel hg and svn repo checkout. But hgsvn has the drawback that it does no automatic rebase for stuff which gets back into svn, so when you have had to merge (in terms of a mercurial merge) the svn history with your local history, you can't export every local commit, only the merge commit (there is the way to export every commit even when there is a merge, but the first local commit will undo the recent svn history, and the merge commit will redo it, which causes a defect svn history).

More about different svn<->hg workflows are on the WorkingWithSubversion wiki page.

Upvotes: 2

Ry4an Brase
Ry4an Brase

Reputation: 78330

You need to add an empty file for each. You could do that quickly with:

for thedir in $(find /path/to/repo -type -d -name .svn) ; do
  touch $thedir/emptyfile
  hg add $thedir/emptyfile
done

Upvotes: 4

Related Questions