##// END OF EJS Templates
bookmarks: change error messages to match those given by 'hg tag' commands
Idan Kamara -
r13911:6bc34094 default
parent child Browse files
Show More
@@ -507,9 +507,10 b' def bookmark(ui, repo, mark=None, rev=No'
507
507
508 if rename:
508 if rename:
509 if rename not in marks:
509 if rename not in marks:
510 raise util.Abort(_("a bookmark of this name does not exist"))
510 raise util.Abort(_("bookmark '%s' does not exist") % rename)
511 if mark in marks and not force:
511 if mark in marks and not force:
512 raise util.Abort(_("a bookmark of the same name already exists"))
512 raise util.Abort(_("bookmark '%s' already exists "
513 "(use -f to force)") % mark)
513 if mark is None:
514 if mark is None:
514 raise util.Abort(_("new bookmark name required"))
515 raise util.Abort(_("new bookmark name required"))
515 marks[mark] = marks[rename]
516 marks[mark] = marks[rename]
@@ -523,7 +524,7 b' def bookmark(ui, repo, mark=None, rev=No'
523 if mark is None:
524 if mark is None:
524 raise util.Abort(_("bookmark name required"))
525 raise util.Abort(_("bookmark name required"))
525 if mark not in marks:
526 if mark not in marks:
526 raise util.Abort(_("a bookmark of this name does not exist"))
527 raise util.Abort(_("bookmark '%s' does not exist") % mark)
527 if mark == repo._bookmarkcurrent:
528 if mark == repo._bookmarkcurrent:
528 bookmarks.setcurrent(repo, None)
529 bookmarks.setcurrent(repo, None)
529 del marks[mark]
530 del marks[mark]
@@ -538,7 +539,8 b' def bookmark(ui, repo, mark=None, rev=No'
538 raise util.Abort(_("bookmark names cannot consist entirely of "
539 raise util.Abort(_("bookmark names cannot consist entirely of "
539 "whitespace"))
540 "whitespace"))
540 if mark in marks and not force:
541 if mark in marks and not force:
541 raise util.Abort(_("a bookmark of the same name already exists"))
542 raise util.Abort(_("bookmark '%s' already exists "
543 "(use -f to force)") % mark)
542 if ((mark in repo.branchtags() or mark == repo.dirstate.branch())
544 if ((mark in repo.branchtags() or mark == repo.dirstate.branch())
543 and not force):
545 and not force):
544 raise util.Abort(
546 raise util.Abort(
@@ -116,13 +116,13 b' bookmarks X moved to rev 2, Y at rev -1,'
116 rename nonexistent bookmark
116 rename nonexistent bookmark
117
117
118 $ hg bookmark -m A B
118 $ hg bookmark -m A B
119 abort: a bookmark of this name does not exist
119 abort: bookmark 'A' does not exist
120 [255]
120 [255]
121
121
122 rename to existent bookmark
122 rename to existent bookmark
123
123
124 $ hg bookmark -m X Y
124 $ hg bookmark -m X Y
125 abort: a bookmark of the same name already exists
125 abort: bookmark 'Y' already exists (use -f to force)
126 [255]
126 [255]
127
127
128 force rename to existent bookmark
128 force rename to existent bookmark
@@ -151,7 +151,7 b' delete without name'
151 delete nonexistent bookmark
151 delete nonexistent bookmark
152
152
153 $ hg bookmark -d A
153 $ hg bookmark -d A
154 abort: a bookmark of this name does not exist
154 abort: bookmark 'A' does not exist
155 [255]
155 [255]
156
156
157 bookmark name with spaces should be stripped
157 bookmark name with spaces should be stripped
@@ -189,7 +189,7 b' reject bookmark name with newline'
189 bookmark with existing name
189 bookmark with existing name
190
190
191 $ hg bookmark Z
191 $ hg bookmark Z
192 abort: a bookmark of the same name already exists
192 abort: bookmark 'Z' already exists (use -f to force)
193 [255]
193 [255]
194
194
195 force bookmark with existing name
195 force bookmark with existing name
General Comments 0
You need to be logged in to leave comments. Login now