changeset 26538:5c9ec1cc671a

revset: strip off "literal:" prefix from bookmark not found error This is what branch() and tag() do.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 07 Oct 2015 23:04:31 +0900
parents 832feae7c986
children 1956026e4db2
files mercurial/revset.py tests/test-bookmarks.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Oct 07 23:00:29 2015 +0900
+++ b/mercurial/revset.py	Wed Oct 07 23:04:31 2015 +0900
@@ -696,7 +696,7 @@
             bmrev = repo._bookmarks.get(pattern, None)
             if not bmrev:
                 raise error.RepoLookupError(_("bookmark '%s' does not exist")
-                                            % bm)
+                                            % pattern)
             bms.add(repo[bmrev].rev())
         else:
             matchrevs = set()
--- a/tests/test-bookmarks.t	Wed Oct 07 23:00:29 2015 +0900
+++ b/tests/test-bookmarks.t	Wed Oct 07 23:04:31 2015 +0900
@@ -135,6 +135,9 @@
   $ hg log -r 'bookmark(unknown)'
   abort: bookmark 'unknown' does not exist!
   [255]
+  $ hg log -r 'bookmark("literal:unknown")'
+  abort: bookmark 'unknown' does not exist!
+  [255]
   $ hg log -r 'bookmark("re:unknown")'
   abort: no bookmarks exist that match 'unknown'!
   [255]