sapling/mercurial-types
Arun Kulshreshtha fb91cf93d6 types: split HistoryEntry into two types
Summary:
This changes the way we represent history entries for the Eden API by splitting them into two types and putting them into a new `historyentry` module.

- `PackHistoryEntry` is the same as the old `HistoryEntry`, containing the fields required to add this entry to a `MutableHistoryPack` (namely a `Key` and a `NodeInfo`).
- `LooseHistoryEntry` is a history entry containing the information that would normally be present in a line of the history text in the remotefilelog loose file format.

There are several reasons why it makes sense to have both of these types:

- The existing remotefilelog code in Mononoke uses a type very similar to `LooseHistoryEntry` internally, and as such having a similar type for API calls simplifies code on the server side.

- `PackHistoryEntry` contains redundant information (in particular, the file path may be duplicated up to 3 times). While it's structure is ideal for `revisionstore`'s in-memory data structures, for transmitting data, this redundancy is undesirable, especially since the client already has the file path (it is required to make the request in the first place).

- Conversions between these two representations include some subtle details that are tricky to get right. By putting the conversion in one canonical place, we can avoid having to duplicate this conversion logic in multiple places.

Differential Revision: D14162783

fbshipit-source-id: 63e0a060709916f21613442b75370f4d34a04f04
2019-02-21 14:39:15 -08:00
..
if mercurial_types: remove D* types and move mercurial types around 2018-06-07 13:19:16 -07:00
mocks monononoke hashes: remove usages of borrows of hashes which are Copy 2019-02-06 15:11:35 -08:00
src types: split HistoryEntry into two types 2019-02-21 14:39:15 -08:00
tests/src monononoke hashes: remove usages of borrows of hashes which are Copy 2019-02-06 15:11:35 -08:00
Cargo.toml mononoke: remove diesel from codebase 2018-10-29 05:18:29 -07:00