scmutil: add function to validate new branch, tag, and bookmark names
For now the new function only checks to make sure the new label name
isn't a reserved name ('tip', '.', or 'null'). Eventually more of the
checks will be unified between the different types of labels.
The `tag` command is trivially updated to use it. Updating branches and
bookmarks to use it is slightly more invasive and thus reserved for
later patches.
bookmarks: disallow bookmarks named 'tip', '.', or 'null'
This makes bookmarks reject the same reserved names as tags and branches.
bookmarks: abort directly on invalid name
This consolidates the abort message for a bookmark name containing
invalid characters into one place, and renames the valid() method to
checkvalid() to reflect the fact that it's no longer a predicate.
bookmarks: remove redundant check for newline
New bookmarks are already checked for illegal characters (':', '\0',
'\n', and '\r') in bookmarks.valid().
amend: do a bare kill of temporary changeset
Before this changeset the temporary changeset created by amend was made a
precursors on the amend result. This add unnecessary complexity to the
obsolescence graph. This temporary commit will probably disappear in the future.
It is an unwanted byproduct of amend that nobody cares about.
amend: add noise in extra to avoid creating obsolescence cycle (
issue3664)
Obsolescence cycle are bad and should be avoided as much as possible. The
current amend implemented touch changeset meta data as few as possible. This
make is easy for amend to result in the same node than a precursors. We add some
deterministic noise in extra to avoid this. In practice, the hex of the amended
changeset is stored in 'amend_source' extra key.
changelog: extract description cleaning logic in a dedicated function
The amend logic have use for it.