Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 24159:5b4ed033390b stable 3.3.1
revisionbranchcache: fall back to slow path if starting readonly (issue4531)
Transitioning to Mercurial versions with revision branch cache could be slow as
long as all operations were readonly (revset queries) and the cache would be
populated but not written back.
Instead, fall back to using the consistently slow path when readonly and the
cache doesn't exist yet. That avoids the overhead of populating the cache
without writing it back.
If not readonly, it will still populate all missing entries initially. That
avoids repeated writing of the cache file with small updates, and it also makes
sure a fully populated cache available for the readonly operations.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 06 Feb 2015 02:52:10 +0100 |
parents | 38824c53c2f1 |
children | bb11081562d7 |
comparison
equal
deleted
inserted
replaced
24158:d414c28db84d | 24159:5b4ed033390b |
---|---|
525 use the prefix `literal:`. | 525 use the prefix `literal:`. |
526 """ | 526 """ |
527 import branchmap | 527 import branchmap |
528 urepo = repo.unfiltered() | 528 urepo = repo.unfiltered() |
529 ucl = urepo.changelog | 529 ucl = urepo.changelog |
530 getbi = branchmap.revbranchcache(urepo).branchinfo | 530 getbi = branchmap.revbranchcache(urepo, readonly=True).branchinfo |
531 | 531 |
532 try: | 532 try: |
533 b = getstring(x, '') | 533 b = getstring(x, '') |
534 except error.ParseError: | 534 except error.ParseError: |
535 # not a string, but another revspec, e.g. tip() | 535 # not a string, but another revspec, e.g. tip() |