Show More
@@ -352,17 +352,25 b' class branchcache(object):' | |||
|
352 | 352 | return filename |
|
353 | 353 | |
|
354 | 354 | def validfor(self, repo): |
|
355 |
""" |
|
|
355 | """check that cache contents are valid for (a subset of) this repo | |
|
356 | 356 | |
|
357 |
- False when |
|
|
358 |
- True when cache is up |
|
|
357 | - False when the order of changesets changed or if we detect a strip. | |
|
358 | - True when cache is up-to-date for the current repo or its subset.""" | |
|
359 | 359 | try: |
|
360 |
|
|
|
361 | self.filteredhash | |
|
362 | == scmutil.filteredhash(repo, self.tiprev, needobsolete=True) | |
|
363 | ) | |
|
360 | node = repo.changelog.node(self.tiprev) | |
|
364 | 361 | except IndexError: |
|
362 | # changesets were stripped and now we don't even have enough to | |
|
363 | # find tiprev | |
|
365 | 364 | return False |
|
365 | if self.tipnode != node: | |
|
366 | # tiprev doesn't correspond to tipnode: repo was stripped, or this | |
|
367 | # repo has a different order of changesets | |
|
368 | return False | |
|
369 | tiphash = scmutil.filteredhash(repo, self.tiprev, needobsolete=True) | |
|
370 | # hashes don't match if this repo view has a different set of filtered | |
|
371 | # revisions (e.g. due to phase changes) or obsolete revisions (e.g. | |
|
372 | # history was rewritten) | |
|
373 | return self.filteredhash == tiphash | |
|
366 | 374 | |
|
367 | 375 | def _branchtip(self, heads): |
|
368 | 376 | """Return tuple with last open head in heads and false, |
General Comments 0
You need to be logged in to leave comments.
Login now