Page MenuHomePhabricator

rhg: refactor function to relativize paths in utils
ClosedPublic

Authored by pulkit on Tue, Oct 5, 8:45 AM.

Details

Summary

Commands like files, status supports printing relative paths. Hence we need
to re-use this code in other places too. So let's take this out from rhg files
into a utility function.

Next patch will make rhg status use it.

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

pulkit created this revision.Tue, Oct 5, 8:45 AM
martinvonz accepted this revision.Mon, Oct 11, 1:48 PM
martinvonz added a subscriber: martinvonz.
martinvonz added inline comments.
rust/rhg/src/utils/path_utils.rs
19

I generally find iterators easier to work with than callbacks. That makes error handling easier and it makes it easy to stop iteration at any point. I'll take this as is, but consider following up with a rewrite.

This revision is now accepted and ready to land.Mon, Oct 11, 1:48 PM
This revision was automatically updated to reflect the committed changes.