mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
667d10975b
Revlog can now be configured to store full snapshot only. This is used on the changelog. However, the changegroup packing was still recomputing deltas to be sent over the wire. We now just reuse the full snapshot directly in this case, skipping delta computation. This provides use with a large speed up(-30%): # perfchangegroupchangelog on mercurial ! wall 2.010326 comb 2.020000 user 2.000000 sys 0.020000 (best of 5) ! wall 1.382039 comb 1.380000 user 1.370000 sys 0.010000 (best of 8) # perfchangegroupchangelog on pypy ! wall 5.792589 comb 5.780000 user 5.780000 sys 0.000000 (best of 3) ! wall 3.911158 comb 3.920000 user 3.900000 sys 0.020000 (best of 3) # perfchangegroupchangelog on mozilla central ! wall 20.683727 comb 20.680000 user 20.630000 sys 0.050000 (best of 3) ! wall 14.190204 comb 14.190000 user 14.150000 sys 0.040000 (best of 3) Many tests have to be updated because of the change in bundle content. All theses update have been verified. Because diffing changelog was not very valuable, the resulting bundle have similar size (often a bit smaller): # full bundle of mozilla central with delta: 1142740533B without delta: 1142173300B So this is a win all over the board.
155 lines
4.6 KiB
Perl
155 lines
4.6 KiB
Perl
Test changesets filtering during exchanges (some tests are still in
|
|
test-obsolete.t)
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [experimental]
|
|
> evolution=createmarkers
|
|
> EOF
|
|
|
|
Push does not corrupt remote
|
|
----------------------------
|
|
|
|
Create a DAG where a changeset reuses a revision from a file first used in an
|
|
extinct changeset.
|
|
|
|
$ hg init local
|
|
$ cd local
|
|
$ echo 'base' > base
|
|
$ hg commit -Am base
|
|
adding base
|
|
$ echo 'A' > A
|
|
$ hg commit -Am A
|
|
adding A
|
|
$ hg up 0
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
$ hg revert -ar 1
|
|
adding A
|
|
$ hg commit -Am "A'"
|
|
created new head
|
|
$ hg log -G --template='{desc} {node}'
|
|
@ A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
|
|
|
|
|
| o A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
|
|
|/
|
|
o base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
|
|
|
|
$ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
|
|
|
|
Push it. The bundle should not refer to the extinct changeset.
|
|
|
|
$ hg init ../other
|
|
$ hg push ../other
|
|
pushing to ../other
|
|
searching for changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 2 changesets with 2 changes to 2 files
|
|
$ hg -R ../other verify
|
|
checking changesets
|
|
checking manifests
|
|
crosschecking files in changesets and manifests
|
|
checking files
|
|
2 files, 2 changesets, 2 total revisions
|
|
|
|
Adding a changeset going extinct locally
|
|
------------------------------------------
|
|
|
|
Pull a changeset that will immediatly goes extinct (because you already have a
|
|
marker to obsolete him)
|
|
(test resolution of issue3788)
|
|
|
|
$ hg phase --draft --force f89bcc95eba5
|
|
$ hg phase -R ../other --draft --force f89bcc95eba5
|
|
$ hg commit --amend -m "A''"
|
|
$ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
|
|
$ hg pull ../other
|
|
pulling from ../other
|
|
searching for changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 1 changesets with 0 changes to 1 files (+1 heads)
|
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
|
|
|
check that bundle is not affected
|
|
|
|
$ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
|
|
1 changesets found
|
|
$ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
|
|
$ hg unbundle ../f89bcc95eba5.hg
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 1 changesets with 0 changes to 1 files (+1 heads)
|
|
(run 'hg heads' to see heads)
|
|
$ cd ..
|
|
|
|
pull does not fetch excessive changesets when common node is hidden (issue4982)
|
|
-------------------------------------------------------------------------------
|
|
|
|
initial repo with server and client matching
|
|
|
|
$ hg init pull-hidden-common
|
|
$ cd pull-hidden-common
|
|
$ touch foo
|
|
$ hg -q commit -A -m initial
|
|
$ echo 1 > foo
|
|
$ hg commit -m 1
|
|
$ echo 2a > foo
|
|
$ hg commit -m 2a
|
|
$ cd ..
|
|
$ hg clone --pull pull-hidden-common pull-hidden-common-client
|
|
requesting all changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 3 changesets with 3 changes to 1 files
|
|
updating to branch default
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
server obsoletes the old head
|
|
|
|
$ cd pull-hidden-common
|
|
$ hg -q up -r 1
|
|
$ echo 2b > foo
|
|
$ hg -q commit -m 2b
|
|
$ hg debugobsolete 6a29ed9c68defff1a139e5c6fa9696fb1a75783d bec0734cd68e84477ba7fc1d13e6cff53ab70129
|
|
$ cd ..
|
|
|
|
client only pulls down 1 changeset
|
|
|
|
$ cd pull-hidden-common-client
|
|
$ hg pull --debug
|
|
pulling from $TESTTMP/pull-hidden-common (glob)
|
|
query 1; heads
|
|
searching for changes
|
|
taking quick initial sample
|
|
query 2; still undecided: 2, sample size is: 2
|
|
2 total queries
|
|
1 changesets found
|
|
list of changesets:
|
|
bec0734cd68e84477ba7fc1d13e6cff53ab70129
|
|
listing keys for "phases"
|
|
listing keys for "bookmarks"
|
|
bundle2-output-bundle: "HG20", 3 parts total
|
|
bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
|
|
bundle2-output-part: "listkeys" (params: 1 mandatory) 58 bytes payload
|
|
bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
|
|
bundle2-input-bundle: with-transaction
|
|
bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
|
|
adding changesets
|
|
add changeset bec0734cd68e
|
|
adding manifests
|
|
adding file changes
|
|
adding foo revisions
|
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
|
updating the branch cache
|
|
bundle2-input-part: total payload size 476
|
|
bundle2-input-part: "listkeys" (params: 1 mandatory) supported
|
|
bundle2-input-part: total payload size 58
|
|
bundle2-input-part: "listkeys" (params: 1 mandatory) supported
|
|
bundle2-input-bundle: 2 parts total
|
|
checking for updated bookmarks
|
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|