Traceback after pushing repeatedly amended draft commit


set -v
# Create repo 'test' via web ui at https://hg.sr.ht/create

# Enable non-publishing / evolve in settings -> features

hg clone ssh://hg@hg.sr.ht/~SR_HT_USER/test
cd test

# An initial commit to avoid "repo is unrelated" when pushing amended commit

echo 1 > file
hg ci -A -m initial

# Another commit which we'll amend some

echo 2 > file
hg ci -m change
hg push

# Amend and push once

echo 3 > file
hg amend
hg push

# Amend and push again

echo 4 > file
hg amend
hg push

# And now it's broken?

hg push
hg pull

Last command(s) produce a traceback like:

pushing to ssh://hg@hg.sr.ht/~zash/test
searching for changes
remote: ** Unknown exception encountered with possibly-broken third-party extension srht
remote: ** which supports versions unknown of Mercurial.
remote: ** Please disable srht and try your action again.
remote: ** If that fixes the bug please report it to the extension author.
remote: ** Python 2.7.16 (default, May  6 2019, 19:35:26) [GCC 8.3.0]
remote: ** Mercurial Distributed SCM (version 4.9.1)
remote: ** Extensions loaded: srht, clonebundles, strip, evolve.serveronly
remote: Traceback (most recent call last):
remote:   File "/usr/bin/hg-ssh", line 97, in <module>
remote:     main()
remote:   File "/usr/bin/hg-ssh", line 82, in main
remote:     dispatch.dispatch(req)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 225, in dispatch
remote:     ret = _runcatch(req) or 0
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 376, in _runcatch
remote:     return _callcatch(ui, _runcatchfunc)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 384, in _callcatch
remote:     return scmutil.callcatch(ui, func)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/scmutil.py", line 165, in callcatch
remote:     return func()
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 367, in _runcatchfunc
remote:     return _dispatch(req)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 1021, in _dispatch
remote:     cmdpats, cmdoptions)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 756, in runcommand
remote:     ret = _runcommand(ui, options, cmd, d)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 1030, in _runcommand
remote:     return cmdfunc()
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 1018, in <lambda>
remote:     d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1670, in check
remote:     return func(*args, **kwargs)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/commands.py", line 5270, in serve
remote:     s.serve_forever()
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotoserver.py", line 794, in serve_forever
remote:     self.serveuntil(threading.Event())
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotoserver.py", line 800, in serveuntil
remote:     _runsshserver(self._ui, self._repo, self._fin, self._fout, ev)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotoserver.py", line 655, in _runsshserver
remote:     rsp = wireprotov1server.dispatch(repo, proto, request)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotov1server.py", line 74, in dispatch
remote:     return func(repo, proto, *args)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obsdiscovery.py", line 778, in srv_obshashrange_v1
remote:     hashes = _obshashrange_v0(repo, ranges)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obsdiscovery.py", line 736, in _obshashrange_v0
remote:     repo.obsstore.rangeobshashcache.update(repo)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obscache.py", line 175, in update
remote:     upgrade = self._upgradeneeded(repo)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obscache.py", line 279, in _upgradeneeded
remote:     markers = markersfrom(obsstore, keyobssize, keyobslength)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obscache.py", line 90, in markersfrom
remote:     return obsolete._readmarkers(obsdata, byteoffset)[1]
remote:   File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1621, in wrapper
remote:     return func(*args, **kwargs)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/obsolete.py", line 475, in _readmarkers
remote:     return diskversion, formats[diskversion][0](data, off, stop)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/obsolete.py", line 454, in _fm1readmarkers
remote:     return native(data, off, stop)
remote: ValueError: overflow in obsstore
abort: unexpected response: empty string

Local version of hg & evolve:

$ hg version -v
Mercurial Distributed SCM (version 5.0)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2019 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO

Enabled extensions:

  evolve  external  8.5.1
Assigned to
1 year, 4 months ago
1 year, 1 month ago
No labels applied.

~ludovicchabant 1 year, 4 months ago

Looks like this has corrupted the repo on the server :(

I added some code path to handle that so that you can delete the repo and re-create it or something. In the meantime we'll have to wait for marmoute to figure out a fix for evolve.

~ludovicchabant REPORTED FIXED 1 year, 2 months ago

We have a hot fix in place to fix this (has been in prod for a few weeks) but now mercurial 5.0.2 has the proper fix and will be deployed soon.

~zash 1 year, 1 month ago

~ludovicchabant 1 year, 1 month ago

Yep we have mercurial 5.1 live on sourcehut now.

Register here or Log in to comment, or comment via email.