mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
94c383327a
Summary: Previously, NameDag only supports writing directly to disk. That is not easy for hg to use, since hg knows commits before bookmark names during pull, while the API requires both commits and bookmarks (to decide which commits belong to the "master" group) at the same time. The old API also does not match other storage layers like indexedlog and metalog, where writes are buffered until explicitly flushed. This diff adds the "write-in-memory" (named "add_heads"), and "flush" APIs to make NameDag easier to use. Under the hood, it just copies the "added" portion of the DAG, and re-use the old API ("build", renamed to "add_heads_and_flush") to do the job. Note: The buffered changes pattern cannot be used in IdDag, since Ids might have to be re-assigned on flush. But NameDag does not expose the raw Ids in its "normal" interface, so it's fine to reassign Ids on flush. Reviewed By: markbt Differential Revision: D19405474 fbshipit-source-id: 75e5e5815c78c3577a0138f48185f6c4b5a80891 |
||
---|---|---|
.. | ||
benches | ||
src | ||
Cargo.toml |