--- a/mercurial/repair.py Fri Jan 06 09:56:40 2017 +0800
+++ b/mercurial/repair.py Wed Jan 04 10:07:12 2017 -0800
@@ -99,9 +99,9 @@
# (head = revision in the set that has no descendant in the set;
# base = revision in the set that has no ancestor in the set)
tostrip = set(striplist)
- for rev in striplist:
- for desc in cl.descendants([rev]):
- tostrip.add(desc)
+ for r in cl.revs(start=striprev + 1):
+ if any(p in tostrip for p in cl.parentrevs(r)):
+ tostrip.add(r)
files = _collectfiles(repo, striprev)
saverevs = _collectbrokencsets(repo, files, striprev)