Issue #368 wontfix

Error pulling a specific revision - "20-byte hash required"

Tom Anderson
created an issue

I am attempting to clone a rather huge repository. In order to avoid running out of memory, i would like to pull in small batches of changes. I thought i'd do something like:

while true; do hg pull -r $(($(hg identify -r tip -n) + 1)); done

To pull one revision at a time (for some value of one). However, any attempt to use hg pull -r <number> elicits an exception:

$ hg pull -r 4951
pulling from http://srcctrl.youdevise.com/opt/repo/projects/TIM
no changes found
** Unknown exception encountered with possibly-broken third-party extension hgsubversion
** which supports versions unknown of Mercurial.
** Please disable hgsubversion and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.1+ (r271:86832, Sep 27 2012, 21:12:17) [GCC 4.5.2]
** Mercurial Distributed SCM (version 2.3+30-b0aad9fb87f9)
** Extensions loaded: graphlog, hgsubversion, mq, rebase, purge
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 65, in dispatch
    return _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 88, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 740, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 514, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 830, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 801, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 737, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 144, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3528, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 144, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/opt/hgsubversion/hgsubversion/wrappers.py", line 605, in generic
    return orig(ui, repo, *args, **opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 144, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/rebase.py", line 700, in pullrebase
    orig(ui, repo, *args, **opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 471, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 4617, in pull
    checkout = str(repo.changelog.rev(other.lookup(checkout)))
  File "/usr/lib/python2.7/dist-packages/mercurial/revlog.py", line 281, in rev
    return self._nodecache[node]
ValueError: 20-byte hash required

I tried --stupid, but this made no difference.

hgsubversion 64d961130a07 (today's tip), Mercurial 2.3+30-b0aad9fb87f9, SubvertPy 0.7.5-1, Python 2.7.1+, Ubuntu 11.04 Natty.

Comments (6)

  1. Tom Anderson reporter

    Might it be possible to document this, or to change the error message to be a bit clearer?

    Am i right in thinking that -r is still valid with a hg clone from a Subversion repo?

  2. Log in to comment