pijul_org / pijul

Outputting nested conflicts: two conflicts ending at the same points could forget sides

By blabla on April 15, 2019
signed by pmeunier.
7RWp3orSPFkgmkvVabbpu2jb7XpjgvhFkz4qR8HWyjVCmEwDDa4WTLvutHXGLpi3EiphQzsU7sPAs8L5mbzy2t8U
This patch is in the following branches:
latest
master
testing

















                        let resume_conflict = if let Some((_, State::EvalConflict { end, .. })) = conflict.stack.last() {
                            // If the previous conflict on the stack
                            // has the same end, we can't resume, and
                            // we just need to pop. Else, move on.
                            *end != next
                        } else {
                            true
                        };

                        if resume_conflict {
                            conflict.stack.push((
                                next,
                                State::Init {
                                    resume_after_conflict: true,
                                },
                            ));
                        }

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16

17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

39
40
    if [[ "$(cat debug_master | wc -l)" != "29" ]]; then
#!/usr/bin/env bats

load ../test_helper

@test "conflict needing epsilon" {
    mkdir a

    cd a
    pijul init
    echo a > file
    echo -e "a\nb" > file
    pijul add file
    pijul record -a -m "+file" -A "me"
    cd ..

    pijul clone a b
    cd b
    echo b >> file
    echo -e "a\nx\nb" > file
    RUST_LOG="libpijul::diff=debug" pijul record -a -m "b" -A "me" 2> /tmp/loga
    pijul info --debug
    cp debug_master /tmp/deba

    cd ../a
    echo c >> file
    echo -e "a\ny\nb" > file
    pijul record -a -m "a" -A "me"
    RUST_LOG="libpijul::graph::dfs=debug,libpijul::graph::output_conflict=debug,libpijul::graph=debug" pijul pull ../b -a 2> /tmp/graph

    grep -v ">>>" file | grep -v "<<<" | grep -v "===" > file2
    sed -e "s/b/c/" file2 > file

    RUST_BACKTRACE=1 RUST_LOG="libpijul::diff=debug,libpijul::apply=debug" pijul record -a -m "conflict resolution" -A "me" 2> /tmp/log
    pijul info --debug
    cp debug_master /tmp
    grep orange debug_master
    if [[ $? -ne 0 ]]; then
        echo "no epsilon lines"
        return 1
    fi
    wc -l debug_master
    if [[ "$(cat debug_master | wc -l)" != "22" ]]; then
    if [[ "$(cat debug_master | wc -l)" != "32" ]]; then
        echo "wrong line count"