This is an archive of the discontinued Mercurial Phabricator instance.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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();

487

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

487

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
487

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.