mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] forwardport: use diff3 for conflict style
Existing conflict style is the local default ("merge", most likely). `diff3` is a lot more informative as it provides the common ancestor's code for the hunk, which helps see how the two branches diverged and thus resolve the conflict. Even better would be zdiff3 but that's a bit too recent... Fixes #619
This commit is contained in:
parent
f430c014c1
commit
fb45f089b0
1
forwardport/changelog/2022-06/conflict-diff3.md
Normal file
1
forwardport/changelog/2022-06/conflict-diff3.md
Normal file
@ -0,0 +1 @@
|
||||
IMP: use the `diff3` conflict style, should make forward port conflicts clearer and easier to fix
|
@ -870,7 +870,7 @@ This PR targets %s and is part of the forward-port chain. Further PRs will be cr
|
||||
# switch back to the PR branch
|
||||
conf.checkout(fp_branch_name)
|
||||
# cherry-pick the squashed commit to generate the conflict
|
||||
conf.with_params('merge.renamelimit=0')\
|
||||
conf.with_params('merge.renamelimit=0', 'merge.conflictstyle=diff3')\
|
||||
.with_config(check=False)\
|
||||
.cherry_pick(squashed, no_commit=True)
|
||||
status = conf.stdout().status(short=True, untracked_files='no').stdout.decode()
|
||||
|
@ -60,9 +60,10 @@ def test_conflict(env, config, make_repo, users):
|
||||
'g': 'a',
|
||||
'h': re_matches(r'''<<<\x3c<<< HEAD
|
||||
a
|
||||
|||||||| parent of [\da-f]{7,}.*
|
||||
=======
|
||||
xxx
|
||||
>>>\x3e>>> [0-9a-f]{7,}.*
|
||||
>>>\x3e>>> [\da-f]{7,}.*
|
||||
'''),
|
||||
}
|
||||
prb = prod.get_pr(prb_id.number)
|
||||
@ -323,9 +324,10 @@ def test_multiple_commits_different_authorship(env, config, make_repo, users, ro
|
||||
|
||||
assert re.match(r'''<<<\x3c<<< HEAD
|
||||
b
|
||||
|||||||| parent of [\da-f]{7,}.*
|
||||
=======
|
||||
2
|
||||
>>>\x3e>>> [0-9a-f]{7,}.*
|
||||
>>>\x3e>>> [\da-f]{7,}.*
|
||||
''', prod.read_tree(c)['g'])
|
||||
|
||||
# I'd like to fix the conflict so everything is clean and proper *but*
|
||||
|
@ -374,9 +374,10 @@ def test_subsequent_conflict(env, make_repo, config, users):
|
||||
'g': 'a',
|
||||
'h': re_matches(r'''<<<\x3c<<< HEAD
|
||||
a
|
||||
|||||||| parent of [\da-f]{7,}.*
|
||||
=======
|
||||
conflict!
|
||||
>>>\x3e>>> [0-9a-f]{7,}.*
|
||||
>>>\x3e>>> [\da-f]{7,}.*
|
||||
'''),
|
||||
'x': '0',
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user