comparison mercurial/changegroup.py @ 32268:24f55686a63d

caches: stop warming the cache after changegroup application Now that we garantee that branchmap cache is updated at the end of the transaction we can drop this update. This removes a problematic case with nested transaction where the new cache could be written on disk before the transaction is finished (and even roll-backed) Such premature cache write was visible in the following test: * tests/test-acl.t * tests/test-rebase-conflicts.t In addition, running the cache update later means having more date about the state of the repository (in particular: phases). So we can generate caches with more information. This creates harmless changes to the following tests: * tests/test-hardlinks-whitelisted.t * tests/test-hardlinks.t * tests/test-phases.t * tests/test-tags.t * tests/test-inherit-mode.t
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 02 May 2017 18:57:52 +0200
parents c2380b448265
children df3cf9422e1b
comparison
equal deleted inserted replaced
32267:c2380b448265 32268:24f55686a63d
18 nullrev, 18 nullrev,
19 short, 19 short,
20 ) 20 )
21 21
22 from . import ( 22 from . import (
23 branchmap,
24 dagutil, 23 dagutil,
25 discovery, 24 discovery,
26 error, 25 error,
27 mdiff, 26 mdiff,
28 phases, 27 phases,
402 # 401 #
403 # strip should not touch boundary at all 402 # strip should not touch boundary at all
404 phases.retractboundary(repo, tr, targetphase, added) 403 phases.retractboundary(repo, tr, targetphase, added)
405 404
406 if changesets > 0: 405 if changesets > 0:
407 if srctype != 'strip':
408 # During strip, branchcache is invalid but
409 # coming call to `destroyed` will repair it.
410 # In other case we can safely update cache on
411 # disk.
412 branchmap.updatecache(repo.filtered('served'))
413 406
414 def runhooks(): 407 def runhooks():
415 # These hooks run when the lock releases, not when the 408 # These hooks run when the lock releases, not when the
416 # transaction closes. So it's possible for the changelog 409 # transaction closes. So it's possible for the changelog
417 # to have changed since we last saw it. 410 # to have changed since we last saw it.