1

I'm in the process of converting a subversion based project to mercurial using the hgsubversion extension. The subversion repo has a directory with an svn:externals properties that references two files from another project. Hgsubversion can convert directory externals to sub-repos but apparently not file referencing externals. I want to move away from externals/sub-repos anyway so I thought I could flatten them out as part of a svnsync.

Since this is going to be a one-shot convert and I don't mind tweaking the subversion history, I was thinking I could "de-reference" or un-externalize the files as part of the sync process. I need the resultant mirror to contain the external files without the property 'svn:external' on the directory containing the files.

I'm thinking this could be done as a commit hook. But I can't figure how to change the commit in progress, just how to abort it. This question: SVN post-commit hook to modify externals kinda gets there but the answer is mostly advice to move away from externals (I'm already convinced).

Of course if I've made too many assumptions about the best way to migrate from svn to hg please feel free to make alternative suggestions.

Community
  • 1
  • 1
MSlimmer
  • 160
  • 1
  • 10
  • Why not remove the file externals completely (keeping the files themselves, so you'd have to `svn add` them), `svn commit`, and then do the conversion? – Sameer Singh Sep 11 '13 at 09:43
  • @SameerSingh I want to remove them. I want to remove the svn:externals from history but keep the files that they reference. I'll edit my question. – MSlimmer Sep 11 '13 at 15:46
  • Well, you could do a dump-and-reload of the repo, filtering out the revisions that added the externals, add the files the externals would have brought in (and commit), then do the conversion. [An example can be found here](http://stackoverflow.com/questions/11679926/how-to-use-svndumpfilter-to-exclude-a-certain-revision). – Sameer Singh Sep 12 '13 at 11:26
  • @SameerSingh That sounds workable assuming the revision that added the externals didn't do anything else or if it did, I replicate that in the newly inserted commit. Basically it sounds like this is a pretty manual process. Thank you for the insight. – MSlimmer Sep 18 '13 at 18:37

0 Answers0