schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 71 forks source link

TypeError: Tree.iteritems() did not return a list #273

Closed sthomen closed 10 years ago

sthomen commented 10 years ago

I keep getting this. Would I need to downgrade to mercurial 2.3?

knightrider% hg clone git://github.com/schacon/hg-git.git 
destination directory: hg-git
Reusing existing pack: 3319, done.
Total 3319 (delta 0), reused 0 (delta 0)
importing git objects into hg
** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions 2.3.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.5 (default, Dec  1 2013, 22:34:35) [GCC 4.1.3 20080704 prerelease (NetBSD nb2 20081120)]
** Mercurial Distributed SCM (version 2.7.1)
** Extensions loaded: graphlog, hggit
Traceback (most recent call last):
  File "/usr/pkg/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 69, in dispatch
    ret = _runcatch(req)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 97, in _runcatch
    return _dispatch(req)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 778, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 549, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 869, in _runcommand
    return checkargs()
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 840, in checkargs
    return cmdfunc()
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 775, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/util.py", line 506, in check
    return func(*args, **kwargs)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/commands.py", line 1281, in clone
    branch=opts.get('branch'))
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/hg.py", line 372, in clone
    destpeer.local().clone(srcpeer, heads=revs, stream=stream)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/localrepo.py", line 2398, in clone
    return self.pull(remote, heads)
  File "/home/duck/hg-git/hggit/hgrepo.py", line 14, in pull
    return git.fetch(remote.path, heads)
  File "/home/duck/hg-git/hggit/git_handler.py", line 210, in fetch
    self.import_git_objects(remote_name, refs)
  File "/home/duck/hg-git/hggit/git_handler.py", line 645, in import_git_objects
    self.import_git_commit(commit)
  File "/home/duck/hg-git/hggit/git_handler.py", line 679, in import_git_commit
    files = self.get_files_changed(commit)
  File "/home/duck/hg-git/hggit/git_handler.py", line 1237, in get_files_changed
    for (oldfile, newfile), (oldmode, newmode), (oldsha, newsha) in changes:
  File "/usr/pkg/lib/python2.7/site-packages/dulwich-0.9.4-py2.7-netbsd-5.1_STABLE-alpha.egg/dulwich/object_store.py", line 145, in tree_changes
    want_unchanged=want_unchanged):
  File "/usr/pkg/lib/python2.7/site-packages/dulwich-0.9.4-py2.7-netbsd-5.1_STABLE-alpha.egg/dulwich/diff_tree.py", line 183, in tree_changes
    for entry1, entry2 in entries:
  File "/usr/pkg/lib/python2.7/site-packages/dulwich-0.9.4-py2.7-netbsd-5.1_STABLE-alpha.egg/dulwich/diff_tree.py", line 151, in walk_trees
    todo.extend(reversed(_merge_entries(path, tree1, tree2)))
TypeError: Tree.iteritems() did not return a list
durin42 commented 10 years ago

More data required: version of dulwich, version of hg-git.

My guess is upgrading dulwich and hg-git to the latest version will fix your problem.

sthomen commented 10 years ago

As the filenames in the trackback indicates, this is with dulwich 0.9.4 (0.8.7 had the same effect) hg-git was the latest (615:503d403fc040) from http://bitbucket.org/durin42/hg-git. I just tried it with the latest from github and got the exact same thing.

durin42 commented 10 years ago

Try upgrading to hg 2.8.x, that may help - the testsuite passes here for me against hg 2.8.x. Other than that, I don't know what to tell you.

sthomen commented 10 years ago

Looks like I get exactly the same thing with mercurial 2.8.1. I tried with a completely clear .hgrc as well, with the same results.