mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
8c19620e62
Summary: Previous to this commit, the `Dirstate` logic only worked correctly when the changes occurred in the root directory. Obviously that is very limiting, so this adds support for changes in arbitrary directories at arbitrary depths. This also introduces support for things like a file being replaced by a directory of same name or vice versa. The tests have been updated to verify these cases. One interesting design change that fell out of this was the addition of the `removedDirectories` field to the `DirectoryDelta` struct. As you can see, all entries in a removed directory need to be processed by the new `addDeletedEntries()` function. These require special handling because deleted directories do not show up in the traversal of modified directories. In contrast, new directories do show up in the traversal, so they require a different type of special handling. Specifically, this call will return `NULL`: ``` auto tree = getTreeForDirectory(directory, rootTree.get(), objectStore); ``` When this happens, we must pass an empty vector of tree entries to `computeDelta()` rather than `&tree->getTreeEntries()`. Admittedly, the special case of new directories is much simpler than the special case of deleted ones. Reviewed By: simpkins Differential Revision: D4219478 fbshipit-source-id: 4c805ba3d7688c4d12ab2ced003a7f5c19ca07eb |
||
---|---|---|
.. | ||
DirstatePersistenceTest.cpp | ||
DirstateTest.cpp | ||
EdenMountHandlerTest.cpp | ||
TARGETS |