Commit Graph

8 Commits

Author SHA1 Message Date
Xavier Deguillard
309229fdf5 remotefilelog: do no build the entire ancestormap in remotefilectx.parents
Summary:
While working on a stack, I noticed that `hg amend -e` would sometimes download
a lot of history information. For a 4 files change, I saw 738 history entry
fetched individually...

Looking at the profile, this pointed towards remotefilectx.parents requesting
the entire ancestormap. Since that function really only need the nodeinfo,
let's only get that.

Reviewed By: DurhamG

Differential Revision: D17104263

fbshipit-source-id: fae1f673b2d2a641ae4f22d1099317cc5abd8447
2019-08-29 09:51:38 -07:00
Xavier Deguillard
3f21c278d4 remotefilelog: Rust repack is the default
Summary:
This option has been on for several months now, let's enable it by default in
the tests too. Since the behavior is slightly different, the tests had to be
adjusted:
  - The packfile hashes are different due to a different repack algorithm,
  - test-fb-hgext-remotefilelog-gcrepack.t removed due to gc not being a thing
    with the Rust repack,
  - test-fb-hgext-remotefilelog-repack-corrupt.t corrupt packs aren't detected
    and removed at repack time, but later,
  - test-fb-hgext-remotefilelog-repack.t we no longer re-delta context in the
    Rust repack

Reviewed By: quark-zju

Differential Revision: D16774858

fbshipit-source-id: 7b7a3d96598c1ded0f64237047c3d97510050e4a
2019-08-13 10:50:02 -07:00
Durham Goode
ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -07:00
Jun Wu
077313f1af dispatch: move deferred to atexit handler
Summary:
See D14606986 for context. `repo.close` should be protected by not crashing on
stdout or stderr write errors (SIGPIPE or EPIPE). Move `deferred` to `atexit`
handler to get the protection.

Test changes are caused by ordering changes.

Differential Revision: D14607407

fbshipit-source-id: 5a42aefcec395f48b8ecb67426429ef2e41f5666
2019-03-25 18:33:05 -07:00
Chad Austin
a948959e2e hg: improve connection closed early error message
Summary:
Several people observed this connection closed early message last week
and were unable to go further, so perhaps it would be helpful to
include a bit of additional data in the error message.

Reviewed By: quark-zju

Differential Revision: D13165697

fbshipit-source-id: 8f7d9d29d52697393a8474d6b8697099b0e33442
2019-01-10 21:21:59 -08:00
Saurabh Singh
66b2153f13 test-fb-hgext-remotefilelog-repack-corrupt: fix the test
Summary:
This test still fails on OSX because the messages with prefix
`remote:` are missing. It doesn't seem like we need those messages for the
actual testing. Therefore, adding the `-q` option to the affected commands to
remove the `remote:` messages for all the platforms.

Reviewed By: quark-zju

Differential Revision: D12829679

fbshipit-source-id: e53dca96b5511049ef240ed671705987cdd9eab1
2018-10-29 15:47:14 -07:00
Mark Thomas
1ac1128def truncate: add truncate implementation
Summary:
The `truncate` tool isn't availble on OSX, so include our own in the test
suite.

Reviewed By: DurhamG

Differential Revision: D12815613

fbshipit-source-id: 510b2936f07c5193671baaeaec6620872c3ec982
2018-10-27 10:59:21 -07:00
Mark Thomas
5e785a473f remotefilelog: handle corrupt pack files during repack
Summary:
If a corrupt pack file is encountered while marking the ledger for repack,
handle the failure.

Don't immediately delete the pack files.  Keep them around as we may be able
to repack some of the non-corrupt contents (particularly when the file has
been truncated).

Once repack has completed, revisit the corrupt packs that we found.  For shared
packs, delete them.  For local packs, rename them.  They are the only source of
the data, and we may be able to recover more data manually.

Reviewed By: DurhamG

Differential Revision: D10527544

fbshipit-source-id: f228fb4de3ff016a1c9035823bfa1d6b7767cdcb
2018-10-26 01:16:13 -07:00