diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -898,13 +898,13 @@ def _makenofollowfilematcher(repo, pats, def _makerevset(repo, wopts, slowpath): """Return a revset string built from log options and file patterns""" opts = { - b'branch': [repo.lookupbranch(b) for b in wopts.branches], + b'branch': [b'literal:' + repo.lookupbranch(b) for b in wopts.branches], b'date': wopts.date, b'keyword': wopts.keywords, b'no_merges': wopts.no_merges, b'only_merges': wopts.only_merges, b'prune': wopts.prune_ancestors, - b'user': wopts.users, + b'user': [b'literal:' + v for v in wopts.users], } if wopts.filter_revisions_by_pats and slowpath: diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -2310,6 +2310,7 @@ def bookmarkrevs(repo, mark): def format_bookmark_revspec(mark): """Build a revset expression to select revisions reachable by a given bookmark""" + mark = b'literal:' + mark return revsetlang.formatspec( b"ancestors(bookmark(%s)) - " b"ancestors(head() and not bookmark(%s)) - " diff --git a/tests/test-glog-beautifygraph.t b/tests/test-glog-beautifygraph.t --- a/tests/test-glog-beautifygraph.t +++ b/tests/test-glog-beautifygraph.t @@ -1588,19 +1588,19 @@ glog always reorders nodes which explain (list (func (symbol 'user') - (string 'test')) + (string 'literal:test')) (func (symbol 'user') - (string 'not-a-user')))) + (string 'literal:not-a-user')))) , , - >, + >, , - >>> + >>> $ testlog -b not-a-branch abort: unknown revision 'not-a-branch' abort: unknown revision 'not-a-branch' @@ -1611,28 +1611,28 @@ glog always reorders nodes which explain (list (func (symbol 'branch') - (string 'default')) + (string 'literal:default')) (or (list (func (symbol 'branch') - (string 'branch')) + (string 'literal:branch')) (func (symbol 'branch') - (string 'branch')))))) + (string 'literal:branch')))))) , , - >, + >, , - >, + >, , - >>>> + >>>> $ testlog -k expand -k merge [] (or diff --git a/tests/test-glog.t b/tests/test-glog.t --- a/tests/test-glog.t +++ b/tests/test-glog.t @@ -1438,19 +1438,19 @@ glog always reorders nodes which explain (list (func (symbol 'user') - (string 'test')) + (string 'literal:test')) (func (symbol 'user') - (string 'not-a-user')))) + (string 'literal:not-a-user')))) , , - >, + >, , - >>> + >>> $ testlog -b not-a-branch abort: unknown revision 'not-a-branch' abort: unknown revision 'not-a-branch' @@ -1461,28 +1461,28 @@ glog always reorders nodes which explain (list (func (symbol 'branch') - (string 'default')) + (string 'literal:default')) (or (list (func (symbol 'branch') - (string 'branch')) + (string 'literal:branch')) (func (symbol 'branch') - (string 'branch')))))) + (string 'literal:branch')))))) , , - >, + >, , - >, + >, , - >>>> + >>>> $ testlog -k expand -k merge [] (or diff --git a/tests/test-log-bookmark.t b/tests/test-log-bookmark.t --- a/tests/test-log-bookmark.t +++ b/tests/test-log-bookmark.t @@ -190,3 +190,9 @@ Unknown bookmark: $ hg log -B unknown abort: bookmark 'unknown' does not exist [255] + +Shouldn't accept string-matcher syntax: + + $ hg log -B 're:.*' + abort: bookmark 're:.*' does not exist + [255] diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1378,6 +1378,14 @@ are specified (issue5100): 1 k1 0 k0 + log -b/-u/-k shouldn't accept string-matcher syntax: + + $ hg log -b 're:.*' + abort: unknown revision 're:.*' + [255] + $ hg log -k 're:.*' + $ hg log -u 're:.*' + log FILE in ascending order, against dagrange: $ hg log -r1:: -T '{rev} {files}\n' f1 f2