felipec / git-remote-hg

Transparent bidirectional bridge between Git and Mercurial for Git
GNU General Public License v2.0
369 stars 87 forks source link

Mercurial 4.0 - TypeError: getchangegroup() got an unexpected keyword argument 'heads' #66

Closed alexbarton closed 5 years ago

alexbarton commented 8 years ago

I get the following error when calling git push origin master:

$ git push origin master
searching for changes
no changes found
searching for changes
Traceback (most recent call last):
  File "/usr/local/bin/git-remote-hg", line 1356, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/git-remote-hg", line 1342, in main
    do_export(parser)
  File "/usr/local/bin/git-remote-hg", line 1219, in do_export
    if not push(parser.repo, peer, parsed_refs, p_revs):
  File "/usr/local/bin/git-remote-hg", line 1107, in push
    ret = push_unsafe(repo, remote, parsed_refs, p_revs)
  File "/usr/local/bin/git-remote-hg", line 1072, in push_unsafe
    cg = changegroup.getchangegroup(repo, 'push', heads=list(p_revs), common=common)
TypeError: getchangegroup() got an unexpected keyword argument 'heads'
To hg::ssh://…@…//srv/git/… f9a4099..2ce01fe  master -> master
error: failed to push some refs to 'hg::ssh://…@…//srv/git/…'
$ 

System is OS X 10.11, Mercurial 4.0 installed by Homebrew, which has been updated to version 4.0 (from 3.9.2, which worked for me) yesterday. So most probably it is Mercurial 4.0 that breaks git-remote-hg, I think?

alexbarton commented 8 years ago

I downgraded Mercurial to version 3.9.2, and it works again. So I think Mercurial 4 is indeed to blame …

nengxu commented 8 years ago

I encountered the same issue. Fixed by downgrading. However, it also means that git-remote-hg needs to be updated to accommodate Hg's changes.

mnauw commented 8 years ago

Commit mentioned above updates git-remote-hg to accommodate changes in Mercurial 4. Note that it is applied on another master that is now quite ahead of this repo's master and contains many other fixes and enhancements.

nengxu commented 8 years ago

@mnauw Just tried your branch. Worked like a charm! Thanks.

jfelixetcetera commented 7 years ago

@mnauw please create a pull request for that change so it can be merged in! Getting this same issue...

felipec commented 5 years ago

This should be fixed in v0.4. The commit is different though: ed5a70706aa80151d1e5fce6bad614e942e91bb2.