mercurial/narrowspec.py
changeset 42171 84bd6ae2d1f6
parent 42150 770f5f586ae5
child 42404 0c0a22f5b0b5
equal deleted inserted replaced
42170:6631f3e89b6f 42171:84bd6ae2d1f6
   291     newmatch = match(repo.root, include=newincludes, exclude=newexcludes)
   291     newmatch = match(repo.root, include=newincludes, exclude=newexcludes)
   292     addedmatch = matchmod.differencematcher(newmatch, oldmatch)
   292     addedmatch = matchmod.differencematcher(newmatch, oldmatch)
   293     removedmatch = matchmod.differencematcher(oldmatch, newmatch)
   293     removedmatch = matchmod.differencematcher(oldmatch, newmatch)
   294 
   294 
   295     ds = repo.dirstate
   295     ds = repo.dirstate
   296     lookup, status = ds.status(removedmatch, subrepos=[], ignored=False,
   296     lookup, status = ds.status(removedmatch, subrepos=[], ignored=True,
   297                                clean=True, unknown=False)
   297                                clean=True, unknown=True)
   298     trackeddirty = status.modified + status.added
   298     trackeddirty = status.modified + status.added
   299     clean = status.clean
   299     clean = status.clean
   300     if assumeclean:
   300     if assumeclean:
   301         assert not trackeddirty
   301         assert not trackeddirty
   302         clean.extend(lookup)
   302         clean.extend(lookup)
   304         trackeddirty.extend(lookup)
   304         trackeddirty.extend(lookup)
   305     _deletecleanfiles(repo, clean)
   305     _deletecleanfiles(repo, clean)
   306     uipathfn = scmutil.getuipathfn(repo)
   306     uipathfn = scmutil.getuipathfn(repo)
   307     for f in sorted(trackeddirty):
   307     for f in sorted(trackeddirty):
   308         repo.ui.status(_('not deleting possibly dirty file %s\n') % uipathfn(f))
   308         repo.ui.status(_('not deleting possibly dirty file %s\n') % uipathfn(f))
       
   309     for f in sorted(status.unknown):
       
   310         repo.ui.status(_('not deleting unknown file %s\n') % uipathfn(f))
       
   311     for f in sorted(status.ignored):
       
   312         repo.ui.status(_('not deleting ignored file %s\n') % uipathfn(f))
   309     for f in clean + trackeddirty:
   313     for f in clean + trackeddirty:
   310         ds.drop(f)
   314         ds.drop(f)
   311 
   315 
   312     repo.narrowpats = newincludes, newexcludes
   316     repo.narrowpats = newincludes, newexcludes
   313     repo._narrowmatch = newmatch
   317     repo._narrowmatch = newmatch