# HG changeset patch # User Gregory Szorc # Date 1499382628 25200 # Node ID 38df146d06979ae7f5f334b5a55fdaf779b3f19a # Parent 33d0859c37bde8c934c93d54a9f9c4190f44a63a sparse: inline signature cache clearing It is a trivial one-liner. No need to have a separate function. diff -r 33d0859c37bd -r 38df146d0697 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))