hgext/sparse.py
changeset 33292 1e9fd2c35ae3
parent 33291 74923cec6fdb
child 33293 c9cbf4de27ba
equal deleted inserted replaced
33291:74923cec6fdb 33292:1e9fd2c35ae3
   434             if includes:
   434             if includes:
   435                 includes.add('.hg*')
   435                 includes.add('.hg*')
   436             return includes, excludes, profiles
   436             return includes, excludes, profiles
   437 
   437 
   438         def getrawprofile(self, profile, changeid):
   438         def getrawprofile(self, profile, changeid):
   439             try:
   439             # TODO add some kind of cache here because this incurs a manifest
   440                 simplecache = extensions.find('simplecache')
   440             # resolve and can be slow.
   441                 node = self[changeid].hex()
   441             return self.filectx(profile, changeid=changeid).data()
   442                 def func():
       
   443                     return self.filectx(profile, changeid=changeid).data()
       
   444                 key = 'sparseprofile:%s:%s' % (profile.replace('/', '__'), node)
       
   445                 return simplecache.memoize(func, key,
       
   446                         simplecache.stringserializer, self.ui)
       
   447             except KeyError:
       
   448                 return self.filectx(profile, changeid=changeid).data()
       
   449 
   442 
   450         def sparsechecksum(self, filepath):
   443         def sparsechecksum(self, filepath):
   451             fh = open(filepath)
   444             fh = open(filepath)
   452             return hashlib.sha1(fh.read()).hexdigest()
   445             return hashlib.sha1(fh.read()).hexdigest()
   453 
   446