mercurial/sparse.py
changeset 33354 4695f1829045
parent 33353 160efb559f67
child 33355 9087f9997f42
equal deleted inserted replaced
33353:160efb559f67 33354:4695f1829045
   492         origstatus = repo.status()
   492         origstatus = repo.status()
   493         origsparsematch = matcher(repo)
   493         origsparsematch = matcher(repo)
   494         refreshwdir(repo, origstatus, origsparsematch, force=True)
   494         refreshwdir(repo, origstatus, origsparsematch, force=True)
   495 
   495 
   496     prunetemporaryincludes(repo)
   496     prunetemporaryincludes(repo)
       
   497 
       
   498 def clearrules(repo, force=False):
       
   499     """Clears include/exclude rules from the sparse config.
       
   500 
       
   501     The remaining sparse config only has profiles, if defined. The working
       
   502     directory is refreshed, as needed.
       
   503     """
       
   504     with repo.wlock():
       
   505         raw = repo.vfs.tryread('sparse')
       
   506         includes, excludes, profiles = parseconfig(repo.ui, raw)
       
   507 
       
   508         if not includes and not excludes:
       
   509             return
       
   510 
       
   511         oldstatus = repo.status()
       
   512         oldmatch = matcher(repo)
       
   513         writeconfig(repo, set(), set(), profiles)
       
   514         refreshwdir(repo, oldstatus, oldmatch, force=force)