comparison tests/test-glog-beautifygraph.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 5abc47d4ca6b
children 34a46d48d24e
comparison
equal deleted inserted replaced
42620:d98ec36be808 42621:99ebde4fec99
2099 1 files changed, 1 insertions(+), 0 deletions(-) 2099 1 files changed, 1 insertions(+), 0 deletions(-)
2100 2100
2101 2101
2102 $ hg up -q 6 2102 $ hg up -q 6
2103 $ hg log -G --git --patch --follow-first e 2103 $ hg log -G --git --patch --follow-first e
2104 \xe2\x97\x8d changeset: 6:fc281d8ff18d (esc) 2104 \xe2\x97\x8d changeset: 6:9feeac35a70a (esc)
2105 \xe2\x94\x82\xe2\x95\xb2 tag: tip (esc) 2105 \xe2\x94\x82\xe2\x95\xb2 tag: tip (esc)
2106 \xe2\x94\x82 \xe2\x95\xa7 parent: 5:99b31f1c2782 (esc) 2106 \xe2\x94\x82 \xe2\x95\xa7 parent: 5:99b31f1c2782 (esc)
2107 \xe2\x94\x82 parent: 4:17d952250a9d (esc) 2107 \xe2\x94\x82 parent: 4:17d952250a9d (esc)
2108 \xe2\x94\x82 user: test (esc) 2108 \xe2\x94\x82 user: test (esc)
2109 \xe2\x94\x82 date: Thu Jan 01 00:00:00 1970 +0000 (esc) 2109 \xe2\x94\x82 date: Thu Jan 01 00:00:00 1970 +0000 (esc)
2146 created new head 2146 created new head
2147 $ hg up -q 2 2147 $ hg up -q 2
2148 $ hg log -G --template "{rev} {desc|firstline}\n" 2148 $ hg log -G --template "{rev} {desc|firstline}\n"
2149 \xe2\x97\x8b 8 add g (esc) 2149 \xe2\x97\x8b 8 add g (esc)
2150 \xe2\x94\x82 (esc) 2150 \xe2\x94\x82 (esc)
2151 \xe2\x94\x82 \xe2\x97\x8b 7 Added tag foo-bar for changeset fc281d8ff18d (esc) 2151 \xe2\x94\x82 \xe2\x97\x8b 7 Added tag foo-bar for changeset 9feeac35a70a (esc)
2152 \xe2\x94\x82\xe2\x95\xb1 (esc) 2152 \xe2\x94\x82\xe2\x95\xb1 (esc)
2153 \xe2\x97\x8b 6 merge 5 and 4 (esc) 2153 \xe2\x97\x8b 6 merge 5 and 4 (esc)
2154 \xe2\x94\x82\xe2\x95\xb2 (esc) 2154 \xe2\x94\x82\xe2\x95\xb2 (esc)
2155 \xe2\x94\x82 \xe2\x97\x8b 5 add another e (esc) 2155 \xe2\x94\x82 \xe2\x97\x8b 5 add another e (esc)
2156 \xe2\x94\x82 \xe2\x94\x82 (esc) 2156 \xe2\x94\x82 \xe2\x94\x82 (esc)
2309 +ee 2309 +ee
2310 # HG changeset patch 2310 # HG changeset patch
2311 # User test 2311 # User test
2312 # Date 0 0 2312 # Date 0 0
2313 # Thu Jan 01 00:00:00 1970 +0000 2313 # Thu Jan 01 00:00:00 1970 +0000
2314 # Node ID fc281d8ff18d999ad6497b3d27390bcd695dcc73 2314 # Node ID 9feeac35a70aa325519bbf3178683271113f2b8f
2315 # Parent 99b31f1c2782e2deb1723cef08930f70fc84b37b 2315 # Parent 99b31f1c2782e2deb1723cef08930f70fc84b37b
2316 # Parent 17d952250a9d03cc3dc77b199ab60e959b9b0260 2316 # Parent 17d952250a9d03cc3dc77b199ab60e959b9b0260
2317 merge 5 and 4 2317 merge 5 and 4
2318 2318
2319 diff -r 99b31f1c2782 -r fc281d8ff18d dir/b 2319 diff -r 99b31f1c2782 -r 9feeac35a70a dir/b
2320 --- a/dir/b Thu Jan 01 00:00:00 1970 +0000 2320 --- a/dir/b Thu Jan 01 00:00:00 1970 +0000
2321 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2321 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2322 @@ -1,1 +0,0 @@ 2322 @@ -1,1 +0,0 @@
2323 -a 2323 -a
2324 diff -r 99b31f1c2782 -r fc281d8ff18d e 2324 diff -r 99b31f1c2782 -r 9feeac35a70a e
2325 --- a/e Thu Jan 01 00:00:00 1970 +0000 2325 --- a/e Thu Jan 01 00:00:00 1970 +0000
2326 +++ b/e Thu Jan 01 00:00:00 1970 +0000 2326 +++ b/e Thu Jan 01 00:00:00 1970 +0000
2327 @@ -1,1 +1,1 @@ 2327 @@ -1,1 +1,1 @@
2328 -ee 2328 -ee
2329 +merge 2329 +merge
2330 # HG changeset patch 2330 # HG changeset patch
2331 # User test 2331 # User test
2332 # Date 0 0 2332 # Date 0 0
2333 # Thu Jan 01 00:00:00 1970 +0000 2333 # Thu Jan 01 00:00:00 1970 +0000
2334 # Node ID 02dbb8e276b8ab7abfd07cab50c901647e75c2dd 2334 # Node ID 9febbb9c8b2e09670a2fb550cb1e4e01a2c7e9fd
2335 # Parent fc281d8ff18d999ad6497b3d27390bcd695dcc73 2335 # Parent 9feeac35a70aa325519bbf3178683271113f2b8f
2336 Added tag foo-bar for changeset fc281d8ff18d 2336 Added tag foo-bar for changeset 9feeac35a70a
2337 2337
2338 diff -r fc281d8ff18d -r 02dbb8e276b8 .hgtags 2338 diff -r 9feeac35a70a -r 9febbb9c8b2e .hgtags
2339 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2339 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2340 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 2340 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2341 @@ -0,0 +1,1 @@ 2341 @@ -0,0 +1,1 @@
2342 +fc281d8ff18d999ad6497b3d27390bcd695dcc73 foo-bar 2342 +9feeac35a70aa325519bbf3178683271113f2b8f foo-bar
2343 # HG changeset patch 2343 # HG changeset patch
2344 # User test 2344 # User test
2345 # Date 0 0 2345 # Date 0 0
2346 # Thu Jan 01 00:00:00 1970 +0000 2346 # Thu Jan 01 00:00:00 1970 +0000
2347 # Node ID 24c2e826ddebf80f9dcd60b856bdb8e6715c5449 2347 # Node ID 3bd4551ec3fe1c0696241f236abe857a53c6d6e7
2348 # Parent fc281d8ff18d999ad6497b3d27390bcd695dcc73 2348 # Parent 9feeac35a70aa325519bbf3178683271113f2b8f
2349 add g 2349 add g
2350 2350
2351 diff -r fc281d8ff18d -r 24c2e826ddeb g 2351 diff -r 9feeac35a70a -r 3bd4551ec3fe g
2352 --- a/g Thu Jan 01 00:00:00 1970 +0000 2352 --- a/g Thu Jan 01 00:00:00 1970 +0000
2353 +++ b/g Thu Jan 01 00:00:00 1970 +0000 2353 +++ b/g Thu Jan 01 00:00:00 1970 +0000
2354 @@ -1,2 +1,1 @@ 2354 @@ -1,2 +1,1 @@
2355 -f 2355 -f
2356 -f 2356 -f
2434 $ testlog --hidden 2434 $ testlog --hidden
2435 [] 2435 []
2436 [] 2436 []
2437 <spanset- 0:9> 2437 <spanset- 0:9>
2438 $ hg log -G --template '{rev} {desc}\n' 2438 $ hg log -G --template '{rev} {desc}\n'
2439 \xe2\x97\x8b 7 Added tag foo-bar for changeset fc281d8ff18d (esc) 2439 \xe2\x97\x8b 7 Added tag foo-bar for changeset 9feeac35a70a (esc)
2440 \xe2\x94\x82 (esc) 2440 \xe2\x94\x82 (esc)
2441 \xe2\x97\x8b 6 merge 5 and 4 (esc) 2441 \xe2\x97\x8b 6 merge 5 and 4 (esc)
2442 \xe2\x94\x82\xe2\x95\xb2 (esc) 2442 \xe2\x94\x82\xe2\x95\xb2 (esc)
2443 \xe2\x94\x82 \xe2\x97\x8b 5 add another e (esc) 2443 \xe2\x94\x82 \xe2\x97\x8b 5 add another e (esc)
2444 \xe2\x94\x82 \xe2\x94\x82 (esc) 2444 \xe2\x94\x82 \xe2\x94\x82 (esc)
2532 \xe2\x95\xa7 (esc) 2532 \xe2\x95\xa7 (esc)
2533 2533
2534 node template with changesetprinter: 2534 node template with changesetprinter:
2535 2535
2536 $ hg log -Gqr 5:7 --config ui.graphnodetemplate='"{rev}"' 2536 $ hg log -Gqr 5:7 --config ui.graphnodetemplate='"{rev}"'
2537 7 7:02dbb8e276b8 2537 7 7:9febbb9c8b2e
2538 \xe2\x94\x82 (esc) 2538 \xe2\x94\x82 (esc)
2539 6 6:fc281d8ff18d 2539 6 6:9feeac35a70a
2540 \xe2\x94\x82\xe2\x95\xb2 (esc) 2540 \xe2\x94\x82\xe2\x95\xb2 (esc)
2541 \xe2\x94\x82 \xe2\x95\xa7 (esc) 2541 \xe2\x94\x82 \xe2\x95\xa7 (esc)
2542 5 5:99b31f1c2782 2542 5 5:99b31f1c2782
2543 \xe2\x94\x82 (esc) 2543 \xe2\x94\x82 (esc)
2544 \xe2\x95\xa7 (esc) 2544 \xe2\x95\xa7 (esc)
2558 2558
2559 label() should just work in node template: 2559 label() should just work in node template:
2560 2560
2561 $ hg log -Gqr 7 --config extensions.color= --color=debug \ 2561 $ hg log -Gqr 7 --config extensions.color= --color=debug \
2562 > --config ui.graphnodetemplate='{label("branch.{branch}", rev)}' 2562 > --config ui.graphnodetemplate='{label("branch.{branch}", rev)}'
2563 [branch.default\xe2\x94\x827] [log.node|7:02dbb8e276b8] (esc) 2563 [branch.default\xe2\x94\x827] [log.node|7:9febbb9c8b2e] (esc)
2564 \xe2\x94\x82 (esc) 2564 \xe2\x94\x82 (esc)
2565 \xe2\x95\xa7 (esc) 2565 \xe2\x95\xa7 (esc)
2566 2566
2567 $ cd .. 2567 $ cd ..
2568 2568