mercurial/repair.py
changeset 39244 73cf21b2e8a6
parent 38799 2002c193f2bc
child 39686 3d22aef3ecd5
equal deleted inserted replaced
39243:0d97530eb535 39244:73cf21b2e8a6
    79 def _collectrevlog(revlog, striprev):
    79 def _collectrevlog(revlog, striprev):
    80     _, brokenset = revlog.getstrippoint(striprev)
    80     _, brokenset = revlog.getstrippoint(striprev)
    81     return [revlog.linkrev(r) for r in brokenset]
    81     return [revlog.linkrev(r) for r in brokenset]
    82 
    82 
    83 def _collectmanifest(repo, striprev):
    83 def _collectmanifest(repo, striprev):
    84     return _collectrevlog(repo.manifestlog._revlog, striprev)
    84     return _collectrevlog(repo.manifestlog.getstorage(b''), striprev)
    85 
    85 
    86 def _collectbrokencsets(repo, files, striprev):
    86 def _collectbrokencsets(repo, files, striprev):
    87     """return the changesets which will be broken by the truncation"""
    87     """return the changesets which will be broken by the truncation"""
    88     s = set()
    88     s = set()
    89 
    89 
   320     if topic:
   320     if topic:
   321         callback.topic = topic
   321         callback.topic = topic
   322     callback.addnodes(nodelist)
   322     callback.addnodes(nodelist)
   323 
   323 
   324 def stripmanifest(repo, striprev, tr, files):
   324 def stripmanifest(repo, striprev, tr, files):
   325     revlog = repo.manifestlog._revlog
   325     revlog = repo.manifestlog.getstorage(b'')
   326     revlog.strip(striprev, tr)
   326     revlog.strip(striprev, tr)
   327     striptrees(repo, tr, striprev, files)
   327     striptrees(repo, tr, striprev, files)
   328 
   328 
   329 def striptrees(repo, tr, striprev, files):
   329 def striptrees(repo, tr, striprev, files):
   330     if 'treemanifest' in repo.requirements: # safe but unnecessary
   330     if 'treemanifest' in repo.requirements: # safe but unnecessary
   331                                             # otherwise
   331                                             # otherwise
   332         for unencoded, encoded, size in repo.store.datafiles():
   332         for unencoded, encoded, size in repo.store.datafiles():
   333             if (unencoded.startswith('meta/') and
   333             if (unencoded.startswith('meta/') and
   334                 unencoded.endswith('00manifest.i')):
   334                 unencoded.endswith('00manifest.i')):
   335                 dir = unencoded[5:-12]
   335                 dir = unencoded[5:-12]
   336                 repo.manifestlog._revlog.dirlog(dir).strip(striprev, tr)
   336                 repo.manifestlog.getstorage(dir).strip(striprev, tr)
   337 
   337 
   338 def rebuildfncache(ui, repo):
   338 def rebuildfncache(ui, repo):
   339     """Rebuilds the fncache file from repo history.
   339     """Rebuilds the fncache file from repo history.
   340 
   340 
   341     Missing entries will be added. Extra entries will be removed.
   341     Missing entries will be added. Extra entries will be removed.