ok/jj
1
0
Fork 0
forked from mirrors/jj

conflicts: always promote legacy trees to merged trees

In order to remove the `MergedTree::Legacy` form, we need to stop
creating such instances. This patch removes the last place we create
them, which is in `Store::get_root_tree()`.

The main practical consequence of this change is that loading legacy
trees gets a lot slower on large repos. However, since the default log
template includes the `conflict` keyword, we ended up scanning all
paths in `jj log` anyway, so I'm not sure many people will notice.
This commit is contained in:
Martin von Zweigbergk 2024-07-23 01:34:15 -07:00
parent 202fb533f4
commit 0590f8bece
No known key found for this signature in database

View file

@ -200,7 +200,7 @@ impl Store {
match &id {
MergedTreeId::Legacy(id) => {
let tree = self.get_tree(RepoPath::root(), id)?;
Ok(MergedTree::Legacy(tree))
MergedTree::from_legacy_tree(tree)
}
MergedTreeId::Merge(ids) => {
let trees = ids.try_map(|id| self.get_tree(RepoPath::root(), id))?;