Mercurial > evolve
diff tests/test-inhibit.t @ 1714:4565b046b850
directaccess: make sure gethashsymbols does not return rev numbers
With "hg log -r 1 -r 2 -r 3", gethashsymbols will get the following tree:
('func', ('symbol', '_list'), ('string', '1\x002\x003'))
Before this patch, it will return ['1', '2', '3'], which are revision
numbers and causes unnecessary (expensive) partialmatch lookups.
This patch refacts gethashsymbols a bit, making sure the returning values
are always filtered.
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 22 Jun 2016 18:22:17 +0100 |
parents | 27445da063b7 |
children | 83cf722eafc3 9f42f819267b |
line wrap: on
line diff
--- a/tests/test-inhibit.t Wed Jun 15 15:19:38 2016 -0700 +++ b/tests/test-inhibit.t Wed Jun 22 18:22:17 2016 +0100 @@ -375,6 +375,21 @@ cf5c4f4554ce 2db36d8066ff +Test directaccess only takes hashes + + $ HOOKPATH=$TESTTMP/printexplicitaccess.py + $ cat >> $HOOKPATH <<EOF + > def hook(ui, repo, **kwds): + > for i in sorted(repo._explicitaccess): + > ui.write('directaccess: %s\n' % i) + > EOF + + $ hg log -r 1 -r 2 -r 2db36d8066f -T '{rev}\n' --config hooks.post-log=python:$HOOKPATH:hook + 1 + 2 + 3 + directaccess: 3 + With severals hidden sha, rebase of one hidden stack onto another one: $ hg update -C 0 0 files updated, 0 files merged, 4 files removed, 0 files unresolved