1

I'm a VERY happy user of bitbucket and mercurial after years of putting up with subversion (and CVS, SourceSafe and others; anybody remember SCCS?). I've considerable project history now in my local hg repo, pushed daily to bitbucket and thence to my home machines.

Problem is, my company wants me to maintain a copy of this history in subversion. And I've hit a stone wall trying to set this up. I've installed hgsubversion, I think correctly. And I've used svnadmin to create an empty svn repository ready to hold the hg history.

But now what? The instructions say to start by pulling a clone (of nose? what's that? I assume this means checkout a copy of the new empty svn directory. OK did that.

But now what? I assume the next step is to push my real local hg clone to the empty svn repo I just checked out. But nothing I've tried will do this. Pull fails as follows, reporting "unrelated repository" (as I recall I gate it the URL of my master local hg repo to get around the "Needs a URL" popup on everything else I've tried.

found new changeset 139d02f4b233 examining 4e97a23b6815:342df9e52cec abort: repository is unrelated [command returned code 255 Mon Apr 25 11:29:33 2011]

The result of all this fumbling around is a directory with .hg, .svn and .hgignore entries and nothing else.

So, I feel I'm missing something basic that hundreds of others must have tried by now. Can someone please help me get started? Thanks!

PS: Currently the intent is to maintain SVN permanently as the team repo and push changes there from Hg periodically which would remain the main client for me indefinitely. In case this matters...

Nicholas Riley
  • 43,532
  • 6
  • 101
  • 124
Bradjcox
  • 1,509
  • 1
  • 18
  • 30
  • I tried convert but it didn't work. Any idea why?I tried convert but it didn't work. Any idea why? Here's the console log: D:\>hg convert --dest-type svn pbac-pdp-src pbac-pdp-svnD:\>hg convert --dest-type svn pbac-pdp-src pbac-pdp-svn initializing svn repository 'pbac-pdp-svn' initializing svn working copy 'pbac-pdp-svn-wc' scanning source... sorting... converting... 486 initialize repository abort: svn exited with status 1 D:\>svn Type 'svn help' for usage – Bradjcox Apr 25 '11 at 19:24
  • Dang it. How to (re)insert a carriage return? Looks impossible. – Bradjcox Apr 25 '11 at 19:25

2 Answers2

2

You can use the convert extension:

hg convert --dest-type svn mercurialrepo svnrepo

And hgsubversion allows you keep both of them in sync ( bidirectional)

Answered here at SO already:

Converting from Mercurial to Subversion

Migrating from Mercurial to Subversion

Community
  • 1
  • 1
manojlds
  • 290,304
  • 63
  • 469
  • 417
1

Perhaps look at the answers to this question.

Hgsubversion is for working with a repository cloned from SVN using Hg, not the other way around.

Community
  • 1
  • 1
sylvanaar
  • 8,096
  • 37
  • 59
  • I tried convert but it didn't work. Any idea why?I tried convert but it didn't work. Any idea why? Here's the console log: D:\>hg convert --dest-type svn pbac-pdp-src pbac-pdp-svnD:\>hg convert --dest-type svn pbac-pdp-src pbac-pdp-svn initializing svn repository 'pbac-pdp-svn' initializing svn working copy 'pbac-pdp-svn-wc' scanning source... sorting... converting... 486 initialize repository abort: svn exited with status 1 D:\>svn Type 'svn help' for usage. – Bradjcox Apr 25 '11 at 18:13
  • @Bradjcox: Could you put that in your question where you can format it so it's readable? – Omnifarious Apr 25 '11 at 18:22