Mercurial > hg
diff tests/test-branches.t @ 17821:361ab1e2086f
scmutil: add bad character checking to checknewlabel
This factors out the checks from tags and bookmarks, and newly applies
the same prohibitions to branches. checknewlabel takes a new parameter,
kind, indicating the kind of label being checked.
Test coverage is added for all three types of labels.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Wed, 17 Oct 2012 21:42:06 -0500 |
parents | f2719b387380 |
children | 71c1513fd560 |
line wrap: on
line diff
--- a/tests/test-branches.t Wed Oct 17 21:39:07 2012 -0500 +++ b/tests/test-branches.t Wed Oct 17 21:42:06 2012 -0500 @@ -45,6 +45,8 @@ (branches are permanent and global, did you want a bookmark?) $ hg commit -d '5 0' -m "Adding c branch" +reserved names + $ hg branch tip abort: the name 'tip' is reserved [255] @@ -55,6 +57,17 @@ abort: the name '.' is reserved [255] +invalid characters + + $ hg branch 'foo:bar' + abort: ':' cannot be used in a branch name + [255] + + $ hg branch 'foo + > bar' + abort: '\n' cannot be used in a branch name + [255] + $ echo 'd' >d $ hg add d $ hg branch 'a branch name much longer than the default justification used by branches'