Issue #112 resolved

hg-git not playing nice with hg 3.0?

kharlamov
created an issue

On OSX 10.9.2, Python 2.76. Doing an hg clone (where the source is a local git repo) with hg 3.0 and hg-git 0.5.0 chokes with the following:

Counting objects: 58772, done.
Total 58772 (delta 48607), reused 58455 (delta 48352)
** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions 2.8.1 of Mercurial.
** Please disable hggit and try your action again.
** If that fixes the bug please report it to https://bitbucket.org/durin42/hg-git/issues
** Python 2.7.6 (default, Apr 26 2014, 17:02:06) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
** Mercurial Distributed SCM (version 3.0)
** Extensions loaded: hggit, pager, color, progress, record
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 5, in <module>
    pkg_resources.run_script('mercurial==3.0', 'hg')
  File "/usr/local/lib/python2.7/site-packages/setuptools-3.6-py2.7.egg/pkg_resources.py", line 534, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python2.7/site-packages/setuptools-3.6-py2.7.egg/pkg_resources.py", line 1434, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 69, in dispatch
    ret = _runcatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 138, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 810, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 590, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/hgext/color.py", line 431, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/hgext/pager.py", line 138, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 901, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 872, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/dispatch.py", line 807, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/util.py", line 518, in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/commands.py", line 1298, in clone
    branch=opts.get('branch'))
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/hg.py", line 400, in clone
    destpeer.local().clone(srcpeer, heads=revs, stream=stream)
  File "/usr/local/lib/python2.7/site-packages/mercurial-3.0-py2.7-macosx-10.9-x86_64.egg/mercurial/localrepo.py", line 1860, in clone
    return self.pull(remote, heads)
  File "/usr/local/lib/python2.7/site-packages/hg_git-0.5.0-py2.7.egg/hggit/hgrepo.py", line 14, in pull
    return git.fetch(remote.path, heads)
  File "/usr/local/lib/python2.7/site-packages/hg_git-0.5.0-py2.7.egg/hggit/git_handler.py", line 210, in fetch
    self.import_git_objects(remote_name, refs)
  File "/usr/local/lib/python2.7/site-packages/hg_git-0.5.0-py2.7.egg/hggit/git_handler.py", line 636, in import_git_objects
    convert_list, commits = self.getnewgitcommits(refs)
  File "/usr/local/lib/python2.7/site-packages/hg_git-0.5.0-py2.7.egg/hggit/git_handler.py", line 596, in getnewgitcommits
    if sha in self.git.object_store:
  File "/usr/local/lib/python2.7/site-packages/dulwich-0.9.6-py2.7-macosx-10.9-x86_64.egg/dulwich/object_store.py", line 275, in __contains__
    if self.contains_packed(sha) or self.contains_loose(sha):
  File "/usr/local/lib/python2.7/site-packages/dulwich-0.9.6-py2.7-macosx-10.9-x86_64.egg/dulwich/object_store.py", line 266, in contains_packed
    if sha in pack:
  File "/usr/local/lib/python2.7/site-packages/dulwich-0.9.6-py2.7-macosx-10.9-x86_64.egg/dulwich/pack.py", line 1849, in __contains__
    self.index.object_index(sha1)
  File "/usr/local/lib/python2.7/site-packages/dulwich-0.9.6-py2.7-macosx-10.9-x86_64.egg/dulwich/pack.py", line 385, in object_index
    return self._object_index(sha)
  File "/usr/local/lib/python2.7/site-packages/dulwich-0.9.6-py2.7-macosx-10.9-x86_64.egg/dulwich/pack.py", line 556, in _object_index
    assert len(sha) == 20
AssertionError

Comments (3)

  1. kharlamov reporter

    Don't know if this helps or not, but I tried the same command using dulwich clone instead of hg clone, and I got this:

    fatal: git upload-pack: protocol error, expected to get sha, not 'want shallow'
    
  2. Log in to comment