3

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.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Wyck
  • 2,023
  • 4
  • 28
  • 34
  • 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 Dec 11 '11 at 11:44
  • 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 Dec 11 '11 at 16:08
  • 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 Dec 13 '11 at 11:58
  • 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 Dec 13 '11 at 16:09
  • 4
    This is explicitly not supported by hgsubversion at this time. Patches welcome, but expected to be tricky. – durin42 Jan 19 '12 at 14:43
  • The philosophy is quite different. In SVN, the /tags are just a normal folder structure, where you can commit to (but it is not recommended). In Hg, a tag is more like a bookmark than a folder, hence you can't put anything (files, folders) into a tag in Mercurial. – Christoph Jüngling Mar 28 '12 at 08:47

2 Answers2

0

You can't create tags in SVN from Mercurial

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

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.

durin42
  • 1,447
  • 8
  • 10