# HG changeset patch # User Joel Rosdahl # Date 1224954352 -7200 # Node ID 18c23375861fadf42178615dbde30c194bb9d6f6 # Parent 9bd051efbdd6e64ff2db18bf09610028ea2071e2 bookmarks: Correctly reject newlines in bookmark names Without this fix, a single newline is a valid bookmark name since strip() removes it. diff -r 9bd051efbdd6 -r 18c23375861f hgext/bookmarks.py --- a/hgext/bookmarks.py Sat Oct 25 19:05:52 2008 +0200 +++ b/hgext/bookmarks.py Sat Oct 25 19:05:52 2008 +0200 @@ -98,8 +98,8 @@ return if mark != None: - if mark.strip().count("\n") > 0: - raise Exception("bookmark cannot contain newlines") + if "\n" in mark: + raise util.Abort(_("bookmark name cannot contain newlines")) if mark in marks and not force: raise util.Abort(_("a bookmark of the same name already exists")) if ((mark in repo.branchtags() or mark == repo.dirstate.branch())