1

We maintain a larger code base in a SVN Repository. For releases, we want to push only the release tag/branch into a Mercurial Repository, excluding the history from the trunk.

I have little experience with DVCSs, so maybe I'm on the wrong track with what I tried. If you can point out flaws or point to alternatives I'd be very happy.

Here is what I tried so far:

  • hg convert extension: Converted the complete repository using hg convert <base project URL w/o "trunk"> which should pull the complete history including branches and tags according to the convert extension documentation. But hg tags only returns tip and default, hg branches only default. Also, it is quite slow (yes, I read about svnsync) and it includes the complete history. I read that it can be used to pull incrementally, but I don't see that working for me.

  • hg convert extension: Converting a tag and pulling from another tag works w/ -f but I don't really trust it. Does it handle deletions correctly?

  • hgsubversion: hg clone of the complete repository excludes tags and branches as well

  • hgsubversion: hg clone on a tag works, but then pulling from another tag is not possible (abort: unable to work on a different path in the repository)

Thanks in advance for pointers. "Noob, go read this first and come back later" is appreciated as well.

demongolem
  • 9,474
  • 36
  • 90
  • 105
wwerner
  • 4,227
  • 1
  • 21
  • 39
  • Maybe an offsite question, but could you explain a bit more why you're trying to achieve such a thing? It seems very weird to me. – gizmo Apr 01 '11 at 09:03
  • @gizmo Yes, it is weird: We're using svn at our site and do not want to switch to hg for the complete team right now. (tight schedule, not much time for reeducation, distributed team, the usual excuses) We deliver code to our customer's continuous integration environment which uses hg as VCS. We would prefer not to push the complete history but only the defined release baselines to this repository. This environment is only accessible via VPN from a customer's machine we have access to. So the process is: Work with SVN during dev, for releases pull from SVN on the VPN machine and push into hg. – wwerner Apr 01 '11 at 09:21

1 Answers1

0

Answering my own question: I found a way to achieve what I need.

Assuming we have an empty hg repository into which I want to deliver my baseline, I add an .hgignore file that filters all svn metadata:

syntax glob 
.svn

Then I do the following:

  1. svn co <tag url> .
  2. hg addremove
  3. hg commit -m"pulled rev. <tag>"
  4. hg tag <tag>

For subsequent releases I do:

  1. svn switch <tag url> .
  2. hg addremove, hg commit & hg tag as above

This gives me the possibility to switch back and forth between revisions within my hg repository and I have a history of changed files between the baselines but not on svn commit level.

Any opinions on this? Thanks.

wwerner
  • 4,227
  • 1
  • 21
  • 39