Mercurial > hg
comparison tests/test-keyword.t @ 16101:20ad8f0512a2 stable
mq: restore _branchtags() fast path (issue3223)
Since a5917346c72e, mq saves the nodeid of the first applied patch to
cache/branchheads, which breaks the optimized cache handling introduced in
fbf8320f25c8. The problem is the revision being committed is appended to
mqrepo.applied after the commit succeeds, which means mqrepo._branchtags()
performs a regular update and write the first applied patch to the branch
cache.
One solution is to set a context variable _committingpatch on the mqrepo while
it is committing a patch and to take it in account when deciding to fast-path
mqrepo._branchtags(). Not really elegant but it works.
The changes to test-mq-caches.t reverse changes introduced by a5917346c72e. The
cache should not have been updated with mq records.
The changes to test-keyword.t are indirectly caused by a5917346c72e.
Reported and analyzed by Yuya Nishihara <yuya@tcha.org>
Notes:
- qpush still makes a slow path _branchtags() call when checking heads. Maybe
this can be optimized.
- be careful when merging this patch in default as secretcommit() was renamed
newcommit() right after the end of the code freeze.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Tue, 07 Feb 2012 18:47:16 +0100 |
parents | c6c9b83a1e8a |
children | 46b991a1f428 4f795f5fbb0b |
comparison
equal
deleted
inserted
replaced
16100:24df9338aa01 | 16101:20ad8f0512a2 |
---|---|
554 c | 554 c |
555 | 555 |
556 Commit and show expansion in original and copy | 556 Commit and show expansion in original and copy |
557 | 557 |
558 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' | 558 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' |
559 invalidating branch cache (tip differs) | |
560 c | 559 c |
561 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | 560 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
562 overwriting c expanding keywords | 561 overwriting c expanding keywords |
563 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d | 562 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d |
564 $ cat a c | 563 $ cat a c |