diff --git a/cli/src/commands/fix.rs b/cli/src/commands/fix.rs
index 20c33a871..718d10e85 100644
--- a/cli/src/commands/fix.rs
+++ b/cli/src/commands/fix.rs
@@ -344,8 +344,10 @@ fn fix_file_ids<'a>(
}
});
if new_content != old_content {
- let new_file_id =
- store.write_file(&tool_input.repo_path, &mut new_content.as_slice())?;
+ // TODO: send futures back over channel
+ let new_file_id = store
+ .write_file(&tool_input.repo_path, &mut new_content.as_slice())
+ .block_on()?;
updates_tx.send((tool_input, new_file_id)).unwrap();
}
}
diff --git a/cli/src/merge_tools/builtin.rs b/cli/src/merge_tools/builtin.rs
index 68354cb1a..1238f3bc8 100644
--- a/cli/src/merge_tools/builtin.rs
+++ b/cli/src/merge_tools/builtin.rs
@@ -453,6 +453,7 @@ pub fn apply_diff_builtin(
files.len(),
"result had a different number of files"
);
+ // TODO: Write files concurrently
for (path, file) in changed_files.into_iter().zip(files) {
let (selected, _unselected) = file.get_selected_contents();
match selected {
@@ -496,7 +497,9 @@ pub fn apply_diff_builtin(
tree_builder.set_or_remove(path, value);
}
scm_record::SelectedContents::Present { contents } => {
- let file_id = store.write_file(&path, &mut contents.as_bytes())?;
+ let file_id = store
+ .write_file(&path, &mut contents.as_bytes())
+ .block_on()?;
tree_builder.set_or_remove(
path,
Merge::normal(TreeValue::File {
diff --git a/cli/src/merge_tools/external.rs b/cli/src/merge_tools/external.rs
index 1800d692f..a01187b18 100644
--- a/cli/src/merge_tools/external.rs
+++ b/cli/src/merge_tools/external.rs
@@ -231,7 +231,8 @@ pub fn run_mergetool_external(
} else {
let new_file_id = tree
.store()
- .write_file(repo_path, &mut output_file_contents.as_slice())?;
+ .write_file(repo_path, &mut output_file_contents.as_slice())
+ .block_on()?;
Merge::normal(new_file_id)
};
let new_tree_value = match new_file_ids.into_resolved() {
diff --git a/lib/src/conflicts.rs b/lib/src/conflicts.rs
index 54fb6b13c..805097185 100644
--- a/lib/src/conflicts.rs
+++ b/lib/src/conflicts.rs
@@ -25,6 +25,7 @@ use futures::Stream;
use futures::StreamExt;
use futures::TryStreamExt;
use itertools::Itertools;
+use pollster::FutureExt;
use regex::bytes::Regex;
use regex::bytes::RegexBuilder;
@@ -513,7 +514,7 @@ pub async fn update_from_content(
};
};
// Either there are no markers or they don't have the expected arity
- let file_id = store.write_file(path, &mut &content[..])?;
+ let file_id = store.write_file(path, &mut &content[..]).await?;
return Ok(Merge::normal(file_id));
};
@@ -535,17 +536,18 @@ pub async fn update_from_content(
if zip(contents.iter(), used_file_ids.iter())
.any(|(content, file_id)| file_id.is_none() && !content.is_empty())
{
- let file_id = store.write_file(path, &mut &content[..])?;
+ let file_id = store.write_file(path, &mut &content[..]).await?;
return Ok(Merge::normal(file_id));
}
// Now write the new files contents we found by parsing the file with conflict
// markers.
+ // TODO: Write these concurrently
let new_file_ids: Vec