diff -r b17be267b59c -r 5023027240a1 mercurial/commands.py --- a/mercurial/commands.py Wed Oct 17 16:34:46 2012 -0500 +++ b/mercurial/commands.py Wed Oct 17 17:23:39 2012 -0500 @@ -794,6 +794,11 @@ if not mark: raise util.Abort(_("bookmark names cannot consist entirely of " "whitespace")) + for c in (':', '\0', '\n', '\r'): + if c in mark: + raise util.Abort(_("bookmark '%s' contains illegal " + "character" % mark)) + scmutil.checknewlabel(repo, mark) return mark def checkconflict(repo, mark, force=False):