ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib
Yuya Nishihara c9e147c425 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.
2024-08-11 18:23:21 +09:00
..
benches cargo: rename crates from jujutsu/jujutsu-lib to jj-cli/jj-lib 2023-07-09 06:40:43 +02:00
gen-protos Use { workspace = true } to appease VS Code's Cargo.toml parser 2023-08-22 21:38:53 -07:00
proc-macros cargo: explicitly indicate paths to publish 2024-04-15 20:37:00 -07:00
src merged_tree: allow to postpone resolution of intermediate trees 2024-08-11 18:23:21 +09:00
tests tests: evaluate file()/diff_contains() revset against merged parents 2024-08-11 18:23:21 +09:00
testutils tests: make helpers create non-legacy trees 2024-07-24 14:33:05 +02:00
Cargo.toml revset: create DatePattern type 2024-08-01 09:04:07 -07:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00