diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1456,10 +1456,10 @@ def parents(repo, subset, x): up = ps.update parentrevs = cl.parentrevs for r in getset(repo, fullreposet(repo), x): - if r == node.wdirrev: + try: + up(parentrevs(r)) + except error.WdirUnsupported: up(p.rev() for p in repo[r].parents()) - else: - up(parentrevs(r)) ps -= {node.nullrev} return subset & ps