# HG changeset patch # User Martin von Zweigbergk # Date 1525728763 25200 # Node ID 37e7ae332e9015566117c1383cca9210acc46680 # Parent da083d9fafab2fec368712fa84138108391e511e revset: make id() an empty set for ambiguous nodeid (BC) As Yuya pointed out in the review of D3311, id() (and rev()) does not raise an error when the input is an unknown identifier, so it doesn't make sense for it to do that when the input is ambiguous with a filtered node. However, it turned out that it already does raise an error when the input is ambiguous among the visible nodes. So let's start by fixing that. Differential Revision: https://phab.mercurial-scm.org/D3462 diff -r da083d9fafab -r 37e7ae332e90 mercurial/revset.py --- a/mercurial/revset.py Sat May 05 00:16:43 2018 -0700 +++ b/mercurial/revset.py Mon May 07 14:32:43 2018 -0700 @@ -1336,6 +1336,8 @@ pm = repo.changelog._partialmatch(n) if pm is not None: rn = repo.changelog.rev(pm) + except LookupError: + pass except error.WdirUnsupported: rn = node.wdirrev diff -r da083d9fafab -r 37e7ae332e90 tests/test-revset.t --- a/tests/test-revset.t Sat May 05 00:16:43 2018 -0700 +++ b/tests/test-revset.t Mon May 07 14:32:43 2018 -0700 @@ -1713,8 +1713,6 @@ Test hexadecimal revision $ log 'id(2)' - abort: 00changelog.i@2: ambiguous identifier! - [255] $ log 'id(23268)' 4 $ log 'id(2785f51eece)'