diff tests/test-revset2.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 f3365065ef1d
children fc4fb2f17dd4
line wrap: on
line diff
--- a/tests/test-revset2.t	Sat Jul 13 23:45:32 2019 -0400
+++ b/tests/test-revset2.t	Tue Jul 02 12:59:58 2019 -0400
@@ -100,7 +100,6 @@
   $ log 'parents(outgoing() or removes(a))'
   1
   4
-  5
   8
 
 test that `or` operation combines elements in the right order:
@@ -805,17 +804,17 @@
 (real pair)
 
   $ hg diff -r 'tip^^' -r 'tip'
-  diff -r 2326846efdab -r 24286f4ae135 .hgtags
+  diff -r 2326846efdab -r d2e607fcf9e4 .hgtags
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
-  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
+  +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0
   $ hg diff -r 'tip^^::tip'
-  diff -r 2326846efdab -r 24286f4ae135 .hgtags
+  diff -r 2326846efdab -r d2e607fcf9e4 .hgtags
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
-  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
+  +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0
 
 (single rev)
 
@@ -829,13 +828,13 @@
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/.hgtags	* (glob)
   @@ -0,0 +1,1 @@
-  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
+  +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0
   $ hg diff -r 'tip^ or tip^'
   diff -r d5d0dcbdc4d9 .hgtags
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/.hgtags	* (glob)
   @@ -0,0 +1,1 @@
-  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
+  +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0
 
 (no rev)
 
@@ -1231,59 +1230,59 @@
 
 issue4553: check that revset aliases override existing hash prefix
 
-  $ hg log -qr e
-  6:e0cc66ef77e8
+  $ hg log -qr d5e
+  6:d5e6808a8607
 
-  $ hg log -qr e --config revsetalias.e="all()"
+  $ hg log -qr d5e --config revsetalias.d5e="all()"
   0:2785f51eece5
   1:d75937da8da0
   2:5ed5505e9f1c
   3:8528aa5637f2
   4:2326846efdab
   5:904fa392b941
-  6:e0cc66ef77e8
-  7:013af1973af4
+  6:d5e6808a8607
+  7:586353d483b3
   8:d5d0dcbdc4d9
-  9:24286f4ae135
+  9:d2e607fcf9e4
 
-  $ hg log -qr e: --config revsetalias.e="0"
+  $ hg log -qr d5e: --config revsetalias.d5e="0"
   0:2785f51eece5
   1:d75937da8da0
   2:5ed5505e9f1c
   3:8528aa5637f2
   4:2326846efdab
   5:904fa392b941
-  6:e0cc66ef77e8
-  7:013af1973af4
+  6:d5e6808a8607
+  7:586353d483b3
   8:d5d0dcbdc4d9
-  9:24286f4ae135
+  9:d2e607fcf9e4
 
-  $ hg log -qr :e --config revsetalias.e="9"
+  $ hg log -qr :d5e --config revsetalias.d5e="9"
   0:2785f51eece5
   1:d75937da8da0
   2:5ed5505e9f1c
   3:8528aa5637f2
   4:2326846efdab
   5:904fa392b941
-  6:e0cc66ef77e8
-  7:013af1973af4
+  6:d5e6808a8607
+  7:586353d483b3
   8:d5d0dcbdc4d9
-  9:24286f4ae135
+  9:d2e607fcf9e4
 
-  $ hg log -qr e:
-  6:e0cc66ef77e8
-  7:013af1973af4
+  $ hg log -qr d5e:
+  6:d5e6808a8607
+  7:586353d483b3
   8:d5d0dcbdc4d9
-  9:24286f4ae135
+  9:d2e607fcf9e4
 
-  $ hg log -qr :e
+  $ hg log -qr :d5e
   0:2785f51eece5
   1:d75937da8da0
   2:5ed5505e9f1c
   3:8528aa5637f2
   4:2326846efdab
   5:904fa392b941
-  6:e0cc66ef77e8
+  6:d5e6808a8607
 
 issue2549 - correct optimizations
 
@@ -1471,7 +1470,7 @@
 (check operator priority)
 
   $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
-  $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
+  $ log "cat2n2(2785f5, 1eece5, d2e607, fcf9e4)"
   0
   4