diff -r e72c5263ccaf -r c8fb2a82b5f9 mercurial/revset.py --- a/mercurial/revset.py Mon May 22 02:03:43 2017 +0530 +++ b/mercurial/revset.py Mon May 22 02:14:22 2017 +0530 @@ -1434,7 +1434,12 @@ ps = set() cl = repo.changelog for r in getset(repo, fullreposet(repo), x): - ps.add(cl.parentrevs(r)[1]) + try: + ps.add(cl.parentrevs(r)[1]) + except error.WdirUnsupported: + parents = repo[r].parents() + if len(parents) == 2: + ps.add(parents[1]) ps -= {node.nullrev} # XXX we should turn this into a baseset instead of a set, smartset may do # some optimizations from the fact this is a baseset.