From patchwork Thu Jul 6 19:36:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [04,of,13,sparse,V2] sparse: remove reference to simplecache From: Gregory Szorc X-Patchwork-Id: 22033 Message-Id: <452ec637b490dc1a7137.1499369790@ubuntu-vm-main> To: mercurial-devel@mercurial-scm.org Date: Thu, 06 Jul 2017 12:36:30 -0700 # HG changeset patch # User Gregory Szorc # Date 1499363663 25200 # Thu Jul 06 10:54:23 2017 -0700 # Node ID 452ec637b490dc1a7137777a4adbb84a9301bed5 # Parent 1f1f1ed45ed8ee15c37080986022d9de1d7fbd05 sparse: remove reference to simplecache This is a 3rd party extension authored by Facebook. References in core are not appropriate. It will be possible to restore this code/optimization via monkeypatching. So Facebook won't lose any functionality. The removed code is important for performance. So add a comment tracking it. diff --git a/hgext/sparse.py b/hgext/sparse.py --- a/hgext/sparse.py +++ b/hgext/sparse.py @@ -436,16 +436,9 @@ def _wraprepo(ui, repo): return includes, excludes, profiles def getrawprofile(self, profile, changeid): - try: - simplecache = extensions.find('simplecache') - node = self[changeid].hex() - def func(): - return self.filectx(profile, changeid=changeid).data() - key = 'sparseprofile:%s:%s' % (profile.replace('/', '__'), node) - return simplecache.memoize(func, key, - simplecache.stringserializer, self.ui) - except KeyError: - return self.filectx(profile, changeid=changeid).data() + # TODO add some kind of cache here because this incurs a manifest + # resolve and can be slow. + return self.filectx(profile, changeid=changeid).data() def sparsechecksum(self, filepath): fh = open(filepath)