Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 26537:832feae7c986
revset: do not fall through to revspec for literal: branch (issue4838)
If "literal:" is specified, it must not be a revset expression. It should
error out with a better message.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 07 Oct 2015 23:00:29 +0900 |
parents | 7d132557e44a |
children | 5c9ec1cc671a |
comparison
equal
deleted
inserted
replaced
26536:93a3687a94d7 | 26537:832feae7c986 |
---|---|
732 pass | 732 pass |
733 else: | 733 else: |
734 kind, pattern, matcher = util.stringmatcher(b) | 734 kind, pattern, matcher = util.stringmatcher(b) |
735 if kind == 'literal': | 735 if kind == 'literal': |
736 # note: falls through to the revspec case if no branch with | 736 # note: falls through to the revspec case if no branch with |
737 # this name exists | 737 # this name exists and pattern kind is not specified explicitly |
738 if pattern in repo.branchmap(): | 738 if pattern in repo.branchmap(): |
739 return subset.filter(lambda r: matcher(getbi(r)[0])) | 739 return subset.filter(lambda r: matcher(getbi(r)[0])) |
740 if b.startswith('literal:'): | |
741 raise error.RepoLookupError(_("branch '%s' does not exist") | |
742 % pattern) | |
740 else: | 743 else: |
741 return subset.filter(lambda r: matcher(getbi(r)[0])) | 744 return subset.filter(lambda r: matcher(getbi(r)[0])) |
742 | 745 |
743 s = getset(repo, fullreposet(repo), x) | 746 s = getset(repo, fullreposet(repo), x) |
744 b = set() | 747 b = set() |