sparse: inline signature cache clearing
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 06 Jul 2017 16:10:28 -0700
changeset 33325 38df146d0697
parent 33324 33d0859c37bd
child 33326 67b42e64194d
sparse: inline signature cache clearing It is a trivial one-liner. No need to have a separate function.
mercurial/sparse.py
--- 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))