I have a branch containing colon (‘:’) in the name. How can I close it?
I can’t fully update to it (the files in the directory do update after “hg up”, though I get an error message “abort: ‘:’ cannot be used in a name”; and “hg summary” shows the right revision number and tag, but the previous branch name). “hg ci –close-branch” exits with “abort: can only close branch heads”.
I can recommit it this way changeset by changeset with a proper name and then prune the old one using clone or strip, but I wonder if there is another solution.
UPD I have used the workaround, but still want to know a straightforward solution, aslo someone else might find it helpful.
Mercurial’s documentation is a bit misleading on this point: Colons in branch names are accepted, but when you try to use the name, it is misinterpreted as a revision range. To prevent hg from parsing
blah:blahas a range, you can write it as"branch('blah:blah')". For example:The above works on relatively recent versions of mercurial. It sounds like you have additional, version related problems, but give this a try.