-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged_tree: allow to postpone resolution of intermediate trees
This allows us to diff trees without fully resolving conflicts: let from_tree = merge_no_resolve(..); for (path, (from, to)) in from_tree.diff(to_tree, matcher) { let from = resolve_conflicts(from); if from == to { continue; // resolved file may be identical ... I originally considered adding a matcher argument to merge() functions, but the resulting API looked misleading. If merge() took a matcher, callers might expect unmatched trees and files were omitted, not left unresolved. It's also slower than diffing unresolved trees because merge(.., matcher) would have to write partially resolved trees to the store. Since "ancestor_tree" isn't resolved by itself, this patch has subtle behavior change. For example, "jj diff -r9eaef582" in the "git" repository is no longer empty. I think the new behavior is also technically correct, but I'm not pretty sure.
- Loading branch information
Showing
3 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters