From 0590f8beceb899ed6b1ba3ac60877d2e959fe0f9 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 23 Jul 2024 01:34:15 -0700 Subject: [PATCH] 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. --- lib/src/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/store.rs b/lib/src/store.rs index 323f371b0..f04b24962 100644 --- a/lib/src/store.rs +++ b/lib/src/store.rs @@ -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))?;