mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
638e637ef6
Summary: Our previous implementation of unodes had a problem with diamond merges - essentially because p1 and p2 might have the same file but with different content unode will always create a merge unode which can be unexpected. (code comment in unodes/derive.rs has more info about it). This diff fixes the problem by introducing unodes v2. This allows us to import new repos with new unode implementation while keeping the old repos with unode v1. This implementation uses a heuristic which should be fast and should do the correct thing most of the time. In some cases it might exclude some parts of the history completely. For example: O <- merge commit, doesn't change anything / \ P1 | <- modified "file.txt" to "B" | P2 <- modified "file.txt" to "B" \ / ROOT <- created "file.txt" with content "A" In that case history of "file.txt" starting from merge commit will contain only (P1, ROOT), but it won't contain P2. We also considered other options: 1) Move this heuristic to fastlog batch derived data. See D19973553 for more details about why we decided not to do it. 2) Filter out parent unodes that are ancestors of other parent unodes. This should always be correct, but it will be hard to implement, it wil be even harder to make sure it always have good performance. Reviewed By: krallin Differential Revision: D19978157 fbshipit-source-id: 445ddd5629669d987e7aa88c35fecf0b34a40da0 |
||
---|---|---|
.. | ||
lib.rs |