Relax constraints on branch names for Mercurial repositories
Summary
When pushing to a Heptapod Mercurial repository, it imposes constraints on the branch name beyond those that Mercurial itself needs
Steps to reproduce
Create a local Mercurial repository and make some commits with a branch name containing e.g. the '^' character. Try to push to Heptapod; it will reject the push with an error 'You cannot create a branch with an invalid name.'
Example Project
What is the current bug behavior?
Push is rejected with 'You cannot create a branch with an invalid name.' No hint is given as to which branch, so this is particularly inconvenient if you're pushing an entire existing repo up to Heptapod.
What is the expected correct behavior?
Minimum: report which branch name was rejected, so the user can potentially change it before pushing. Ideally: don't impose any (additional) constraints on branch names in Mercurial repos, so an existing repo can always be pushed up/imported.
Relevant logs and/or screenshots
Details about the Heptapod instance where the bug occurs
This occurred on heptapod.host
Possible fixes
@gracinet suggests on Matrix that:
"Hi, after some indirections, this message boils down to this set of rules: https://www.rubydoc.info/github/libgit2/rugged/Rugged/Reference.valid_name%3F (case 2, actually this Ruby method will be called for refs/heads/branch/<HG_BRANCH>. We don't currently have any means to relax such rules, but we should replace them by Mercurial-oriented rules at some point (after all we don't convert to Git any more)"