mercurial/repair.py
changeset 42282 d811f17090a3
parent 42275 e10b8058da84
child 42656 a1f10edcf6a6
equal deleted inserted replaced
42281:a42cc325b682 42282:d811f17090a3
   364     revlog = repo.manifestlog.getstorage(b'')
   364     revlog = repo.manifestlog.getstorage(b'')
   365     revlog.strip(striprev, tr)
   365     revlog.strip(striprev, tr)
   366     striptrees(repo, tr, striprev, files)
   366     striptrees(repo, tr, striprev, files)
   367 
   367 
   368 def striptrees(repo, tr, striprev, files):
   368 def striptrees(repo, tr, striprev, files):
   369     if 'treemanifest' in repo.requirements: # safe but unnecessary
   369     if 'treemanifest' in repo.requirements:
   370                                             # otherwise
   370         # This logic is safe if treemanifest isn't enabled, but also
       
   371         # pointless, so we skip it if treemanifest isn't enabled.
   371         for unencoded, encoded, size in repo.store.datafiles():
   372         for unencoded, encoded, size in repo.store.datafiles():
   372             if (unencoded.startswith('meta/') and
   373             if (unencoded.startswith('meta/') and
   373                 unencoded.endswith('00manifest.i')):
   374                 unencoded.endswith('00manifest.i')):
   374                 dir = unencoded[5:-12]
   375                 dir = unencoded[5:-12]
   375                 repo.manifestlog.getstorage(dir).strip(striprev, tr)
   376                 repo.manifestlog.getstorage(dir).strip(striprev, tr)
   416                 if repo.store._exists(d):
   417                 if repo.store._exists(d):
   417                     newentries.add(d)
   418                     newentries.add(d)
   418 
   419 
   419         progress.complete()
   420         progress.complete()
   420 
   421 
   421         if 'treemanifest' in repo.requirements: # safe but unnecessary otherwise
   422         if 'treemanifest' in repo.requirements:
       
   423             # This logic is safe if treemanifest isn't enabled, but also
       
   424             # pointless, so we skip it if treemanifest isn't enabled.
   422             for dir in util.dirs(seenfiles):
   425             for dir in util.dirs(seenfiles):
   423                 i = 'meta/%s/00manifest.i' % dir
   426                 i = 'meta/%s/00manifest.i' % dir
   424                 d = 'meta/%s/00manifest.d' % dir
   427                 d = 'meta/%s/00manifest.d' % dir
   425 
   428 
   426                 if repo.store._exists(i):
   429                 if repo.store._exists(i):