mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
fb91cf93d6
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 |
||
---|---|---|
.. | ||
if | ||
mocks | ||
src | ||
tests/src | ||
Cargo.toml |