atom feed19 messages in com.selenic.mercurial-devel[PATCH 03 of 11] localrepo: add a cac...
FromSent OnAttachments
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Idan KamaraJul 16, 2011 7:34 am 
Adrian BuehlmannJul 16, 2011 9:03 am 
Matt MackallJul 18, 2011 1:12 pm 
Adrian BuehlmannJul 18, 2011 1:32 pm 
Matt MackallJul 18, 2011 2:29 pm 
Adrian BuehlmannJul 18, 2011 3:26 pm 
Idan KamaraJul 19, 2011 3:23 am 
Adrian BuehlmannJul 19, 2011 4:53 am 
Subject:[PATCH 03 of 11] localrepo: add a cache with stat info for files under .hg/
From:Idan Kamara (idan@gmail.com)
Date:Jul 16, 2011 7:34:34 am
List:com.selenic.mercurial-devel

# HG changeset patch # User Idan Kamara <idan@gmail.com> # Date 1310826866 -10800 # Node ID 87ba99602fd72793e5e9871bc3e775b4ddfffa57 # Parent b99305dd59279aec962e23da2a362e0d8b785965 localrepo: add a cache with stat info for files under .hg/

diff -r b99305dd5927 -r 87ba99602fd7 mercurial/localrepo.py --- a/mercurial/localrepo.py Sat Jul 09 19:06:59 2011 +0300 +++ b/mercurial/localrepo.py Sat Jul 16 17:34:26 2011 +0300 @@ -110,6 +110,11 @@ self._datafilters = {} self._transref = self._lockref = self._wlockref = None

+ # A cache for various files under .hg/ with stat info, used by the + # filecache decorator. Keys are the decorated function names, with + # [cached object, last stat info, path to watched file] as value. + self._invalidatecache = {} + def _applyrequirements(self, requirements): self.requirements = requirements openerreqs = set(('revlogv1', 'generaldelta')) @@ -814,6 +819,19 @@ self._lockref = weakref.ref(l) return l

+ def _updatestatinfo(self, key=None): + '''update stat info of the given key or all keys in the cache (except + dirstate)''' + if key: + e = self._invalidatecache[key] + e[1] = util.stat(e[2]) + else: + for k in self._invalidatecache: + if k == 'dirstate': + continue + e = self._invalidatecache[k] + e[1] = util.stat(e[2]) + def wlock(self, wait=True): '''Lock the non-store parts of the repository (everything under .hg except .hg/store) and return a weak reference to the lock. diff -r b99305dd5927 -r 87ba99602fd7 mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py Sat Jul 09 19:06:59 2011 +0300 +++ b/mercurial/statichttprepo.py Sat Jul 16 17:34:26 2011 +0300 @@ -125,6 +125,7 @@ self.encodepats = None self.decodepats = None self.capabilities.difference_update(["pushkey"]) + self._invalidatecache = {}

def url(self): return self._url