changeset 33325:38df146d0697

sparse: inline signature cache clearing It is a trivial one-liner. No need to have a separate function.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 06 Jul 2017 16:10:28 -0700
parents 33d0859c37bd
children 67b42e64194d
files mercurial/sparse.py
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sparse.py	Thu Jul 06 14:53:08 2017 -0700
+++ b/mercurial/sparse.py	Thu Jul 06 16:10:28 2017 -0700
@@ -134,9 +134,6 @@
 
     return profiles
 
-def invalidatesignaturecache(repo):
-    repo._sparsesignaturecache.clear()
-
 def configsignature(repo, includetemp=True):
     """Obtain the signature string for the current sparse configuration.
 
@@ -180,7 +177,7 @@
                 fh.write(e)
                 fh.write('\n')
 
-    invalidatesignaturecache(repo)
+    repo._sparsesignaturecache.clear()
 
 def readtemporaryincludes(repo):
     raw = repo.vfs.tryread('tempsparse')
@@ -191,7 +188,7 @@
 
 def writetemporaryincludes(repo, includes):
     repo.vfs.write('tempsparse', '\n'.join(sorted(includes)))
-    invalidatesignaturecache(repo)
+    repo._sparsesignaturecache.clear()
 
 def addtemporaryincludes(repo, additional):
     includes = readtemporaryincludes(repo)
@@ -229,7 +226,7 @@
         dirstate.drop(file)
 
     repo.vfs.unlink('tempsparse')
-    invalidatesignaturecache(repo)
+    repo._sparsesignaturecache.clear()
     msg = _('cleaned up %d temporarily added file(s) from the '
             'sparse checkout\n')
     repo.ui.status(msg % len(tempincludes))