Show More
@@ -148,6 +148,21 b' class branchcache(dict):' | |||||
148 | This field can be used to avoid changelog reads when determining if a |
|
148 | This field can be used to avoid changelog reads when determining if a | |
149 | branch head closes a branch or not. |
|
149 | branch head closes a branch or not. | |
150 | """ |
|
150 | """ | |
|
151 | ||||
|
152 | def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev, | |||
|
153 | filteredhash=None, closednodes=None): | |||
|
154 | super(branchcache, self).__init__(entries) | |||
|
155 | self.tipnode = tipnode | |||
|
156 | self.tiprev = tiprev | |||
|
157 | self.filteredhash = filteredhash | |||
|
158 | # closednodes is a set of nodes that close their branch. If the branch | |||
|
159 | # cache has been updated, it may contain nodes that are no longer | |||
|
160 | # heads. | |||
|
161 | if closednodes is None: | |||
|
162 | self._closednodes = set() | |||
|
163 | else: | |||
|
164 | self._closednodes = closednodes | |||
|
165 | ||||
151 | @classmethod |
|
166 | @classmethod | |
152 | def fromfile(cls, repo): |
|
167 | def fromfile(cls, repo): | |
153 | f = None |
|
168 | f = None | |
@@ -207,20 +222,6 b' class branchcache(dict):' | |||||
207 | filename = '%s-%s' % (filename, repo.filtername) |
|
222 | filename = '%s-%s' % (filename, repo.filtername) | |
208 | return filename |
|
223 | return filename | |
209 |
|
224 | |||
210 | def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev, |
|
|||
211 | filteredhash=None, closednodes=None): |
|
|||
212 | super(branchcache, self).__init__(entries) |
|
|||
213 | self.tipnode = tipnode |
|
|||
214 | self.tiprev = tiprev |
|
|||
215 | self.filteredhash = filteredhash |
|
|||
216 | # closednodes is a set of nodes that close their branch. If the branch |
|
|||
217 | # cache has been updated, it may contain nodes that are no longer |
|
|||
218 | # heads. |
|
|||
219 | if closednodes is None: |
|
|||
220 | self._closednodes = set() |
|
|||
221 | else: |
|
|||
222 | self._closednodes = closednodes |
|
|||
223 |
|
||||
224 | def validfor(self, repo): |
|
225 | def validfor(self, repo): | |
225 | """Is the cache content valid regarding a repo |
|
226 | """Is the cache content valid regarding a repo | |
226 |
|
227 |
General Comments 0
You need to be logged in to leave comments.
Login now