TypeError unexpected keyword argument 'intents'

Issue #244 new
Jason R. Coombs
created an issue

Running with the latest hg-git on Mercurial 4.6, I get this error trying to push to a git repo:

pymake default, feature/modernize-py3 $ hg push gh://jaraco/pymake.git
pushing to gh://jaraco/pymake.git
** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions 4.5 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.15 (default, May  6 2018, 17:35:41) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]
** Mercurial Distributed SCM (version 4.6)
** Extensions loaded: schemes, hggit
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 41, in <module>
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 90, in run
    status = (dispatch(req) or 0)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 210, in dispatch
    ret = _runcatch(req)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 351, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 359, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/scmutil.py", line 160, in callcatch
    return func()
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 341, in _runcatchfunc
    return _dispatch(req)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 971, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 727, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 979, in _runcommand
    return cmdfunc()
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/dispatch.py", line 968, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/util.py", line 1553, in check
    return func(*args, **kwargs)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/commands.py", line 4181, in push
    other = hg.peer(repo, opts, dest)
  File "/Users/jaraco/.hgext/hg-git/hggit/__init__.py", line 353, in peer
    newpeer = orig(uiorrepo, *args, **opts)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/hg.py", line 189, in peer
    return _peerorrepo(rui, path, create, intents=intents).peer()
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/mercurial/hg.py", line 163, in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create, intents=intents)
  File "/usr/local/Cellar/mercurial/4.6/lib/python2.7/site-packages/hgext/schemes.py", line 83, in instance
    return hg._peerlookup(url).instance(ui, url, create, intents=intents)
TypeError: __init__() got an unexpected keyword argument 'intents'

At the point of the error:

(Pdb) hg._peerlookup(url)
<proxied module 'gitrepo'>
(Pdb) hg._peerlookup(url).instance
<class 'hgext_hggit.gitrepo.gitrepo'>

Comments (13)

  1. Omnifarious

    I just had this happen too. From what I can tell, this is part of the repository capability negotiation code in Mercurial. It's trying to figure out what the destination repository is capable of. I'm wondering if fiddling with some kind of option in the global config will turn off it's attempt to determine if the repo is capable of 'ofs_delta'.

  2. Omnifarious

    Oh, researching further, this isn't the problem. Apparently this problem is with the dulwich library and there's a patch on the hg-git Google Group/mailing list.

  3. Tom Prince

    Looks like there are further issues:

      File "/home/tomprince/.local/lib/python2.7/site-packages/hggit/git_handler.py", line 1193, in get_changed_refs
        raise hgutil.Abort("pushing %s overwrites %s"
  4. Tuomo Valkonen

    Any updates on this? Installing an old version of mercurial on MacOS seems extremely complicated. (Does not seem to be supported by homebrew anymore without downloading the whole git history on the local machine to extract the old formula (GitHub chokes up), and 4.5 also not provided as a package from the website.)

  5. Log in to comment