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

copies: filter rename source entries by CopiesTreeDiffStream #4313

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Aug 21, 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 4 commits August 21, 2024 21:42
…caller

This is simpler, and I think it's generally better to not spawn executor in
library code.
Git reports a rename source as deleted if the rename target is excluded. I
think that's because Git restricts the search space to the specified paths. For
example, Git doesn't also recognize a rename if the source path is excluded
whereas jj does.

I don't think we need to copy the exact behavior of Git, so this patch just
moves matcher application to earlier stage. This change will help remove
collect_copied_sources().

The added get_copy_records() helper could be moved to jj_lib, but we'll probably
want a stream version of this function in library, and writing a stream adapter
isn't as simple as iterator.
All for/has_source/target() combinations are added for API consistency.
Rename source entries will be handled by CopiesTreeDiffStream.
lib/src/copies.rs Outdated Show resolved Hide resolved
lib/src/copies.rs Show resolved Hide resolved
@yuja yuja force-pushed the push-skskwqxzwyur branch from 9a39501 to a29fcc0 Compare August 22, 2024 09:32
@yuja yuja merged commit 352a4a0 into jj-vcs:main Aug 22, 2024
18 checks passed
@yuja yuja deleted the push-skskwqxzwyur branch August 22, 2024 11:17
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