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.
This commit is contained in:
Martin von Zweigbergk 2021-03-14 10:58:20 -07:00
parent 8048d9641e
commit 5631e85502
2 changed files with 1 additions and 4 deletions

View file

@ -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(),

View file

@ -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?