comparison mercurial/revset.py @ 39330:1eb370761fa0

revset: expand bookmark(.) to the active bookmark We do that in several places. I'm not pretty sure if "literal:." should be expanded or not, so it's disabled for now.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 25 Aug 2018 20:16:28 +0900
parents 31c0ee6eb0ac
children 85a474adaf26
comparison
equal deleted inserted replaced
39329:11d3cd3f0ae5 39330:1eb370761fa0
452 # i18n: "bookmark" is a keyword 452 # i18n: "bookmark" is a keyword
453 _('the argument to bookmark must be a string')) 453 _('the argument to bookmark must be a string'))
454 kind, pattern, matcher = stringutil.stringmatcher(bm) 454 kind, pattern, matcher = stringutil.stringmatcher(bm)
455 bms = set() 455 bms = set()
456 if kind == 'literal': 456 if kind == 'literal':
457 if bm == pattern:
458 pattern = repo._bookmarks.expandname(pattern)
457 bmrev = repo._bookmarks.get(pattern, None) 459 bmrev = repo._bookmarks.get(pattern, None)
458 if not bmrev: 460 if not bmrev:
459 raise error.RepoLookupError(_("bookmark '%s' does not exist") 461 raise error.RepoLookupError(_("bookmark '%s' does not exist")
460 % pattern) 462 % pattern)
461 bms.add(repo[bmrev].rev()) 463 bms.add(repo[bmrev].rev())