AttributeError: 'DiskObjectStore' object has no attribute 'find_missing_objects'

47 views
Skip to first unread message

Ben

unread,
Jan 25, 2023, 3:47:09 AM1/25/23
to hg-git
Hello everyone,

I am trying to convert a Mercurial repository to Git using hg-git and I am getting the following error from hg-git: AttributeError: 'DiskObjectStore' object has no attribute 'find_missing_objects'.

Here is what I am doing:
mkdir GitRepo
cd GitRepo
git init --bare
cd ../HgRepo
hg bookmarks hg
hg push ../GitRepo

After a while, hg-git fails with the following error stack:
Traceback (most recent call last):
  File "/usr/bin/hg", line 43, in <module>
    dispatch.run()
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 113, in run
    status = dispatch(req)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 303, in dispatch
    ret = _runcatch(req) or 0
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 479, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 488, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/usr/lib/python3/dist-packages/mercurial/scmutil.py", line 153, in callcatch
    return func()
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 469, in _runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1232, in _dispatch
    return runcommand(
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 917, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1244, in _runcommand
    return cmdfunc()
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1230, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/hgext/largefiles/overrides.py", line 1016, in overridepush
    return orig(ui, repo, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/mercurial/commands.py", line 5532, in push
    pushop = exchange.push(
  File "/home/bpe/.hgext/hg-git/hggit/util.py", line 96, in inner
    return f(*args, **kwargs)
  File "/home/bpe/.hgext/hg-git/hggit/gitrepo.py", line 229, in exchangepush
    pushop.cgresult = repo.githandler.push(
  File "/home/bpe/.hgext/hg-git/hggit/git_handler.py", line 500, in push
    old_refs, new_refs = self.upload_pack(remote, revs, bookmarks, force)
  File "/home/bpe/.hgext/hg-git/hggit/git_handler.py", line 1448, in upload_pack
    new_refs = self._call_client(
  File "/home/bpe/.hgext/hg-git/hggit/git_handler.py", line 1637, in _call_client
    ret = func(path, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/dulwich/client.py", line 1108, in send_pack
    pack_data_count, pack_data = generate_pack_data(
  File "/home/bpe/.hgext/hg-git/hggit/git_handler.py", line 1419, in genpack
    missing = self.git.object_store.find_missing_objects(
AttributeError: 'DiskObjectStore' object has no attribute 'find_missing_objects'

Could you help me?

Here are the versions I am using:
Debian 11.6
HG 5.6.1
Git 2.30.2
Python 3.9.2
dulwich python module 0.21.2

Thanks in advance

Ben

Jelmer Vernooij

unread,
Jan 27, 2023, 10:16:59 AM1/27/23
to hg-...@googlegroups.com
Sorry, this must be a regression due to the API changes we made to the lower
level pack operations in Dulwich (as part of a general drive to significantly
improve performance) :-/

If it's just this method that hg-git needs, we could probably introduce a
compatibility wrapper in 0.21.3.

Cheers,

Jelmer

Jelmer Vernooij

unread,
Jan 27, 2023, 10:16:59 AM1/27/23
to hg-...@googlegroups.com
As a workaround, you should be able to downgrade Dulwich to 0.20.X.

Cheers,

Jelmer

Marc Tamsky

unread,
Mar 2, 2023, 4:30:04 PM3/2/23
to hg-git
> As a workaround, you should be able to downgrade Dulwich to 0.20.X.

Thank you for this suggestion.

This fixed it for me:
pip3 uninstall dulwich
pip3 install dulwich==0.20.50

 I was seeing this error as well with dulwich==0.21.3
Reply all
Reply to author
Forward
0 new messages