feat: Recover from commutative merging failures #568
13 changed files with 27 additions and 6 deletions
|
@ -0,0 +1,11 @@
|
|||
class MyClass {
|
||||
public:
|
||||
int field_1;
|
||||
<<<<<<< LEFT
|
||||
private:
|
||||
size_t field_2;
|
||||
||||||| BASE
|
||||
=======
|
||||
char field_3;
|
||||
>>>>>>> RIGHT
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
my_struct_t instance = {
|
||||
<<<<<<< LEFT
|
||||
"hello",
|
||||
"merhaba",
|
||||
||||||| BASE
|
||||
"hello"
|
||||
=======
|
||||
"hello",
|
||||
"salut",
|
||||
>>>>>>> RIGHT
|
||||
};
|
|
@ -28,7 +28,7 @@ public partial class MyClass : IMyInterface
|
|||
/// </summary>
|
||||
[MyCustomAttribute]
|
||||
public string? MyProp { get; set; }
|
||||
|
||||
>>>>>>> RIGHT
|
||||
|
||||
private record MyPrivateRecord(bool Foo);
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ class App {
|
|||
||||||| BASE
|
||||
=======
|
||||
public function baz(string $param) {}
|
||||
|
||||
>>>>>>> RIGHT
|
||||
|
||||
public function bar() {}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -258,15 +258,14 @@ impl<'a, 'b> TreeBuilder<'a, 'b> {
|
|||
|
||||
if let PCSNode::Node { node: leader, .. } = node
|
||||
&& let Some(commutative_parent) = leader.commutative_parent_definition()
|
||||
{
|
||||
// knowing that the order of all elements of the conflict does not matter, solve the conflict
|
||||
let solved_conflict = self.commutatively_merge_lists(
|
||||
&& let Ok(solved_conflict) = self.commutatively_merge_lists(
|
||||
&base,
|
||||
&left,
|
||||
&right,
|
||||
commutative_parent,
|
||||
visiting_state,
|
||||
)?;
|
||||
)
|
||||
{
|
||||
children.extend(solved_conflict);
|
||||
} else {
|
||||
children.extend(MergedTree::new_conflict(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue