heptapod issueshttps://foss.heptapod.net/heptapod/heptapod/-/issues2021-03-18T10:34:30Zhttps://foss.heptapod.net/heptapod/heptapod/-/issues/330Editing files through the web and creating merge requests and topics - full d...2021-03-18T10:34:30ZArthur LutzEditing files through the web and creating merge requests and topics - full diff for one lineSince a recent release of heptapod editing through the web interface to contribute a change, a merge request and a new hg topic works ! :tada:
But...
When editing one line in a a 5 line file, the diff shows that all lines have changed....Since a recent release of heptapod editing through the web interface to contribute a change, a merge request and a new hg topic works ! :tada:
But...
When editing one line in a a 5 line file, the diff shows that all lines have changed. This is probably related to line breaks ?https://foss.heptapod.net/heptapod/heptapod/-/issues/347Topic names need to conform to git's refs format2020-12-03T11:48:00ZRaphaël GomèsTopic names need to conform to git's refs format### Summary
I named a topic `fix-cargo.lock`, and was faced with this traceback on push:
<pre>
pushing to ssh://hg@foss.heptapod.net/octobus/mercurial-devel
searching for changes
remote: adding changesets
remote: adding manifests
remot...### Summary
I named a topic `fix-cargo.lock`, and was faced with this traceback on push:
<pre>
pushing to ssh://hg@foss.heptapod.net/octobus/mercurial-devel
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: Traceback (most recent call last):
remote: File "/home/hg/venv/bin/hg", line 43, in <module>
remote: dispatch.run()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 113, in run
remote: status = dispatch(req)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 303, in dispatch
remote: ret = _runcatch(req) or 0
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 479, in _runcatch
remote: return _callcatch(ui, _runcatchfunc)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 488, in _callcatch
remote: return scmutil.callcatch(ui, func)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/scmutil.py", line 152, in callcatch
remote: return func()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 469, in _runcatchfunc
remote: return _dispatch(req)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 1232, in _dispatch
remote: return runcommand(
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 917, in runcommand
remote: ret = _runcommand(ui, options, cmd, d)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 1244, in _runcommand
remote: return cmdfunc()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/dispatch.py", line 1230, in <lambda>
remote: d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/util.py", line 1867, in check
remote: return func(*args, **kwargs)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/commands.py", line 6516, in serve
remote: s.serve_forever()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotoserver.py", line 852, in serve_forever
remote: self.serveuntil(threading.Event())
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotoserver.py", line 858, in serveuntil
remote: _runsshserver(self._ui, self._repo, self._fin, self._fout, ev)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotoserver.py", line 700, in _runsshserver
remote: rsp = wireprotov1server.dispatch(repo, proto, request)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotov1server.py", line 82, in dispatch
remote: return func(repo, proto, *args)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotov1server.py", line 663, in unbundle
remote: r = exchange.unbundle(
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/exchange.py", line 2824, in unbundle
remote: lockandtr[2].close()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/transaction.py", line 46, in _active
remote: return func(self, *args, **kwds)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/transaction.py", line 521, in close
remote: self._validatecallback[category](self)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/localrepo.py", line 2204, in validate
remote: repo.hook(
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/localrepo.py", line 1766, in hook
remote: return hook.hook(self.ui, self, name, throw, **args)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/hook.py", line 260, in hook
remote: res = runhooks(ui, repo, htype, hooks, throw=throw, **args)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/hook.py", line 331, in runhooks
remote: r, raised = pythonhook(
remote: File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/hook.py", line 116, in pythonhook
remote: r = obj(ui=ui, repo=repo, hooktype=htype, **pycompat.strkwargs(args))
remote: File "/home/hg/venv3/lib/python3.8/site-packages/heptapod/hooks/gitlab_mirror.py", line 13, in mirror
remote: gitlab_mirror(ui, repo)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/hgext3rd/heptapod/__init__.py", line 136, in gitlab_mirror
remote: git.HeptapodGitHandler(repo, repo.ui).export_commits()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/hgext3rd/heptapod/git.py", line 650, in export_commits
remote: self.update_references()
remote: File "/home/hg/venv3/lib/python3.8/site-packages/hgext3rd/heptapod/git.py", line 664, in update_references
remote: self.heptapod_apply_changes(prune_reasons, changes)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/hgext3rd/heptapod/git.py", line 634, in heptapod_apply_changes
remote: git_refs[change.ref] = change.after
remote: File "/home/hg/venv3/lib/python3.8/site-packages/dulwich/refs.py", line 344, in __setitem__
remote: self.set_if_equals(name, None, ref)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/dulwich/refs.py", line 712, in set_if_equals
remote: self._check_refname(name)
remote: File "/home/hg/venv3/lib/python3.8/site-packages/dulwich/refs.py", line 232, in _check_refname
remote: raise RefFormatError(name)
remote: dulwich.errors.RefFormatError: b'refs/heads/topic/default/fix-cargo.lock'
abort: stream ended unexpectedly (got 0 bytes, expected 4)
</pre>
### What is the current *bug* behavior?
The push is rejected with the traceback. This happens because `.lock` is reserved for git locks, currently used by Heptapod until [HGitaly](https://foss.heptapod.net/heptapod/hgitaly) is used.
### What is the expected *correct* behavior?
I should see one of two things (IMO):
- No traceback and an error message saying that this is not yet supported because the backend is git
- The push succeeding as normal
The last solution would probably entail encoding the ref before passing it to Git as a temporary solution for hg repos, solution that would be kept over for hg repos with git mirroring even after HGitaly is used.
Whatever happens, I am very much against restricting topic names on the `topic` extension side of things just because git uses files for its refs. People that use Git mirroring will need to make sure to use branch/topic names that are compatible with both Mercurial and Git if the "encoding" solution is not used.Heptapod 0.17.2Raphaël GomèsRaphaël Gomèshttps://foss.heptapod.net/heptapod/heptapod/-/issues/356[email] Notification email mentions gitlab2021-04-28T18:14:09ZArthur Lutz[email] Notification email mentions gitlab* [x] "View it on GitLab."
* [x] Gitlab logo image* [x] "View it on GitLab."
* [x] Gitlab logo imageRaphaël GomèsRaphaël Gomès