# HG changeset patch # User Martin von Zweigbergk # Date 1541437788 28800 # Node ID 7ed611c601685145d6b962e15a826b94b53db7a9 # Parent 2ecf5c24d0cd52d54f905d3a3032dc7087a75911 revsets: make bookmark/named('re:nonexistent') not abort (issue6018) (BC) Foozy documented the differences between revsets branch(), tag(), bookmark(), and named() in eeb5d5ab14a6 (revset: raise RepoLookupError to make present() predicate continue the query, 2015-01-31). He seemed to want tag() to change behavior to not error out on non-matching regular expressions. I think it's instead bookmark() and named() that should not error out. So that's what this patch does. Differential Revision: https://phab.mercurial-scm.org/D5220 diff -r 2ecf5c24d0cd -r 7ed611c60168 mercurial/revset.py --- a/mercurial/revset.py Mon Nov 05 16:05:45 2018 -0800 +++ b/mercurial/revset.py Mon Nov 05 09:09:48 2018 -0800 @@ -466,9 +466,6 @@ for name, bmrev in repo._bookmarks.iteritems(): if matcher(name): matchrevs.add(bmrev) - if not matchrevs: - raise error.RepoLookupError(_("no bookmarks exist" - " that match '%s'") % pattern) for bmrev in matchrevs: bms.add(repo[bmrev].rev()) else: @@ -1330,9 +1327,6 @@ for name, ns in repo.names.iteritems(): if matcher(name): namespaces.add(ns) - if not namespaces: - raise error.RepoLookupError(_("no namespace exists" - " that match '%s'") % pattern) names = set() for ns in namespaces: diff -r 2ecf5c24d0cd -r 7ed611c60168 tests/test-bookmarks.t --- a/tests/test-bookmarks.t Mon Nov 05 16:05:45 2018 -0800 +++ b/tests/test-bookmarks.t Mon Nov 05 09:09:48 2018 -0800 @@ -202,8 +202,6 @@ abort: bookmark 'unknown' does not exist! [255] $ hg log -r 'bookmark("re:unknown")' - abort: no bookmarks exist that match 'unknown'! - [255] $ hg log -r 'present(bookmark("literal:unknown"))' $ hg log -r 'present(bookmark("re:unknown"))' diff -r 2ecf5c24d0cd -r 7ed611c60168 tests/test-revset2.t --- a/tests/test-revset2.t Mon Nov 05 16:05:45 2018 -0800 +++ b/tests/test-revset2.t Mon Nov 05 09:09:48 2018 -0800 @@ -669,8 +669,6 @@ abort: namespace 'unknown' does not exist! [255] $ log 'named("re:unknown")' - abort: no namespace exists that match 'unknown'! - [255] $ log 'present(named("unknown"))' $ log 'present(named("re:unknown"))'