revset: bookmark revset interprets 'literal:' prefix correctly (issue4329) stable
authorMichael O'Connor <mkoconnor@gmail.com>
Mon, 11 Aug 2014 23:45:08 -0400
branchstable
changeset 22105 3efe3c2609e0
parent 22103 42b1344656f7
child 22106 e5dfa8689cf0
revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
mercurial/revset.py
tests/test-bookmarks.t
--- a/mercurial/revset.py	Mon Aug 11 13:10:00 2014 -0500
+++ b/mercurial/revset.py	Mon Aug 11 23:45:08 2014 -0400
@@ -449,7 +449,7 @@
                        _('the argument to bookmark must be a string'))
         kind, pattern, matcher = _stringmatcher(bm)
         if kind == 'literal':
-            bmrev = repo._bookmarks.get(bm, None)
+            bmrev = repo._bookmarks.get(pattern, None)
             if not bmrev:
                 raise util.Abort(_("bookmark '%s' does not exist") % bm)
             bmrev = repo[bmrev].rev()
--- a/tests/test-bookmarks.t	Mon Aug 11 13:10:00 2014 -0500
+++ b/tests/test-bookmarks.t	Mon Aug 11 23:45:08 2014 -0400
@@ -98,6 +98,14 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     1
   
+  $ hg log -r 'bookmark("literal:X")'
+  changeset:   0:f7b1eb17ad24
+  bookmark:    X
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+
   $ hg log -r 'bookmark(unknown)'
   abort: bookmark 'unknown' does not exist
   [255]