Crash on trivial subrepositories
Pushing a subrepository with a
subrepo = ../subrepo
mapping worked fine. I changed it to the supposedly better trivial mapping with a translation to the flat server structure in .hgsub
:
subrepo = subrepo
[subpaths]
(.*)://(.*)/group/mainrepo/subrepo = \1://\2/group/subrepo
(UPDATE: It doesn't help doing (.*)/group/mainrepo/subrepo = \1/group/subrepo
without the URL matching component.)
This works fine testing with hg out --subrepos
, but pushing to the Heptapod server causes a crash on the server:
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: Traceback (most recent call last):
remote: File "/opt/gitlab/bin/hg", line 43, in <module>
remote: dispatch.run()
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 111, in run
remote: status = dispatch(req)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 254, in dispatch
remote: ret = _runcatch(req) or 0
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 428, in _runcatch
remote: return _callcatch(ui, _runcatchfunc)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 437, in _callcatch
remote: return scmutil.callcatch(ui, func)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/scmutil.py", line 152, in callcatch
remote: return func()
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 418, in _runcatchfunc
remote: return _dispatch(req)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1182, in _dispatch
remote: lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 866, in runcommand
remote: ret = _runcommand(ui, options, cmd, d)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1193, in _runcommand
remote: return cmdfunc()
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1179, in <lambda>
remote: d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 1854, in check
remote: return func(*args, **kwargs)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/commands.py", line 6494, in serve
remote: s.serve_forever()
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 852, in serve_forever
remote: self.serveuntil(threading.Event())
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 858, in serveuntil
remote: _runsshserver(self._ui, self._repo, self._fin, self._fout, ev)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 700, in _runsshserver
remote: rsp = wireprotov1server.dispatch(repo, proto, request)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/wireprotov1server.py", line 82, in dispatch
remote: return func(repo, proto, *args)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/wireprotov1server.py", line 664, in unbundle
remote: repo, gen, their_heads, b'serve', proto.client()
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/exchange.py", line 2792, in unbundle
remote: lockandtr[2].close()
remote: File "/usr/local/lib/python2.7/dist-packages/hgext3rd/topic/__init__.py", line 536, in close
remote: origclose()
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/transaction.py", line 46, in _active
py", line 186, in validator
remote: return oldvalidator(tr)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 2187, in validate
remote: b'pretxnclose', throw=True, **pycompat.strkwargs(tr.hookargs)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1747, in hook
remote: return hook.hook(self.ui, self, name, throw, **args)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 255, in hook
remote: res = runhooks(ui, repo, htype, hooks, throw=throw, **args)
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 308, in runhooks
remote: ui, repo, htype, hname, hookfn, args, throw
remote: File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 115, in pythonhook
remote: r = obj(ui=ui, repo=repo, hooktype=htype, **pycompat.strkwargs(args))
remote: File "/opt/gitlab/embedded/service/py-heptapod/heptapod/hooks/gitlab_mirror.py", line 13, in mirror
remote: gitlab_mirror(ui, repo)
remote: File "/opt/gitlab/embedded/service/py-heptapod/hgext3rd/heptapod/__init__.py", line 118, in gitlab_mirror
remote: git.HeptapodGitHandler(repo, repo.ui).export_commits()
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/git_handler.py", line 386, in export_commits
remote: self.export_git_objects()
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/git_handler.py", line 615, in export_git_objects
remote: self.export_hg_commit(ctx.node(), exporter)
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/git_handler.py", line 690, in export_hg_commit
remote: for obj, nodeid in exporter.update_changeset(ctx):
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/hg2git.py", line 210, in update_changeset
remote: subadded, subremoved = self._handle_subrepos(newctx)
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/hg2git.py", line 375, in _handle_subrepos
remote: newsub, newsubstate = parse_subrepos(newctx)
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/hg2git.py", line 21, in parse_subrepos
remote: sub = util.parse_hgsub(ctx['.hgsub'].data().splitlines())
remote: File "/opt/gitlab/embedded/service/hg-git/hggit/util.py", line 29, in parse_hgsub
remote: name, value = l.split('=', 1)
remote: ValueError: need more than 1 value to unpack
abort: stream ended unexpectedly (got 0 bytes, expected 4)