sapling/tests/test-linkrevcache.t
Jun Wu 127bd207b5 linkrevcache: wrap _adjustlinkrev to take advantage of the linkrev database
Summary:
Wrap `_adjustlinkrev` so it first tries the possibly faster path (linkrev
database). Then fallback to the original linkrev algorithm.

Also fixes an issue that `{k : v ...}` syntax does not work in Python 2.6.

Test Plan: Added a very simple test

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham, stash, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4143315

Signature: t1:4143315:1479234110:07e87c7584e0cfd627b3f9e2fae1a2a34beb390f
2016-11-14 18:04:29 +00:00

30 lines
723 B
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> linkrevcache=$TESTDIR/../hgext3rd/linkrevcache.py
> EOF
$ hg init repo
$ cd repo
$ touch a
$ hg ci -A a -m a
$ echo 1 >> a
$ hg ci -A a -m a1
$ hg up '.^' -q
$ hg graft --log 1 -q
$ hg log -G -T '{rev}:{node} {desc}\n'
@ 2:e048e956c6a8c0f6108497df043989578ad97cc2 a1
| (grafted from da7a5140a61110d9ec1a678a11e796a71638dd6f)
| o 1:da7a5140a61110d9ec1a678a11e796a71638dd6f a1
|/
o 0:3903775176ed42b1458a6281db4a0ccf4d9f287a a
$ hg debugbuildlinkrevcache --debug
a@d0c79e1d33097a72f79cb2e5a81c685e8f688d45: new linkrev 2
$ hg debugverifylinkrevcache
1 entries verified
$ hg annotate a -r 1
1: 1
$ hg annotate a -r 2
2: 1