sapling/eden/mononoke/derived_data/fastlog/lib.rs
Mateusz Kwapich 451c5e9827 introduce a Visitor trait
Summary:
This new trait is going to replace the `Terminator` argument to fastlog
traversal function. Insted of deciding if we should fetch or/not given fastlog
batch this trait allows us to make decisions based on each visited changeset.

Differential Revision: D22502590

fbshipit-source-id: 19f9218958604b2bcb68203c9646b3c9b433541d
2020-07-23 07:34:52 -07:00

36 lines
1.4 KiB
Rust

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
/// This library is used to efficiently store file and directory history.
/// For each unode we store a FastlogBatch - thrift structure that stores latest commits and their
/// parents that modified this file or directory. Commits are stored in BFS order.
/// All FastlogBatches are stored in blobstore.
///
/// Commits also store pointers to their parents, however they are stored as an offset to the
/// commit hash in batch. I.e. if we have two commits A and B and A is an ancestor of B, then
/// batch will look like:
/// B, vec![ParentOffset(1)]
/// A, vec![]
///
/// Note that commits where a file was deleted are not stored in FastlogBatch. It also doesn't
/// store a history across deletions i.e. if a file was added, then deleted then added again in
/// commit A, FastlogBatch in commit A will contain only one entry.
///
/// RootFastlog is a derived data which derives FastlogBatch for each unode
/// that was created or modified in this commit.
mod fastlog_impl;
mod mapping;
mod ops;
mod thrift {
pub use mononoke_types_thrift::*;
}
pub use mapping::{
fetch_parent_root_unodes, ErrorKind, FastlogParent, RootFastlog, RootFastlogMapping,
};
pub use ops::{list_file_history, FastlogError, HistoryAcrossDeletions, Visitor};