Mercurial > hg
annotate tests/test-journal-exists.t @ 24735:07200e3332a1
tags: extract .hgtags filenodes cache to a standalone file
Resolution of .hgtags filenodes values has historically been a
performance pain point for large repositories, where reading individual
manifests can take over 100ms. Multiplied by hundreds or even thousands
of heads and resolving .hgtags filenodes becomes a performance issue.
This patch establishes a standalone cache file holding the .hgtags
filenodes for each changeset. After this patch, the .hgtags filenode
for any particular changeset should only have to be computed once
during the lifetime of the repository.
The introduced hgtagsfnodes1 cache file is modeled after the rev branch
cache: the cache is effectively an array of entries consisting of a
changeset fragment and the filenode for a revision. The file grows in
proportion to the length of the repository (24 bytes per changeset) and
is truncated when the repository is stripped. The file is not written
unless tag info is requested and tags have changed since last time.
This patch partially addresses issue4550. Future patches will split the
"tags" cache file into per-filter files and will refactor the cache
format to not capture the .hgtags fnodes, as these are now stored in
the hgtagsfnodes1 cache. This patch is capable of standing alone. We
should not have to wait on the tags cache filter split and format
refactor for this patch to land.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 15 Apr 2015 17:42:38 -0400 |
parents | 3b4c75690206 |
children | f1186c292d03 |
rev | line source |
---|---|
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
1 $ hg init |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
2 $ echo a > a |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
3 $ hg ci -Am0 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
4 adding a |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
6 $ hg -q clone . foo |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
7 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
8 $ touch .hg/store/journal |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
9 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
10 $ echo foo > a |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
11 $ hg ci -Am0 |
21274
3b4c75690206
journal: set Abort hint when failing due to an abandoned transaction
Johan Bjork <jbjoerk@gmail.com>
parents:
20008
diff
changeset
|
12 abort: abandoned transaction found! |
3b4c75690206
journal: set Abort hint when failing due to an abandoned transaction
Johan Bjork <jbjoerk@gmail.com>
parents:
20008
diff
changeset
|
13 (run 'hg recover' to clean up transaction) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12205
diff
changeset
|
14 [255] |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
15 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
16 $ hg recover |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
17 rolling back interrupted transaction |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
18 checking changesets |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
19 checking manifests |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
20 crosschecking files in changesets and manifests |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
21 checking files |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
22 1 files, 1 changesets, 1 total revisions |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
23 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
24 Check that zero-size journals are correctly aborted: |
9693
c40a1ee20aa5
transaction: always remove empty journal on abort
Sune Foldager <cryo@cyanite.org>
parents:
5867
diff
changeset
|
25 |
20008
e54a078153f7
tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents:
16959
diff
changeset
|
26 #if unix-permissions no-root |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
27 $ hg bundle -qa repo.hg |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
28 $ chmod -w foo/.hg/store/00changelog.i |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
29 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
30 $ hg -R foo unbundle repo.hg |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
31 adding changesets |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12376
diff
changeset
|
32 abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12205
diff
changeset
|
33 [255] |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
34 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
35 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi |
16959
acba1281e064
test-journal-exists: use #if
Adrian Buehlmann <adrian@cadifra.com>
parents:
15443
diff
changeset
|
36 #endif |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
37 |