Fri, 10 Dec 2021 16:18:58 +0100 rhg: Add support for `rhg status --copies`
Simon Sapin <simon.sapin@octobus.net> [Fri, 10 Dec 2021 16:18:58 +0100] rev 48493
rhg: Add support for `rhg status --copies` Copy sources are collected during `status()` rather than after the fact like in Python, because `status()` takes a `&mut` exclusive reference to the dirstate map (in order to potentially mutate it for directory mtimes) and returns `Cow<'_, HgPath>` that borrow the dirstate map. Even though with `Cow` only some shared borrows remain, the still extend the same lifetime of the initial `&mut` so the dirstate map cannot be borrowed again to access copy sources after the fact: https://doc.rust-lang.org/nomicon/lifetime-mismatch.html#limits-of-lifetimes Additionally, collecting copy sources during the dirstate tree traversal that `status()` already does avoids the cost of another traversal or other lookups (though I haven’t benchmarked that cost). Differential Revision: https://phab.mercurial-scm.org/D11899
Fri, 10 Dec 2021 16:57:39 +0100 rhg: refactor relativize_path into a struct + method
Simon Sapin <simon.sapin@octobus.net> [Fri, 10 Dec 2021 16:57:39 +0100] rev 48492
rhg: refactor relativize_path into a struct + method … instead of a function that takes an iterator and a callback. Differential Revision: https://phab.mercurial-scm.org/D11898
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -2 +2 +10 +30 +100 +300 +1000 +3000 tip