revset: strip off "literal:" prefix from bookmark not found error
authorYuya Nishihara <yuya@tcha.org>
Wed, 07 Oct 2015 23:04:31 +0900
changeset 26538 5c9ec1cc671a
parent 26537 832feae7c986
child 26539 1956026e4db2
revset: strip off "literal:" prefix from bookmark not found error This is what branch() and tag() do.
mercurial/revset.py
tests/test-bookmarks.t
--- 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]