Show More
@@ -139,15 +139,13 def trywritehiddencache(repo, hideable, | |||
|
139 | 139 | if wlock: |
|
140 | 140 | wlock.release() |
|
141 | 141 | |
|
142 |
def |
|
|
143 | """read a cache if the cache exists and is valid, otherwise returns None.""" | |
|
142 | def _readhiddencache(repo, cachefilename, newhash): | |
|
144 | 143 | hidden = fh = None |
|
145 | 144 | try: |
|
146 | 145 | if repo.vfs.exists(cachefile): |
|
147 | 146 | fh = repo.vfs.open(cachefile, 'rb') |
|
148 | 147 | version, = struct.unpack(">H", fh.read(2)) |
|
149 | 148 | oldhash = fh.read(20) |
|
150 | newhash = cachehash(repo, hideable) | |
|
151 | 149 | if (cacheversion, oldhash) == (version, newhash): |
|
152 | 150 | # cache is valid, so we can start reading the hidden revs |
|
153 | 151 | data = fh.read() |
@@ -165,6 +163,11 def tryreadcache(repo, hideable): | |||
|
165 | 163 | if fh: |
|
166 | 164 | fh.close() |
|
167 | 165 | |
|
166 | def tryreadcache(repo, hideable): | |
|
167 | """read a cache if the cache exists and is valid, otherwise returns None.""" | |
|
168 | newhash = cachehash(repo, hideable) | |
|
169 | return _readhiddencache(repo, cachefile, newhash) | |
|
170 | ||
|
168 | 171 | def computehidden(repo): |
|
169 | 172 | """compute the set of hidden revision to filter |
|
170 | 173 |
General Comments 0
You need to be logged in to leave comments.
Login now