[PATCH 2 of 2] revset: strip off "literal:" prefix from bookmark not found error

Yuya Nishihara yuya at tcha.org
Thu Oct 8 10:39:12 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1444226671 -32400
#      Wed Oct 07 23:04:31 2015 +0900
# Node ID 89b4acf69d7619220dda12fc8a9482587746310d
# Parent  972718693a474e8cba92c1f36cbd52f969d99242
revset: strip off "literal:" prefix from bookmark not found error

This is what branch() and tag() do.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -696,7 +696,7 @@ def bookmark(repo, subset, x):
             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()
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -135,6 +135,9 @@ bookmarks revset
   $ 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]


More information about the Mercurial-devel mailing list