##// END OF EJS Templates
localrepo: recreate phasecache if changelog was modified (issue4855)...
Yuya Nishihara -
r26408:2b31d863 default
parent child Browse files
Show More
@@ -434,7 +434,10 b' class localrepository(object):'
434 heads.append(n)
434 heads.append(n)
435 return heads
435 return heads
436
436
437 @storecache('phaseroots')
437 # _phaserevs and _phasesets depend on changelog. what wee need is to
438 # call _phasecache.invalidate() if '00changelog.i' was changed, but it
439 # can't be easily expressed in filecache mechanism.
440 @storecache('phaseroots', '00changelog.i')
438 def _phasecache(self):
441 def _phasecache(self):
439 return phases.phasecache(self, self._phasedefaults)
442 return phases.phasecache(self, self._phasedefaults)
440
443
@@ -366,6 +366,49 b' check that local configs for the cached '
366 *** runcommand status -i -u
366 *** runcommand status -i -u
367 I ignored-file
367 I ignored-file
368
368
369 cache of non-public revisions should be invalidated on repository change
370 (issue4855):
371
372 >>> import os
373 >>> from hgclient import readchannel, runcommand, check
374 >>> @check
375 ... def phasesetscacheaftercommit(server):
376 ... readchannel(server)
377 ... # load _phasecache._phaserevs and _phasesets
378 ... runcommand(server, ['log', '-qr', 'draft()'])
379 ... # create draft commits by another process
380 ... for i in xrange(5, 7):
381 ... os.system('echo a >> a')
382 ... os.system('hg commit -Aqm%d' % i)
383 ... # new commits should be listed as draft revisions
384 ... runcommand(server, ['log', '-qr', 'draft()'])
385 *** runcommand log -qr draft()
386 4:7966c8e3734d
387 *** runcommand log -qr draft()
388 4:7966c8e3734d
389 5:41f6602d1c4f
390 6:10501e202c35
391
392 >>> import os
393 >>> from hgclient import readchannel, runcommand, check
394 >>> @check
395 ... def phasesetscacheafterstrip(server):
396 ... readchannel(server)
397 ... # load _phasecache._phaserevs and _phasesets
398 ... runcommand(server, ['log', '-qr', 'draft()'])
399 ... # strip cached revisions by another process
400 ... os.system('hg --config extensions.strip= strip -q 5')
401 ... # shouldn't abort by "unknown revision '6'"
402 ... runcommand(server, ['log', '-qr', 'draft()'])
403 *** runcommand log -qr draft()
404 4:7966c8e3734d
405 5:41f6602d1c4f
406 6:10501e202c35
407 *** runcommand log -qr draft()
408 4:7966c8e3734d
409
410 cache of phase roots should be invalidated on strip (issue3827):
411
369 >>> import os
412 >>> import os
370 >>> from hgclient import readchannel, sep, runcommand, check
413 >>> from hgclient import readchannel, sep, runcommand, check
371 >>> @check
414 >>> @check
General Comments 0
You need to be logged in to leave comments. Login now