Commit Graph

9 Commits

Author SHA1 Message Date
Durham Goode
7add7dc1ef treemanifest: use manifestlog's mutable pack for prefetches
Summary:
The manifestlog has some mutable packs that it persists and manages the
lifetime of. As long as every tree writer uses these, we'll only get one new
pack per process/transaction.

The prefetch code was not using these though, so things like 'hg log -p' would
produce many packs over the course of many fetches. This change fixes it to
always write to the same pack.

Reviewed By: phillco

Differential Revision: D8670684

fbshipit-source-id: e56590c0ced84a99a06a94028d6a4e14bcc22ab6
2018-06-29 15:51:40 -07:00
Jun Wu
be1ec6d330 test-fb-hgext-treemanifest-prefetch: disable the test for fsmonitor
Summary:
It's exceeding unix domain socket length limit:

  AssertionError: 2018-06-22T13:48:50,820: [] /tmp/hgtests.8M8JR4/child3/test-fb-hgext-treemanifest-prefetch.t-remotefilelog.true.shallowrepo.true.watchman/sock: path is too long

Talked with wez. Watchman does not want to workaround the issue by using
chdir like chg[1]. The main reason is changing cwd could break
thread-safety, especially when used as a library. chg is single-threaded and
does not have the concern.

[1]: c80c16a8a0

Reviewed By: DurhamG, singhsrb

Differential Revision: D8596333

fbshipit-source-id: 347a42fcd40d4ab075ca9c24f7c9ce4c8fa519b0
2018-06-22 15:50:40 -07:00
Durham Goode
88c0f8e820 treemanifest: support subdir requests in gettreepack
Summary:
Previously, if a client sent a gettreepack request and specified a
non-root directory, the server would go back to the root of the tree and send
the whole tree. Now that treemanifest has a walksubdirtrees function for
iterating over a specific subset of a tree, we can make it return just the
subset.

This diff does delete the treememoizer class. This was previously used to keep
trees in memory if they would be needed again (for instance, as a base node for
a future tree). We aren't able to provide this functionality when using
walksubdirtrees, because python doesn't have access to the underlying sub
directory tree objects. This class was probably unnecessary anyway, since we
usually only request a small number of trees at once.

Reviewed By: quark-zju

Differential Revision: D8217360

fbshipit-source-id: 1db970659eabe2829acc6d49a15eeb9345ce4a5b
2018-06-05 11:45:25 -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
d0f5ffed67 hg: use ancestory for base tree finding
Summary:
Previously, when searching for base trees (i.e. trees that we already
have that we can tell the server so it can send us only parts we don't have) we
did a naive changelog scan for public commits. If the phases were messed up and
a local commit was marked public, this would result in us sending the server a
base commit it didn't have which would error out.

Let's make two changes to fix this.

1. Let's scan by history instead of by revision number.  This will
work in the future when we don't have rev numbers, and will hopefully also get
us closer base trees. It should also mean that if we fetch a server commit we
are less likely to encounter a local accidentally-public commit.

2. Let's only use commits that are ancestors of a remotename. This will help us
avoid local accidentally-public commits as well.

Reviewed By: quark-zju

Differential Revision: D7593363

fbshipit-source-id: 1df8f4fbc56a4c11ccb6d444c3d08297206ad91f
2018-04-16 12:53:41 -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
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -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