( )⚙ D5892 patch: let caller pass in root-filtering matcher (API)

This is an archive of the discontinued Mercurial Phabricator instance.

patch: let caller pass in root-filtering matcher (API)
ClosedPublic

Authored by martinvonz on Feb 8 2019, 3:30 AM.

Details

Summary

The --root option to hg diff does two things:

  • Shows paths relative to the given root
  • Filters paths by the given root, including copy sources

The root argument is passed through down to patch.diff(). I feel like
we can make patch.diff() more generic by not passing down the root
argument, but instead pass:

  • A function for taking a repo-relative path and printing it. I want to reuse this for showing cwd-relative paths later. This is the actual motivation for this patch.
  • A matcher that's already been filtered by the root argument
  • A second matcher that filters the copy sources

This is one step towards that.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped