Patchwork [10,of,11,sparse,V3] sparse: inline signature cache clearing

login
register
mail settings
Submitter Gregory Szorc
Date July 7, 2017, 1:18 a.m.
Message ID <1c1a25d842854cbb2a75.1499390311@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/22082/
State Accepted
Headers show

Comments

Gregory Szorc - July 7, 2017, 1:18 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1499382628 25200
#      Thu Jul 06 16:10:28 2017 -0700
# Node ID 1c1a25d842854cbb2a7516136f7bcaab0d9f4539
# Parent  cdf003c9148c51bc45f9efb73102c3c013826390
sparse: inline signature cache clearing

It is a trivial one-liner. No need to have a separate function.

Patch

diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -134,9 +134,6 @@  def activeprofiles(repo):
 
     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 @@  def writeconfig(repo, includes, excludes
                 fh.write(e)
                 fh.write('\n')
 
-    invalidatesignaturecache(repo)
+    repo._sparsesignaturecache.clear()
 
 def readtemporaryincludes(repo):
     raw = repo.vfs.tryread('tempsparse')
@@ -191,7 +188,7 @@  def readtemporaryincludes(repo):
 
 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 @@  def prunetemporaryincludes(repo):
         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))