7

I'm trying to clone a rather large subversion repository with hgsubversion.

hg clone --startrev 8890 svn+https://my.reposit.ory/trunk trunk_hg

After about an hour, the clone operation aborts with an out of memory message:

[r20097] user: description
abort: out of memory

Is it possible to specify an end revision for the clone operation and get the remaining revisions with a pull? Or somehow break up the clone in smaller steps?

pesche
  • 3,054
  • 4
  • 34
  • 35
  • Found just now the [doc](https://bitbucket.org/durin42/hgsubversion/src/tip/hgsubversion/help/subversion.rst), where the *out of memory* condition is mentioned and also the solution of the accepted answer; currently (r777) on lines 228..238 of the referenced document. – pesche Dec 29 '10 at 23:06

4 Answers4

6

You can specify a stop revision with -r for clone, as others have suggested. Another option (if you kept the clone where things crashed) would be to just run hg pull in the trunk_hg copy. You might have to edit/create .hg/hgrc yourself to add the [paths]\n default = svn+https://my.reposit.ory/trunk, since I think we add that at the end of the cloning process. Maybe run hg svn rebuildmeta before your pull just for good measure in case the tracking metadata for hgsubversion got hosed when the OOM happened.

I hope this helps!

durin42
  • 1,447
  • 8
  • 10
  • 1
    Stupid me! Didn't realise that `-r` specifies a stop revision, not a range of changesets. Now it works. `hg clone --startrev 8890 -r 10000 ...` initialised the repo and subsequent `hg pull -r xxxx` let me add the remaining subversion revisions. – pesche Dec 22 '10 at 15:47
  • Unfortunately a `pull` after the OOM doesn't work, as the repo retrieved so far gets automatically deleted after the abort. – pesche Dec 22 '10 at 15:49
  • At the end of every `pull` an abort message appears: `pulled xxx revisions \n abort: 00changelog.i@11000: no node!`. Any explications for this? It seems not to be a problem, as I can continue to pull. – pesche Dec 22 '10 at 15:54
  • No, I've never observed that error here. If it's harmless, I guess I'd just suggest ignoring it. – durin42 Dec 24 '10 at 18:09
  • Doesn't work for me: `hg pull -r 4951` → `** Unknown exception encountered with possibly-broken third-party extension hgsubversion` ... `ValueError: 20-byte hash required`. – Tom Anderson Oct 23 '12 at 17:58
1

http://www.selenic.com/mercurial/hg.1.html#clone

Could try using the -r <revid> flag to clone only a particular changeset. Though that may or may not work with hgsvn.

Amber
  • 507,862
  • 82
  • 626
  • 550
  • When i specify `-r 8890:20000`, I get the error `unrecognised Subversion revision 8890:20000: only numbers work.` – pesche Dec 21 '10 at 20:34
1

Cloning with a limited range of revisions and then pulling is the recommended method and I can confirm that it works flawlessly for svn repositories in the several GB size range.

RandomSF
  • 106
  • 2
0

Here is a workaround to clone the whole svn repo:

  1. start cloning
  2. abort it immediately (Ctrl+C in windows)
  3. than hg pull
  4. you've got out of memory
  5. repeat step 3 until you check out all commits
Abin Manathoor Devasia
  • 1,945
  • 2
  • 21
  • 47
user2031839
  • 461
  • 4
  • 3