diff -r b9135f191d8a -r 7e07d5836063 mercurial/repair.py --- a/mercurial/repair.py Mon May 15 13:29:18 2017 -0700 +++ b/mercurial/repair.py Mon May 15 18:55:58 2017 -0700 @@ -238,12 +238,11 @@ def striptrees(repo, tr, striprev, files): if 'treemanifest' in repo.requirements: # safe but unnecessary # otherwise - treerevlog = repo.manifestlog._revlog - for dir in util.dirs(files): - # If the revlog doesn't exist, this returns an empty revlog and is a - # no-op. - rl = treerevlog.dirlog(dir) - rl.strip(striprev, tr) + for unencoded, encoded, size in repo.store.datafiles(): + if (unencoded.startswith('meta/') and + unencoded.endswith('00manifest.i')): + dir = unencoded[5:-12] + repo.manifestlog._revlog.dirlog(dir).strip(striprev, tr) def rebuildfncache(ui, repo): """Rebuilds the fncache file from repo history.