Commit Graph

13 Commits

Author SHA1 Message Date
Jun Wu
94565d0386 lz4: use Rust lz4 binding
Summary:
Drop dependency of `python-lz4`.

Add some convertions from bytearray to bytes to make code compatible.

Reviewed By: DurhamG

Differential Revision: D13516212

fbshipit-source-id: 89beb0aa92be4c5442a8e837f509e1eb17bb1512
2018-12-20 17:54:22 -08:00
Jun Wu
4b5df986f1 remotefilelog: use latest supported version for mutabledatapack
Summary:
This fixes LFS compatibility with packlocaldata.

Also drop the config as the default version is 1 now.

Reviewed By: DurhamG

Differential Revision: D13469486

fbshipit-source-id: 1dc4a1051667419d7aab97bf95f93cacd166468a
2018-12-15 16:27:04 -08:00
Durham Goode
742de6048e tests: update p2p test to use different caches for different peers
Summary:
An upcoming diff changes the way we use the hgcache and this test is
mildly affected because it has two local peers using the same cache. Let's
change the test so the two peers use different caches, that way the test
requires no changes for the next diff.

Reviewed By: phillco

Differential Revision: D8670681

fbshipit-source-id: acd0051aa07974fa6dc2850f69957ff9ae701c83
2018-06-29 15:51:39 -07:00
Mark Thomas
78a14a1687 remotefilelog: don't process manifests when not necessary
Summary:
When building a bundle that will be used for a pull that can't use the linkrev
fastpath, we need to process the manifests of the commits for which we will
send files so that we can correctly set up their linkrevs.  Currently this is
sometimes happening for all commits, which can be very slow when pulling a
large number of commits.

First, make it clearer what `LocalFiles` and `LocalTrees` means, and make it
easier to test for trees being local.

Second, when processing manifests looking for files that will be included in
the bundle, don't process non-local trees if we are only interested in local
trees.

Third, correctly determine whether to send all, local, or no trees or files
depending on what combinations of treemanifest and remotefilelog the client and
server support, and what operation is taking place.

Finally, we aren't passing `b2caps` through to `changegroup.makestream` in the
changegroup part generator for bundle2 parts.  This means the above test for
whether the client supports treemanifest always failed.

With these combined changes, a pull of a specific public revision (so not
following the fastpath) where the client supports both remotefilelog and
treemanifest, will result in the server using `LocalFiles` and `LocalTrees`,
and therefore not processing the manifests of public commits looking for which
files to send.

Reviewed By: DurhamG, ikostia

Differential Revision: D8446137

fbshipit-source-id: 9a4247af75fe79c1962a29fcb8bf0181868699f4
2018-06-19 10:20:07 -07:00
Mark Thomas
e41f0630e5 treemanifest: more logging for fetching trees
Summary:
Make the (user-facing) log for prefetching trees say how many commits (or which
commit) it is prefetching for.

When remotefilelog.debug is enabled, print out the manifest identity when
fetching a tree during normal operation.

Reviewed By: quark-zju

Differential Revision: D8056555

fbshipit-source-id: dc0c7bc5c949a0674d5f553661e736bc545134b4
2018-05-24 07:19:20 -07:00
Durham Goode
5e95b0e32e treemanifest: change heuristic for sending local trees
Summary:
Previously if we were pulling between peers, we would not send trees
for public commits, since we assumed the receiving end could fetch them from the
server.

It turns out there are situations where public commits are actually local only
to the client (like when pulling directly from subversion before the server
does), so let's change our heuristic to send trees if they exist in the source
client's local data store.

This also required updating the server side tree pack generation logic to handle
the case when the client sends a base manifest node that the server doesn't know
how to handle. We now ignore those bad base manifests.

Reviewed By: phillco

Differential Revision: D7992502

fbshipit-source-id: 8ddd1836e6f325363ad2bb6eae34ddbbc84c2d11
2018-05-18 10:46:59 -07:00
Durham Goode
50392ae4cf hg: fix linknodes in new trees
Summary:
Previously we were just putting nullid as the linknode in client side
trees, because when the trees were added the changelog hadn't been written yet,
so we didn't know the linknode. This diff updates manifestlog.add to pass
linkrevs to mutablehistorypack, which get resolved at serialization time into
the appropriate linknode.

Reviewed By: ryanmce

Differential Revision: D7280104

fbshipit-source-id: bbc8a7bfad31da296a1b65973875ba2e1e1f7a95
2018-04-13 21:51:30 -07:00
Durham Goode
09c987f22f hg: don't send public trees during pull/push
Summary:
Currently if you push or pull a bunch of commits between peers we will
include all the trees as part of the push. If the source repo doesn't have all
the necessary trees, it will go to the server to get them. Since the other
machine can just as easily go to the server (and probably won't need most of
those trees anyways), lets just have the source client send all draft trees and
skip the public commits,

Reviewed By: phillco

Differential Revision: D7141623

fbshipit-source-id: 6d33ae9d4c9cc32bf6dfa76f733c87c06890d719
2018-04-13 21:51:22 -07:00
Durham Goode
d9979c9928 hg: update test to show what trees were downloaded
Summary:
A future diff is going to change what trees are sent during a peer to
peer push. Let's update this test so we can see the actual changes in the next
diff.

Reviewed By: singhsrb

Differential Revision: D7141626

fbshipit-source-id: 75e61e9c417d86c48ed1762d6ab67bd4204f67c7
2018-04-13 21:51:22 -07:00
Durham Goode
01b34be972 hg: prefetch trees before producing changegroup
Summary:
When building a changegroup, sometimes we need to access the list of
files changed by each commit. To do so we need to inspect the manifest.
Previously this would end up downloading each tree one-by-one, producing a bunch
of pack files. With this patch we now do one bulk download at the very
beginning.

Reviewed By: quark-zju

Differential Revision: D6873076

fbshipit-source-id: b916c15efca0770129340f798d3e7b165da6aec9
2018-04-13 21:51:01 -07:00
Durham Goode
57cf49a88d hg: move prefetch onto repo object
Summary:
A future diff will add tree prefetching during changegroup creation. This
requires access to the tree prefetch function from the shallowbundle class.
let's move the prefetch functions onto the repo object in preparation for that.

Reviewed By: quark-zju

Differential Revision: D6873055

fbshipit-source-id: 18de0ee0f6ab566587509f9e23ebb2e5779ed1c8
2018-04-13 21:51:01 -07:00
Jun Wu
1cde63d99c codemod: drop hacks changing PYTHONPATH in tests
Summary:
Now they are unnecessary since `run-tests.py` will set up `PYTONPATH`
correctly.

Differential Revision: D6865042

fbshipit-source-id: ca95314f725968e14349a9d916434aa832c596f9
2018-04-13 21:51:00 -07:00
Durham Goode
0fbed23c0d treemanifest: move treemanifest tests to tests/
Summary:
Now that fastmanifest and treemanifest are moved, we can moved the
tests.

Test Plan: make local && ./run-tests.py

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

Subscribers: singhsrb

Differential Revision: https://phabricator.intern.facebook.com/D6685334

Signature: 6685334:1515526455:57791d7f9d2a3f2a6119c0e79a81b31e63a11c60
2018-01-09 12:59:00 -08:00