Commit Graph

16 Commits

Author SHA1 Message Date
Lukas Piatkowski
d25ca34c0f bundle2-resolver: reorganize resolver for easier handling of BlobRepo::create_changeset
Reviewed By: farnz

Differential Revision: D7032695

fbshipit-source-id: 66a4d75004236536e5dca6da38f71e4662cda0c8
2018-02-22 04:53:56 -08:00
Lukas Piatkowski
4e8389525b bundle2-resolver: upload filelogs and manifests using BlobRepo::upload_entries
Reviewed By: farnz

Differential Revision: D7031532

fbshipit-source-id: 349889da8c7d3f0c572408b61f956fc2ca9f8fd3
2018-02-22 04:53:56 -08:00
Lukas Piatkowski
cea4ff4732 bundle2-resolver: parse ManifestContent from TreeManifestEntry
Summary: this parsed ManifestContent will be used in later diffs to determine the graph of dependencies between BlobEntries and Changesets

Reviewed By: StanislavGlebik

Differential Revision: D7030688

fbshipit-source-id: 243d28f7964e8247ac989a1736210457dd3eab96
2018-02-22 03:45:26 -08:00
Lukas Piatkowski
9ca8778ef7 bundle2-resolver: add basic telementry for DeltaCache structure
Summary:
The DeltaCache structure will hold onto the full content of all filelogs during a push.
This might potentially lead to memory spikes during large pushes or pushes of large files.
The basic telemetry added in this diff will track how does this structure memory usage changes.

Reviewed By: farnz

Differential Revision: D7025207

fbshipit-source-id: 61b8359e4a9a05b6ddb5ec6a7bc4ce9e58752f1b
2018-02-22 03:45:26 -08:00
Lukas Piatkowski
efc38342f7 bundle2-resolver: convert FilelogDeltaed to Filelog
Summary: This code handles deltaed filelogs and resolves them into proper Filelogs

Reviewed By: farnz

Differential Revision: D7011702

fbshipit-source-id: e8dc4844657011bc1085463eedd1790b87d317dc
2018-02-22 03:45:25 -08:00
Lukas Piatkowski
70cc5f55e1 bundle2-resolver: clean up not readable structure pattern matching in changeset convertion
Reviewed By: StanislavGlebik

Differential Revision: D7042765

fbshipit-source-id: 2f51def8e0db7721529eaf655c6b20c460ecafce
2018-02-22 03:45:25 -08:00
Stanislau Hlebik
11af232471 mononoke: send replychangegroup to the client
Summary:
Return a reply to a client so that it doesn't fail.
Reply consists of just one replychangegroup that tells a client that the push
has succeeded (even though currently it wasn't).

resolve() function returns future of Bytes instead of a stream. It may be
suboptimal, but should be fine for now, and it's already used by a few
wireproto methods.

Reviewed By: lukaspiatkowski

Differential Revision: D7010578

fbshipit-source-id: 9b5425b912c640d4e2bac957a02e9881813b8871
2018-02-21 11:07:19 -08:00
Lukas Piatkowski
fdc24f5ce3 bundle2-resolver: use NodeHash::into_option instead of comparing to NULL_HASH
Reviewed By: farnz

Differential Revision: D7023364

fbshipit-source-id: ffe2af6dafe733e8f7e60554f4cba424da9e41ec
2018-02-21 05:05:41 -08:00
Stanislau Hlebik
06783fc66c mononoke: change bundle2_resolver::resolve signature
Summary:
Now resolve() function accepts stream of Bundle2Item and it doesn't return
remainder. Remainder is parsed in hgproto. This makes unbundle() similar to
other hgproto methods.

Note that resolve() returns future of () - this is temporary and it'll be
changed in the next diff.

Reviewed By: jsgf

Differential Revision: D7010577

fbshipit-source-id: f4bde495d0ab8785476559f65b0165dbd09e4ba5
2018-02-19 05:26:12 -08:00
Lukas Piatkowski
39399a0883 bundle2-resolver: convert ChangesetDeltaed to RevlogChangeset
Reviewed By: StanislavGlebik

Differential Revision: D7002558

fbshipit-source-id: c174d118942dd202fdbea3716acad46fb4a592c5
2018-02-16 13:22:37 -08:00
Lukas Piatkowski
cad62646cd bundle2-resolver: clean up split_changeset function
Summary: I commited the sin of overengineering here and in the next diff I would remove some of these stuff, so doing it here to make the next diff easier to read

Reviewed By: StanislavGlebik

Differential Revision: D7002559

fbshipit-source-id: 46d0776c55c6b2a76a0a816e1168347fea763d43
2018-02-16 04:50:00 -08:00
Lukas Piatkowski
bc4c116138 bundle2-resolver: add code for converting changegroup into changesets and filelogs
Summary: The changesets and filelogs can later be handled separately and applied on BlobRepo

Reviewed By: jsgf

Differential Revision: D6988952

fbshipit-source-id: 9959b6acb7913db208c2b4eeea8a1c9913d13678
2018-02-15 09:52:45 -08:00
Lukas Piatkowski
8d5a946ee0 mercurial-bundles: replace the flat Bundle2Item with better structured one
Summary:
The previous Bundle2Stream is a stream of enum that can represent any part of bundle2 - being it a header, inner payload or end marker.

This commit changes the Bundle2Stream to be a stream of more structured elements, where each element is a header with corresponding payload attached.

This new approach is easier to handle, because the way a bundle2 stream is supposed to be dealt with is running an operation per header (where the type of operation depends on type of header). With the old Bundle2Stream the "handling" of bundle2 required basically reparsing it's content to the structures that the new design returns directly.

Reviewed By: jsgf

Differential Revision: D6965529

fbshipit-source-id: 03f7cf57fec5c38addf32bdef3ca56d3239288b9
2018-02-15 09:52:45 -08:00
Lukas Piatkowski
52470ce76c mercurial-bundles: hardcode 'static lifetime in Bundle2Stream
Summary: The only real use case of Bundle2Stream requires it to be 'static, so the is no real point of preserving 'a.

Reviewed By: StanislavGlebik

Differential Revision: D6965528

fbshipit-source-id: 3d5c9c74c1d17980befd3742c54cdde9279aa62c
2018-02-15 09:52:45 -08:00
Stanislau Hlebik
9242864e64 mononoke: implement b2xtreegroupparser
Summary:
This code will be used to convert incoming b2xtreegroup in wirepack
format into TreemanifestEntry, then later can be used in Commit Api.

Reviewed By: lukaspiatkowski

Differential Revision: D6965828

fbshipit-source-id: aff798ea52343d6f64564c9eff34dc5bc2510b38
2018-02-14 08:22:20 -08:00
Lukas Piatkowski
09bb644610 bundle2-resolver: initial code to move bundle2 handling to it's own crate
Reviewed By: StanislavGlebik

Differential Revision: D6949669

fbshipit-source-id: 0fcfd05da83f3066cdcb6285e255ddd78282fdef
2018-02-13 06:22:16 -08:00