mercurial/revset.py
changeset 49510 e02dcc625171
parent 49447 6dbe74669eba
child 49511 117dcc4a0e67
--- a/mercurial/revset.py	Tue Sep 20 14:04:54 2022 +0200
+++ b/mercurial/revset.py	Mon Oct 03 17:24:52 2022 -0400
@@ -2342,9 +2342,14 @@
     parents = repo.changelog.parentrevs
 
     def filter(r):
-        for p in parents(r):
-            if 0 <= p and p in s:
-                return False
+        try:
+            for p in parents(r):
+                if 0 <= p and p in s:
+                    return False
+        except error.WdirUnsupported:
+            for p in repo[None].parents():
+                if p.rev() in s:
+                    return False
         return True
 
     return subset & s.filter(filter, condrepr=b'<roots>')