3
votes

Using TortoiseHg and the hgsubversion extension (command line is fine too).

Cloning an SVN URL hg clone http://svn.example.org/hello-world, that has the following structure.

  • ..
  • branches/
  • tags/
  • trunk/

Results in a local copy with only files from /trunk.

  • ..
  • .hg
  • .hgtags
  • file1
  • file2
  • file3

Doing hg push works fine and alters the files in /trunk. But I need to create new tag folders in /tags and push changes there.

Adding a tag to a revision in Hg and pushing changes results in a "Sorry, can't find svn parent of a merge revision."

Is there any way to preserve the SVN folder structure during clone?

edit: Typing hg tags does show the structure at the command line, but I need to push into the remote /tags directory and a default push is going into /trunk, no idea how to change how this works.

2
When you cloned the SVN repo using hgsubversion it will have converted your SVN trunk/branches/tags structure to the Mercurial equivalent. You'll be able to see your branches using 'hg branches' and your tags using 'hg tags'. If that is the case then your only remaining question would be "why can't I push a tag using hgsubversion?" unfortunately, I don't know the answer to that as I have never tried.Steve Kaye
Thanks, you're correct when I type ``hg tags' I do so the tags in Hg, but the way the remote svn is setup the changes have to be submitted into /tags folder and not /trunk which it seems to be doing by default.Wyck
If you make a new tag in Mercurial and then push it, it does not create a new copy in the tags folder? Then I guess that is a limitation of hgsubversion. I used hgsubversion in the past, it’s not a very ideal kind of set-up in the first place.Laurens Holst
Correct, creating new tags does not push anything into /tags, only /trunk, I will try to explicitly push into /tags and see if that works.Wyck
This is explicitly not supported by hgsubversion at this time. Patches welcome, but expected to be tricky.durin42

2 Answers

0
votes

You can't create tags in SVN from Mercurial

0
votes

https://bitbucket.org/durin42/dotfiles/src/ae22ef7859eb0d2b8ba0edbacfae0e61a0e7bb51/.shell.d/50.hg_functions.sh?at=default#cl-88 is how I usually create svn branches when using hgsubversion. It shouldn't be hard to modify that to create tags instead.