TypeError: exchangepush() got an unexpected keyword argument 'opargs'

Issue #87 resolved
Anonymous created an issue

Got the following error while trying to push my repo:

** Unknown exception encountered with possibly-broken third-party extension hgflow
** which supports versions unknown of Mercurial.
** Please disable hgflow and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
** Mercurial Distributed SCM (version 3.7.3)
** Extensions loaded: convert, graphlog, purge, record, strip, mq, rebase, shelve, gpg, hgflow, hggit, extdiff
Traceback (most recent call last):
  File "/usr/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 54, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 120, in dispatch
    ret = _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 191, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 924, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1055, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1015, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 921, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 993, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 993, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3517, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 993, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 5739, in push
    opargs=opts.get('opargs'))
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/home/kenn/local/hgext/hg-git/hggit/util.py", line 48, in inner
    return f(*args, **kwargs)
TypeError: exchangepush() got an unexpected keyword argument 'opargs'

I'm on Python 2.7.12 and Mercurial 3.7.3 on Ubuntu 16.04. I tried using several other versions of hgflow, but they all show the same error.

Comments (13)

  1. Kenneth Jørgensen

    I simply executed hg push on one of my repos. It doesn't appear to happen when I run something like hg flow feature start ....

    Not a Python programmer myself, but from the looks of the stack trace this happens during initialisation. Could it be a version mismatch with Python or Mercurial perhaps?

    I found a similar bug for hggit: https://bitbucket.org/tortoisehg/thg/issues/4369/typeerror-exchangepush-got-an-unexpected where the fix was to update hggit, but I'm already at the latest version of hg flow, running off the develop branch. I also tried switching to various version tags, but no luck.

  2. Amilcar Benitez

    I have a similar isuue with hg flow. But, hg flow feature start ... works for me (on Ubuntu 14.04 with Mercurial 4.3.1).

    I attach the error below

    flow: Currently open branches:
    ---------------------------- ['__bool__', '__class__', '__contains__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__len__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_activebookmark', '_afterlock', '_applyopenerreqs', '_basesupported', '_bookmarks', '_buildcacheupdater', '_checknested', '_clcache', '_clcachekey', '_constructmanifest', '_currentlock', '_decodefilterpats', '_dirstatevalidate', '_encodefilterpats', '_filecommit', '_filter', '_findtags', '_getsvfsward', '_getvfsward', '_journalfiles', '_loadextensions', '_loadfilter', '_lock', '_phasecache', '_refreshfilecachestats', '_restrictcapabilities', '_rollback', '_tagscache', '_unfilteredrepo', '_wlockchecktransaction', '_wlockfreeprefix', '_writecaches', '_writejournal', '_writerequirements', 'adddatafilter', 'addpostdsstatus', 'anyrevs', 'between', 'branches', 'branchheads', 'branchmap', 'branchtip', 'cancopy', 'changectx', 'changelog', 'checkcommitpatterns', 'checkpush', 'clearpostdsstatus', 'close', 'commit', 'commitctx', 'currenttransaction', 'currentwlock', 'debugwireargs', 'destroyed', 'destroying', 'dirstate', 'featuresetupfuncs', 'file', 'filectx', 'filtered', 'filtername', 'getcwd', 'heads', 'hook', 'invalidate', 'invalidateall', 'invalidatecaches', 'invalidatedirstate', 'invalidatevolatilesets', 'known', 'listkeys', 'local', 'lock', 'lookup', 'lookupbranch', 'manifestlog', 'nodebookmarks', 'nodetags', 'obsstore', 'openerreqs', 'pathto', 'peer', 'postdsstatus', 'prepushoutgoinghooks', 'publishing', 'pushkey', 'recover', 'revbranchcache', 'revs', 'rollback', 'savecommitmessage', 'set', 'setparents', 'shared', 'status', 'supportedformats', 'tags', 'tagslist', 'tagtype', 'transaction', 'undofiles', 'unfiltered', 'updatecaches', 'url', 'walk', 'wjoin', 'wlock', 'wread', 'wwrite', 'wwritedata']
    flow: <master> : ** Unknown exception encountered with possibly-broken third-party extension flow
    ** which supports versions unknown of Mercurial.
    ** Please disable flow and try your action again.
    ** If that fixes the bug please report it to the extension author.
    ** Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
    ** Mercurial Distributed SCM (version 4.3.1)
    ** Extensions loaded: flow, extdiff
    Traceback (most recent call last):
      File "/home/myuser/bin/hg", line 45, in <module>
        mercurial.dispatch.run()
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 81, in run
        status = (dispatch(req) or 0) & 255
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 162, in dispatch
        ret = _runcatch(req)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 302, in _runcatch
        return _callcatch(ui, _runcatchfunc)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 310, in _callcatch
        return scmutil.callcatch(ui, func)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/scmutil.py", line 150, in callcatch
        return func()
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 292, in _runcatchfunc
        return _dispatch(req)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 896, in _dispatch
        cmdpats, cmdoptions)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 658, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 904, in _runcommand
        return cmdfunc()
      File "/home/myuser/lib/python2.7/site-packages/mercurial/dispatch.py", line 893, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
      File "/home/myuser/lib/python2.7/site-packages/mercurial/util.py", line 1077, in check
        return func(*args, **kwargs)
      File "/home/myuser/hgext/hgflow.py", line 2450, in flow
        func( *arg, **kwarg )
      File "/home/myuser/hgext/hgflow.py", line 2107, in print_open_branches
        marker  = "#" if (self._is_shelved( trunk )) else ""
      File "/home/myuser/hgext/hgflow.py", line 1194, in _is_shelved
        patch_fname = self.repo.join( "patches/" + shelve_name )
      File "/home/myuser/lib/python2.7/site-packages/mercurial/repoview.py", line 239, in __getattr__
        return getattr(self._unfilteredrepo, attr)
    AttributeError: 'localrepository' object has no attribute 'join'
    
  3. Sebastian Schawohl

    Same issue here, but different version of Python.

    ** Python 2.7.13 (default, Jul 19 2017, 09:20:37) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
    ** Mercurial Distributed SCM (version 4.3.1)
    

    I got this message with hg flow, hg push (commits are pushed).

  4. Yujie Wu repo owner

    Guys, Thanks for reporting. I believe this compatibility problem has been fixed now. Please feel free to try the hgflow.py extension code in the develop. Thanks a lot to Frederic De Groef for the PR that fixed this problem and also improved the testings.

  5. Log in to comment