# HG changeset patch # User Nicolas Dumazet # Date 1280373022 -32400 # Node ID e95bacedae12cf0d29251c70faca59535d55b82e # Parent 55a2af02e45cd3b182717bf38b7584c65f307a33# Parent 18c47562d331cccd0f065c1000a14735a0626384 merge with stable diff -r 55a2af02e45c -r e95bacedae12 hgext/bookmarks.py --- a/hgext/bookmarks.py Thu Jul 29 10:39:59 2010 +0900 +++ b/hgext/bookmarks.py Thu Jul 29 12:10:22 2010 +0900 @@ -136,6 +136,9 @@ if "\n" in mark: raise util.Abort(_("bookmark name cannot contain newlines")) mark = mark.strip() + if not mark: + raise util.Abort(_("bookmark names cannot consist entirely of " + "whitespace")) 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()) diff -r 55a2af02e45c -r e95bacedae12 tests/test-bookmarks --- a/tests/test-bookmarks Thu Jul 29 10:39:59 2010 +0900 +++ b/tests/test-bookmarks Thu Jul 29 12:10:22 2010 +0900 @@ -100,4 +100,7 @@ echo % revision but no bookmark name hg bookmark -r . +echo % bookmark name with whitespace only +hg bookmark ' ' + true diff -r 55a2af02e45c -r e95bacedae12 tests/test-bookmarks.out --- a/tests/test-bookmarks.out Thu Jul 29 10:39:59 2010 +0900 +++ b/tests/test-bookmarks.out Thu Jul 29 12:10:22 2010 +0900 @@ -74,3 +74,5 @@ * x y 2:0316ce92851d % revision but no bookmark name abort: bookmark name required +% bookmark name with whitespace only +abort: bookmark names cannot consist entirely of whitespace