Show More
@@ -150,7 +150,10 b' class branchcache(object):' | |||
|
150 | 150 | """ |
|
151 | 151 | |
|
152 | 152 | def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev, |
|
153 | filteredhash=None, closednodes=None): | |
|
153 | filteredhash=None, closednodes=None, hasnode=None): | |
|
154 | """ hasnode is a function which can be used to verify whether changelog | |
|
155 | has a given node or not. If it's not provided, we assume that every node | |
|
156 | we have exists in changelog """ | |
|
154 | 157 | self.tipnode = tipnode |
|
155 | 158 | self.tiprev = tiprev |
|
156 | 159 | self.filteredhash = filteredhash |
@@ -166,6 +169,9 b' class branchcache(object):' | |||
|
166 | 169 | self._closedverified = False |
|
167 | 170 | # branches for which nodes are verified |
|
168 | 171 | self._verifiedbranches = set() |
|
172 | self._hasnode = hasnode | |
|
173 | if self._hasnode is None: | |
|
174 | self._hasnode = lambda x: True | |
|
169 | 175 | |
|
170 | 176 | def __iter__(self): |
|
171 | 177 | return iter(self._entries) |
@@ -193,9 +199,11 b' class branchcache(object):' | |||
|
193 | 199 | last, lrev = cachekey[:2] |
|
194 | 200 | last, lrev = bin(last), int(lrev) |
|
195 | 201 | filteredhash = None |
|
202 | hasnode = repo.changelog.hasnode | |
|
196 | 203 | if len(cachekey) > 2: |
|
197 | 204 | filteredhash = bin(cachekey[2]) |
|
198 |
bcache = cls(tipnode=last, tiprev=lrev, filteredhash=filteredhash |
|
|
205 | bcache = cls(tipnode=last, tiprev=lrev, filteredhash=filteredhash, | |
|
206 | hasnode=hasnode) | |
|
199 | 207 | if not bcache.validfor(repo): |
|
200 | 208 | # invalidate the cache |
|
201 | 209 | raise ValueError(r'tip differs') |
General Comments 0
You need to be logged in to leave comments.
Login now