hgext/narrow/narrowcommands.py
changeset 50484 17a822d7943e
parent 50472 9fdc28e21b68
child 50499 7a1a0a236187
equal deleted inserted replaced
50483:60e613f6a229 50484:17a822d7943e
    29     registrar,
    29     registrar,
    30     repair,
    30     repair,
    31     repoview,
    31     repoview,
    32     requirements,
    32     requirements,
    33     sparse,
    33     sparse,
       
    34     store,
    34     util,
    35     util,
    35     wireprototypes,
    36     wireprototypes,
    36 )
    37 )
    37 from mercurial.utils import (
    38 from mercurial.utils import (
    38     urlutil,
    39     urlutil,
   287             with ui.configoverride(overrides, b'narrow'):
   288             with ui.configoverride(overrides, b'narrow'):
   288                 repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup)
   289                 repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup)
   289 
   290 
   290         todelete = []
   291         todelete = []
   291         for entry in repo.store.datafiles():
   292         for entry in repo.store.datafiles():
   292             f = entry.unencoded_path
   293             if not entry.is_revlog:
   293             if f.startswith(b'data/'):
   294                 continue
   294                 file = f[5:-2]
   295             if entry.revlog_type == store.FILEFLAGS_FILELOG:
   295                 if not newmatch(file):
   296                 if not newmatch(entry.target_id):
   296                     for file_ in entry.files():
   297                     for file_ in entry.files():
   297                         todelete.append(file_.unencoded_path)
   298                         todelete.append(file_.unencoded_path)
   298             elif f.startswith(b'meta/'):
   299             elif entry.revlog_type == store.FILEFLAGS_MANIFESTLOG:
   299                 dir = f[5:-13]
   300                 dir = entry.target_id
   300                 dirs = sorted(pathutil.dirs({dir})) + [dir]
   301                 dirs = sorted(pathutil.dirs({dir})) + [dir]
   301                 include = True
   302                 include = True
   302                 for d in dirs:
   303                 for d in dirs:
   303                     visit = newmatch.visitdir(d)
   304                     visit = newmatch.visitdir(d)
   304                     if not visit:
   305                     if not visit: