From 5631e85502a95528b2454e959ddb3318614fa40d Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 14 Mar 2021 10:58:20 -0700 Subject: [PATCH] view: don't enforce invariants in merge_views() We now only call the function from `MutableRepo::merge()`. There we pass the result to `MutableView::set_view()`, which already enforces the invariants. --- lib/src/repo.rs | 1 - lib/src/view.rs | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 7754eeaeb..bd539298f 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -691,7 +691,6 @@ impl<'r> MutableRepo<'r> { self.index.merge_in(&other_repo.index()); let merged_view = merge_views( - self.store(), self.view.store_view(), base_repo.view.store_view(), other_repo.view.store_view(), diff --git a/lib/src/view.rs b/lib/src/view.rs index b542c7836..984ca9a34 100644 --- a/lib/src/view.rs +++ b/lib/src/view.rs @@ -111,8 +111,7 @@ fn heads_of_set( } // TODO: Make a member of MutableView? -pub fn merge_views( - store: &StoreWrapper, +pub(crate) fn merge_views( left: &op_store::View, base: &op_store::View, right: &op_store::View, @@ -140,7 +139,6 @@ pub fn merge_views( for added_head in right.head_ids.difference(&base.head_ids) { result.head_ids.insert(added_head.clone()); } - enforce_invariants(store, &mut result); // TODO: Should it be considered a conflict if a commit-head is removed on one // side while a child or successor is created on another side? Maybe a // warning?