Support hg 6.2 and Python 3
For https://foss.heptapod.net/mercurial/mercurial-jupyterbook, I tried to use docgraph but I got this traceback:
$ hg docgraph
** Unknown exception encountered with possibly-broken third-party extension "docgraph" (version N/A)
** which supports versions unknown of Mercurial.
** Please disable "docgraph" and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0]
** Mercurial Distributed SCM (version 6.2.1)
** Extensions loaded: absorb, churn, docgraph, evolve 10.5.2, extdiff, graphlog, hggit 1.1.0.dev35+he974b9f (dulwich 0.20.45), purge, rebase, topic 0.24.1
Traceback (most recent call last):
File "/data0/opt/mambaforge/condabin/app/hg", line 59, in <module>
dispatch.run()
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 143, in run
status = dispatch(req)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 232, in dispatch
status = _rundispatch(req)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 276, in _rundispatch
ret = _runcatch(req) or 0
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 451, in _runcatch
return _callcatch(ui, _runcatchfunc)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 461, in _callcatch
return scmutil.callcatch(ui, func)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/scmutil.py", line 153, in callcatch
return func()
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 441, in _runcatchfunc
return _dispatch(req)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 1254, in _dispatch
return runcommand(
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 899, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 1266, in _runcommand
return cmdfunc()
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/dispatch.py", line 1252, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/util.py", line 1880, in check
return func(*args, **kwargs)
File "/home/pierre/Dev/hg-docgraph/hgext3rd/docgraph.py", line 110, in docgraph
revs = scmutil.revrange(repo, revs)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/scmutil.py", line 769, in revrange
return repo.anyrevs(allspecs, user=True, localalias=localalias)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/localrepo.py", line 2026, in anyrevs
m = revset.matchany(
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/revset.py", line 2769, in matchany
tree = revsetlang.parse(specs[0], lookup)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/revsetlang.py", line 649, in parse
return _parsewith(spec, lookup=lookup)
File "/data0/opt/mambaforge/envs/_env_mercurial/lib/python3.10/site-packages/mercurial/revsetlang.py", line 577, in _parsewith
if lookup and spec.startswith(b'revset(') and spec.endswith(b')'):
TypeError: startswith first arg must be str or a tuple of str, not bytes
Would it be possible to adapt docgraph for hg 6.2 and Python 3?