Pushing to git fails with dulwich 0.21.x.
The release notes of dulwich 0.21.0 mention some significant refactoring, which seems to have caused an issue with hg-git when trying to push to a git repository. Minimal script for reproduction, if necessary:
git init --bare gitrepo
hg init hgrepo
cd hgrepo
touch test
hg add test
hg ci -m "Test"
hg push ../gitrepo
This results in the following error:
pushing to ../gitrepo
searching for changes
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.10.9 (main, Dec 08 2022, 14:49:06) [GCC]
** Mercurial Distributed SCM (version 6.3.2)
** Extensions loaded: absorb, churn, evolve 10.5.3, extdiff, graphlog, hggit 1.0.1 (dulwich 0.21.2), histedit, purge, rebase, record, strip, topic 0.24.2
Traceback (most recent call last):
File "/usr/bin/hg", line 59, in <module>
dispatch.run()
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 143, in run
status = dispatch(req)
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 232, in dispatch
status = _rundispatch(req)
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 276, in _rundispatch
ret = _runcatch(req) or 0
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 451, in _runcatch
return _callcatch(ui, _runcatchfunc)
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 461, in _callcatch
return scmutil.callcatch(ui, func)
File "/usr/lib64/python3.10/site-packages/mercurial/scmutil.py", line 153, in callcatch
return func()
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 441, in _runcatchfunc
return _dispatch(req)
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 1265, in _dispatch
return runcommand(
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 899, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 1277, in _runcommand
return cmdfunc()
File "/usr/lib64/python3.10/site-packages/mercurial/dispatch.py", line 1263, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "/usr/lib64/python3.10/site-packages/mercurial/util.py", line 1880, in check
return func(*args, **kwargs)
File "/usr/lib64/python3.10/site-packages/mercurial/util.py", line 1880, in check
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/hgext3rd/topic/__init__.py", line 1357, in pushoutgoingwrap
return orig(ui, repo, *args, **opts)
File "/usr/lib64/python3.10/site-packages/mercurial/util.py", line 1880, in check
return func(*args, **kwargs)
File "/usr/lib64/python3.10/site-packages/mercurial/util.py", line 1880, in check
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/hgext3rd/topic/flow.py", line 94, in wrappush
return orig(repo, remote, *args, **newargs)
File "/usr/lib64/python3.10/site-packages/mercurial/util.py", line 1880, in check
return func(*args, **kwargs)
File "/usr/lib64/python3.10/site-packages/mercurial/commands.py", line 5820, in push
pushop = exchange.push(
File "/usr/lib/python3.10/site-packages/hggit/util.py", line 95, in inner
return f(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/hggit/gitrepo.py", line 228, in exchangepush
pushop.cgresult = repo.githandler.push(remote.path, revs, force)
File "/usr/lib/python3.10/site-packages/hggit/git_handler.py", line 483, in push
old_refs, new_refs = self.upload_pack(remote, revs, force)
File "/usr/lib/python3.10/site-packages/hggit/git_handler.py", line 1404, in upload_pack
new_refs = self._call_client(
File "/usr/lib/python3.10/site-packages/hggit/git_handler.py", line 1577, in _call_client
ret = func(path, *args, **kwargs)
File "/usr/lib64/python3.10/site-packages/dulwich/client.py", line 1108, in send_pack
pack_data_count, pack_data = generate_pack_data(
File "/usr/lib/python3.10/site-packages/hggit/git_handler.py", line 1375, in genpack
missing = self.git.object_store.find_missing_objects(
AttributeError: 'DiskObjectStore' object has no attribute 'find_missing_objects'