inconsistent handling of branches with '_' in their name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Michael Hudson-Doyle |
Bug Description
This is somewhat related to bug 5575
The web interface will prevent you from using a name with an underscore, but it is still possible when using automatic naming through 'bzr register-branch'.
I have several branches that work this way, such as:
https:/
My default naming convention is to use an underscore, and so when I 'bzr register-branch' it just registers the same url with LP.
This creates a branch with an underscore in its Launchpad name. Which seems to work fine, even though it violates some hidden naming constraint.
The only time I run into that constraint is when I want to update the branch status from "New" to "Merged", because the +edit page will complain if you use underscores.
My preferred "fix" for this, would be to just allow "_" as a part of a name. I don't really understand why it would not be allowed. But for consistency sake, the other possibilities are to have the auto-name include dashes, or to fail the registration (with an understandable error) if the final name would include underscores.
Oh, and it is also possible to create a branch with that sort of name when pushing via sftp.
bzr push sftp://
Gives me
https:/
Changed in launchpad-bazaar: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in launchpad-bazaar: | |
assignee: | jml → nobody |
Changed in launchpad-bazaar: | |
assignee: | ddaa → nobody |
Changed in launchpad-bazaar: | |
assignee: | nobody → jml |
Changed in launchpad-bazaar: | |
assignee: | jml → mwhudson |
The database constraints don't match the constraint in the Python code.
The Python code uses our standard valid_name() constraint of ^[a-z0- 9][a-z0- 9\+\.\- ]*$
The database constraint uses a valid_branch_name() constraint of ^(?i)[a- z0-9][a- z0-9+\. \-@_]+$ (i.e. same as above but allows upper case, "@" and "_").
One of these constraints is incorrect.