Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templater: add commit.diff().<format>() methods #4099

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

yuja
Copy link
Collaborator

@yuja yuja commented Jul 16, 2024

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

yuja added 3 commits July 16, 2024 21:39
I'm going to add diff() method which provides no guarantee about content
encoding.
…uments

This will help remove lifetimed &dyn Repo from diff object in templater.

Function arguments are reordered in a way that all show_*() functions have
common parameters in the same order.
This patch adds TreeDiff template type to host formatting options. The main
reason of this API design is that diff formats have various incompatible
parameters, so a single .diff(files, format[, options..]) method would become
messy pretty quickly. Another reason is that we can probably add custom
summary templating support as diff.files().map(|file| file.path()..).

RepoPathUiConverter is passed to templater explicitly because the one stored
in RevsetParseContext is behind Option<_>.
Copy link
Collaborator

@bnjmnt4n bnjmnt4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 🥳

@yuja yuja merged commit d1912bf into martinvonz:main Jul 17, 2024
17 checks passed
@yuja yuja deleted the push-yswmulxmptwo branch July 17, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants