# HG changeset patch # User Yuya Nishihara # Date 2019-04-30 06:10:07 # Node ID a0c5e06e9b1a2c04f2393801022ab37c5c900cf1 # Parent 96bc1ef4a3026b3208afde5aab0a034ad3e4947d revset: extract private constant of {nullrev, wdirrev} set I'll add a few more users of this constant to get around wdir identifiers. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -52,6 +52,9 @@ generatorset = smartset.generatorset spanset = smartset.spanset fullreposet = smartset.fullreposet +# revisions not included in all(), but populated if specified +_virtualrevs = (node.nullrev, node.wdirrev) + # Constants for ordering requirement, used in getset(): # # If 'define', any nested functions and operations MAY change the ordering of @@ -1847,7 +1850,7 @@ def rev(repo, subset, x): except (TypeError, ValueError): # i18n: "rev" is a keyword raise error.ParseError(_("rev expects a number")) - if l not in repo.changelog and l not in (node.nullrev, node.wdirrev): + if l not in repo.changelog and l not in _virtualrevs: return baseset() return subset & baseset([l])