Page MenuHomePhabricator

copies-rust: process copy information of both parent at the same time
ClosedPublic

Authored by marmoute on Dec 21 2020, 5:28 PM.

Details

Summary

This avoid a double iteration and this open the way to a better handing of
deletion. That better handling of deletion is the core reason we are doing this
refactoring.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

marmoute created this revision.Dec 21 2020, 5:28 PM
marmoute updated this revision to Diff 24489.Dec 22 2020, 9:12 PM
baymax updated this revision to Diff 24500.Dec 22 2020, 9:46 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 24584.Jan 5 2021, 4:07 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare requested changes to this revision.Jan 8 2021, 8:48 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/copy_tracing.rs
472

I'd rather use a if let (None, None) = (&base_p1_copies, &base_p2_copies) , but it's not a big deal.

477

This is let mut p1_copies = base_p1_copies.clone();

494

Looks like you're doing a clone that isn't needed unless we're in the ::Removed case and then unwrapping.

This revision now requires changes to proceed.Jan 8 2021, 8:48 AM
marmoute added inline comments.Jan 8 2021, 9:41 AM
rust/hg-core/src/copy_tracing.rs
472

m'okay

477

sweet

494

The clone is needed for both remove and Copied Case. We could try to be smarter, only cloning at the first edit, but the underlying data are im-rs:ordmap so cloning is cheap.

Alphare added inline comments.Jan 8 2021, 10:08 AM
rust/hg-core/src/copy_tracing.rs
494

You're right, I'm blind. :)

Alphare accepted this revision.Jan 8 2021, 10:44 AM
This revision now requires review to proceed.Jan 8 2021, 10:44 AM
baymax updated this revision to Diff 24675.Jan 8 2021, 6:16 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 25695.Feb 22 2021, 9:14 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 25754.Feb 22 2021, 11:21 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 25793.Feb 22 2021, 5:12 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.