Commit Graph

10 Commits

Author SHA1 Message Date
Jun Wu
320fc31e4c tinit: add drawdag and setconfig functions
Summary: They help making tests easier to write.

Reviewed By: phillco

Differential Revision: D7121645

fbshipit-source-id: 9c7181d45c4e28155eb68f355cf1c4cfc077d191
2018-04-13 21:51:20 -07:00
Jun Wu
4c44fcc611 revlog: calculate rawsize correctly when applying deltas
Summary: This fixes the `hg verify` issue.

Reviewed By: DurhamG

Differential Revision: D6920596

fbshipit-source-id: 4a777f182b58acf29a62d50aca65d668b307e5b3
2018-04-13 21:51:06 -07:00
Jun Wu
0ee42bec7e test-lfs-bundle: add hg verify
Summary:
This reveals an issue where rawsize stored in revlog could
be wrong.

Reviewed By: DurhamG

Differential Revision: D6920597

fbshipit-source-id: c195d2613c06455204cc59497bfb97aa963c529a
2018-04-13 21:51:06 -07:00
Jun Wu
efc6fe7319 remotefilelog: disallow delta on copied revisions
Summary:
The remotefilelog cgunpacker logic could enter an infinite loop
if a copyfrom file node uses its copyto as delta base.

This repros without LFS in test-lfs-bundle.t.

Reviewed By: DurhamG

Differential Revision: D6910079

fbshipit-source-id: 99fea316e77218cd4bc9ea6f5506779a3e4ab9a6
2018-04-13 21:51:06 -07:00
Jun Wu
19c474492b remotefilelog: respect lfs copy metadata
Summary: Otherwise the copy data will be lost when applying LFS bundles.

Reviewed By: DurhamG

Differential Revision: D6906207

fbshipit-source-id: bc94c6614f9d4b2a2b4c7f44f57de49bd54d6b49
2018-04-13 21:51:05 -07:00
Jun Wu
c223bb4eaf remotefilelog: resolve lfs rawtext to vanilla rawtext before applying delta
Summary: This is similar to the previous patch, but applies to remotefilelog.

Reviewed By: DurhamG

Differential Revision: D6906206

fbshipit-source-id: 2a9a56a57544b5e4d892f77438b2faaadece73ee
2018-04-13 21:51:05 -07:00
Jun Wu
d76d41a0b2 revlog: resolve lfs rawtext to vanilla rawtext before applying delta
Summary:
This happens when the client with LFS revisions applies a bundle
with a delta base pointing to an LFS revision stored in the repo.

Reviewed By: DurhamG

Differential Revision: D6906210

fbshipit-source-id: 8b47f8304f8ef5ae4b02d7239b680f70106a4d83
2018-04-13 21:51:05 -07:00
Jun Wu
453b043043 revlog: do not use delta for lfs revisions
Summary:
This is similar to what we have done for changegroups, but for non-changegroup
(addrawrevision) case. This is needed to make sure the delta application code
path can assume deltas are always against vanilla (non-LFS) rawtext so the next
fix becomes possible.

Reviewed By: DurhamG

Differential Revision: D6906202

fbshipit-source-id: a7d62dfed4206d45b42299f1dabf013620ae52b3
2018-04-13 21:51:05 -07:00
Jun Wu
07042a2157 changegroup: do not delta lfs revisions
Summary:
There is no way to distinguish whether a delta base is LFS or non-LFS.

If the delta is against LFS rawtext, and the client trying to apply it has the
base revision stored as fulltext, the delta (aka. bundle) will fail to apply.

This patch forbids using delta on LFS revisions.

Note: this does not solve the problem entirely. Since the problem could also be
a client with base file revision being LFS tries to apply a non-LFS delta
(bundle).

Reviewed By: DurhamG

Differential Revision: D6878326

fbshipit-source-id: 9c3951e4673b8de61aae73a51e1bfff422f38d0f
2018-04-13 21:51:05 -07:00
Jun Wu
381158f7df test-lfs-bundle: new test testing lfs bundle exchanging behavior
Summary: This test covers bundle application between repos.

Reviewed By: DurhamG

Differential Revision: D6906245

fbshipit-source-id: 827b49eec49f1ffaac6363e38783705d0c399c45
2018-04-13 21:51:05 -07:00