views:

49

answers:

3

I want to create a HG repository from a SVN repository, but I do not want the HG repository to have any of the commit comments. What would be the easiest way to do this?

A: 
  • Update your SVN folder on disk, then wipe out all the '.svn' subfolders. Or, with TortoiseSVN Repository Explorer, navigate to the desired folder and export it to your disk.
  • Add the files to a fresh HG repository.

HTH
Thomas

Thomas Weller
That would take a lot of manual exports/imports to get every revision.
Alias
So you want to keep the revisions and only get rid of the associated comments?
Thomas Weller
Yes, I want to keep the revisions and only get rid of the associated comments.
Alias
Hmm, AFAIK there's no simple way. Even if you use the HistEdit HG-extension from below you have to edit each and every single changeset...But I'm curious: Why do you want to do that?
Thomas Weller
+1  A: 

Import svn repository with comments (eiher via Convert extension or hgsubversion bridge). Than use HistEdit to rewrite history and remove comments.

Michal Sznajder
+1  A: 

If you don't mind editing a bit of Python code, get a local hg installation and change its convert extension to clobber all commit messages during conversion.

Something like

diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -294,6 +294,7 @@
         commit.author = self.authors.get(commit.author, commit.author)
         commit.branch = self.branchmap.get(commit.branch, commit.branch)
         self.commitcache[rev] = commit
+        commit.desc = 'no message'
         return commit

     def copy(self, rev):

should do the trick.

wbruna