Skip to content
Snippets Groups Projects
Commit e166e8a035a7 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

copies-rust: use the entry API to overwrite deleted entry

This is more efficient, more idiomatic and more compact.

The main motivation for this change is to cleanup that area before start to do
"overwrite" tracking. Such tracking will ultimately help to avoid costly
is_ancestors call when merging changeset.

Differential Revision: https://phab.mercurial-scm.org/D9494
parent c6bc77f7e593
No related branches found
No related tags found
No related merge requests found
......@@ -523,13 +523,10 @@
// propagate this information when merging two
// TimeStampedPathCopies object.
let deleted = path_map.tokenize(deleted_path);
if copies.contains_key(&deleted) {
let ttpc = TimeStampedPathCopy {
rev: current_rev,
path: None,
};
copies.insert(deleted, ttpc);
}
copies.entry(deleted).and_modify(|old| {
old.rev = current_rev;
old.path = None;
});
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment