Mercurial > hg
annotate tests/test-journal-exists.t @ 42621:99ebde4fec99
commit: improve the files field of changelog for merges
Currently, the files list of merge commits repeats all the deletions
(either actual deletions, or files that got renamed) that happened
between base and p2 of the merge. If p2 is the main branch, the list
can easily be much bigger than the change being merged.
This results in various problems worth improving:
- changelog is bigger than necessary
- `hg log directory` lists many unrelated merge commits, and `hg log
-v -r commit` frequently fills multiple screens worth of files
- it possibly slows down adjustlinkrev, by forcing it to read more
manifests, and that function can certainly be a bottleneck
- the server side of pulls can waste a lot of time simply opening the
filelogs for pointless files (the constant factors for opening even
a tiny filelog is apparently pretty bad)
So stop listing such files as described in the code. Impacted merge
commits and their descendants get a different hash than they would
have without this. This doesn't seem problematic, except for
convert. The previous commit helped with that in the hg->hg case (but
if you do svn->hg twice from scratch, hashes can still change).
The rest of the description is numbers. I don't have much to report,
because recreating the files list of existing repositories is not
easy:
- debugupgradeformat and bundle/unbundle don't recreate the list
- export/import tends to choke quickly applying patches or on
description that contain diffs,
- merge commits from the convert extension don't have the right files
list for reasons orthogonal to the current commit
- replaying the merge with hg update/hg merge/hg revert --all/hg
commit can end up failing in hg revert
- I wasn't sure that using debugsetparents + debugrebuilddirstate
would really build the right thing
I measured commit time before and after this change, in a case with no
files filtered out, several files filtered out (no difference) and 5k
files filtered out (+1% time).
Recreating the 100 more recent merges in a private repo, the
concatenated uncompressed files lists goes from 1.12MB to
0.52MB. Excluding 3 merges that are not representative, then the size
goes from 570k to 15k.
I converted part of mozilla-central, and observed file list shrinking
quite a bit too, starting at the very first merge, 733641d9feaf, going
from 550 files to 10 files (although they have relatively few merges,
so they probably wouldn't care).
Differential Revision: https://phab.mercurial-scm.org/D6613
author | Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> |
---|---|
date | Tue, 02 Jul 2019 12:59:58 -0400 |
parents | 013de80bf90e |
children | e96ed3a61899 |
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 |
39489
f1186c292d03
verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents:
21274
diff
changeset
|
22 checked 1 changesets with 1 changes to 1 files |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
23 |
42144
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
24 recover, explicite verify |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
25 |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
26 $ touch .hg/store/journal |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
27 $ hg ci -Am0 |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
28 abort: abandoned transaction found! |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
29 (run 'hg recover' to clean up transaction) |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
30 [255] |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
31 $ hg recover --verify |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
32 rolling back interrupted transaction |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
33 checking changesets |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
34 checking manifests |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
35 crosschecking files in changesets and manifests |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
36 checking files |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
37 checked 1 changesets with 1 changes to 1 files |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
38 |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
39 recover, no verify |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
40 |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
41 $ touch .hg/store/journal |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
42 $ hg ci -Am0 |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
43 abort: abandoned transaction found! |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
44 (run 'hg recover' to clean up transaction) |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
45 [255] |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
46 $ hg recover --no-verify |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
47 rolling back interrupted transaction |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
48 (verify step skipped, run `hg verify` to check your repository content) |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
49 |
013de80bf90e
recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
41420
diff
changeset
|
50 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
51 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
|
52 |
20008
e54a078153f7
tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents:
16959
diff
changeset
|
53 #if unix-permissions no-root |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
54 $ hg bundle -qa repo.hg |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
55 $ chmod -w foo/.hg/store/00changelog.i |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
56 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
57 $ hg -R foo unbundle repo.hg |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
58 adding changesets |
41420
b6673e9bdcf6
dispatch: quote filename in IOError as well
Yuya Nishihara <yuya@tcha.org>
parents:
39489
diff
changeset
|
59 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
|
60 [255] |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
61 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
62 $ 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
|
63 #endif |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
64 |