[PATCH] branch and tag subcommands don't accept colons in labels/names

Fabian Kreutz fabian.kreutz at qvantel.com
Thu Nov 24 08:10:25 CST 2011


Hello!

>> You can create a branch with an invalid name, but you cannot update to it.
> I believe some of this is due to revsets. Maybe

> hg up "branch('ISSUE-123: some long explaination')"

> will work? I think every obscure branch name can be reached that way.

Indeed, that works.
But I'm not satisfied like this, as it's un- or misdocumented.
(And personally I don't want to use the complicated syntax).
Also, don't forget tags. They are also mentioned in the documentation.
Especially tag names have the purpose to make updating to them easier.
So demanding a complicated extra-syntax is not a useable option.

So would a better fix be a documentation update on the "update" command?
Or maybe the "revisions" help text?

$ hg help revisions
[...]
    Any other string is treated as a tag or branch name. A tag name is a
    symbolic name associated with a revision identifier. A branch name denotes
    the tipmost revision of that branch. Tag and branch names must not contain
    the ":" character.
[...]

Second alternative would be that hg branches outputs the more complicated syntax
above (as I guess most users use hg up in combination with hg branches and copy-paste).

 $ hg branches
foo                          110:3451b225a6c1
branch('HDD-72: foobar')     109:41d0425963e7
HDD-86 with many spaces      108:b21e19617dba

(UGLY!)

The best alternative IMO:  hg up could first check the branch names, before failing on
invalid revset parsing?
Don't trust that me (innocent part-time contributor) will implement that, though. ;)


Bye, Fabian


More information about the Mercurial-devel mailing list