##// END OF EJS Templates
test-copies: add subcase titles for various "conflicting" information variant...
test-copies: add subcase titles for various "conflicting" information variant This make the transitions between case clearer. Differential Revision: https://phab.mercurial-scm.org/D10047

File last commit:

r47293:f01696d4 default
r47293:f01696d4 default
Show More
test-copies-chain-merge.t
1803 lines | 54.3 KiB | text/troff | Tads3Lexer
/ tests / test-copies-chain-merge.t
upgrade: allow sidedata upgrade to modify revision flag...
r46327 #testcases filelog compatibility changeset sidedata upgraded
copies: fix the changeset based algorithm regarding merge...
r45252
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 =====================================================
Test Copy tracing for chain of copies involving merge
=====================================================
This test files covers copies/rename case for a chains of commit where merges
are involved. It cheks we do not have unwanted update of behavior and that the
different options to retrieve copies behave correctly.
copies: fix the changeset based algorithm regarding merge...
r45252
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 Setup
=====
use git diff to see rename
$ cat << EOF >> $HGRCPATH
> [diff]
> git=yes
Martin von Zweigbergk
config: add a new [command-templates] section for templates defined by hg...
r46350 > [command-templates]
> log={rev} {desc}\n
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 > EOF
copies: fix the changeset based algorithm regarding merge...
r45252 #if compatibility
$ cat >> $HGRCPATH << EOF
> [experimental]
> copies.read-from = compatibility
> EOF
#endif
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if changeset
$ cat >> $HGRCPATH << EOF
> [experimental]
> copies.read-from = changeset-only
> copies.write-to = changeset-only
> EOF
#endif
copies: fix the changeset based algorithm regarding merge...
r45252 #if sidedata
$ cat >> $HGRCPATH << EOF
> [format]
> exp-use-side-data = yes
> exp-use-copies-side-data-changeset = yes
> EOF
#endif
test-copies: don't use empty file for "same content" cases...
r47281 $ cat > same-content.txt << EOF
> Here is some content that will be the same accros multiple file.
>
> This is done on purpose so that we end up in some merge situation, were the
> resulting content is the same as in the parent(s), but a new filenodes still
> need to be created to record some file history information (especially
> about copies).
> EOF
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg init repo-chain
$ cd repo-chain
Add some linear rename initialy
test-copies: don't use empty file for "same content" cases...
r47281 $ cp ../same-content.txt a
$ cp ../same-content.txt b
$ cp ../same-content.txt h
copies-tests: add a `h` to the root commit (for chain merge tests)...
r44942 $ hg ci -Am 'i-0 initial commit: a b h'
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 adding a
adding b
copies-tests: add a `h` to the root commit (for chain merge tests)...
r44942 adding h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg mv a c
$ hg ci -Am 'i-1: a -move-> c'
$ hg mv c d
$ hg ci -Am 'i-2: c -move-> d'
$ hg log -G
copies-tests: remove spurious `]` in the template...
r45153 @ 2 i-2: c -move-> d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
copies-tests: swap two branch description...
r44938 And having another branch with renames on the other side
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
$ hg mv d e
$ hg ci -Am 'a-1: d -move-> e'
$ hg mv e f
$ hg ci -Am 'a-2: e -move-> f'
$ hg log -G --rev '::.'
copies-tests: remove spurious `]` in the template...
r45153 @ 4 a-2: e -move-> f
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 3 a-1: d -move-> e
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
copies-tests: swap two branch description...
r44938 Have a branching with nothing on one side
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
$ hg up 'desc("i-2")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo foo > b
$ hg ci -m 'b-1: b update'
created new head
$ hg log -G --rev '::.'
copies-tests: remove spurious `]` in the template...
r45153 @ 5 b-1: b update
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 Create a branch that delete a file previous renamed
$ hg up 'desc("i-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg rm d
$ hg ci -m 'c-1 delete d'
created new head
$ hg log -G --rev '::.'
@ 6 c-1 delete d
|
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Create a branch that delete a file previous renamed and recreate it
$ hg up 'desc("i-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg rm d
$ hg ci -m 'd-1 delete d'
created new head
$ echo bar > d
$ hg add d
$ hg ci -m 'd-2 re-add d'
$ hg log -G --rev '::.'
@ 8 d-2 re-add d
|
o 7 d-1 delete d
|
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Having another branch renaming a different file to the same filename as another
$ hg up 'desc("i-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg mv b g
$ hg ci -m 'e-1 b -move-> g'
created new head
$ hg mv g f
$ hg ci -m 'e-2 g -move-> f'
$ hg log -G --rev '::.'
@ 10 e-2 g -move-> f
|
o 9 e-1 b -move-> g
|
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
copies: split creation of the graph and actual checking again...
r46324 Setup all merge
===============
This is done beforehand to validate that the upgrade process creates valid copy
information.
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 merging with unrelated change does not interfere with the renames
---------------------------------------------------------------
- rename on one side
- unrelated change on the other side
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
test-copies: improve description of the A+B case...
r47283 $ case_desc="simple merge - A side: multiple renames, B side: unrelated update"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg up 'desc("b-1")'
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg merge 'desc("a-2")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mBAm-0 $case_desc - one way"
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg up 'desc("a-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("b-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mABm-0 $case_desc - the other way"
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 created new head
$ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
test-copies: improve description of the A+B case...
r47283 @ 12 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |\
test-copies: improve description of the A+B case...
r47283 +---o 11 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 | |/
copies-tests: remove spurious `]` in the template...
r45153 | o 5 b-1: b update
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 4 a-2: e -move-> f
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 3 a-1: d -move-> e
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |/
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
copies: split creation of the graph and actual checking again...
r46324
merging with the side having a delete
-------------------------------------
case summary:
- one with change to an unrelated file
- one deleting the change
and recreate an unrelated file after the merge
test-copies: improve description of the B+C case...
r47284 $ case_desc="simple merge - C side: delete a file with copies history , B side: unrelated update"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("b-1")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg merge 'desc("c-1")'
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mBCm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 $ echo bar > d
$ hg add d
$ hg ci -m 'mBCm-1 re-add d'
$ hg up 'desc("c-1")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg merge 'desc("b-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mCBm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ echo bar > d
$ hg add d
$ hg ci -m 'mCBm-1 re-add d'
$ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
@ 16 mCBm-1 re-add d
|
test-copies: improve description of the B+C case...
r47284 o 15 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
| | o 14 mBCm-1 re-add d
| | |
test-copies: improve description of the B+C case...
r47284 +---o 13 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 6 c-1 delete d
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Comparing with a merge re-adding the file afterward
---------------------------------------------------
Merge:
- one with change to an unrelated file
- one deleting and recreating the change
test-copies: improve description of the B+D case...
r47285 $ case_desc="simple merge - B side: unrelated update, D side: delete and recreate a file (with different content)"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("b-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("d-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mBDm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("d-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("b-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mDBm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
test-copies: improve description of the B+D case...
r47285 @ 18 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the B+D case...
r47285 +---o 17 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 8 d-2 re-add d
| |
| o 7 d-1 delete d
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Comparing with a merge with colliding rename
--------------------------------------------
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: new copy information on both side
``````````````````````````````````````````
copies: split creation of the graph and actual checking again...
r46324 - the "e-" branch renaming b to f (through 'g')
- the "a-" branch renaming d to f (through e)
test-copies: improve description of the A+E case...
r47286 $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("a-2")'
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 $ hg merge 'desc("e-2")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 (branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mAEm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("e-2")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
$ hg merge 'desc("a-2")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 (branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mEAm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
test-copies: improve description of the A+E case...
r47286 @ 20 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the A+E case...
r47286 +---o 19 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 10 e-2 g -move-> f
| |
| o 9 e-1 b -move-> g
| |
o | 4 a-2: e -move-> f
| |
o | 3 a-1: d -move-> e
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: existing copy information overwritten on one branch
````````````````````````````````````````````````````````````
copies: split creation of the graph and actual checking again...
r46324
Merge:
- one with change to an unrelated file (b)
- one overwriting a file (d) with a rename (from h to i to d)
test-copies: improve description of the B+F case...
r47292 $ case_desc="simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("i-2")'
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg mv h i
$ hg commit -m "f-1: rename h -> i"
created new head
$ hg mv --force i d
$ hg commit -m "f-2: rename i -> d"
$ hg debugindex d
rev linkrev nodeid p1 p2
test-copies: don't use empty file for "same content" cases...
r47281 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
copies: split creation of the graph and actual checking again...
r46324 1 8 b004912a8510 000000000000 000000000000
test-copies: don't use empty file for "same content" cases...
r47281 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("b-1")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 $ hg merge 'desc("f-2")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 (branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mBFm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("f-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("b-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mFBm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
test-copies: improve description of the B+F case...
r47292 @ 24 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the B+F case...
r47292 +---o 23 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 22 f-2: rename i -> d
| |
| o 21 f-1: rename h -> i
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: reset of the copy history on one side
``````````````````````````````````````````````
copies: split creation of the graph and actual checking again...
r46324 Merge:
- one with change to a file
- one deleting and recreating the file
Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
consider history and rename on both branch of the merge.
test-copies: improve description of the D+G case...
r47287 $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("i-2")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 $ echo "some update" >> d
$ hg commit -m "g-1: update d"
created new head
$ hg up 'desc("d-2")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("g-1")' --tool :union
merging d
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mDGm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("g-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("d-2")' --tool :union
merging d
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mGDm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
test-copies: improve description of the D+G case...
r47287 @ 27 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the D+G case...
r47287 +---o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 25 g-1: update d
| |
o | 8 d-2 re-add d
| |
o | 7 d-1 delete d
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
````````````````````````````````````````````````````````````````````````````````````````````
copies: split creation of the graph and actual checking again...
r46324
Merge:
- one with change to a file (d)
- one overwriting that file with a rename (from h to i, to d)
This case is similar to BF/FB, but an actual merge happens, so both side of the
history are relevant.
Note:
| In this case, the merge get conflicting information since on one side we have
| "a -> c -> d". and one the other one we have "h -> i -> d".
|
| The current code arbitrarily pick one side
test-copies: improve description of the G+F case...
r47288 $ case_desc="merge - G side: content change, F side: copy overwrite, no content change"
test-copies: use intermediate variable some commit descriptions...
r47282
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("f-2")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg merge 'desc("g-1")' --tool :union
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 merging d (no-changeset !)
0 files updated, 1 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 (branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mFGm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg up 'desc("g-1")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 $ hg merge 'desc("f-2")' --tool :union
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 merging d (no-changeset !)
0 files updated, 1 files merged, 1 files removed, 0 files unresolved (no-changeset !)
0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
copies: split creation of the graph and actual checking again...
r46324 (branch merge, don't forget to commit)
test-copies: use intermediate variable some commit descriptions...
r47282 $ hg ci -m "mGFm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
test-copies: improve description of the G+F case...
r47288 @ 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the G+F case...
r47288 +---o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 25 g-1: update d
| |
o | 22 f-2: rename i -> d
| |
o | 21 f-1: rename h -> i
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Comparing with merging with a deletion (and keeping the file)
-------------------------------------------------------------
Merge:
- one removing a file (d)
- one updating that file
- the merge keep the modified version of the file (canceling the delete)
In this case, the file keep on living after the merge. So we should not drop its
copy tracing chain.
test-copies: improve description of the G+C case...
r47289 $ case_desc="merge updated/deleted - revive the file (updated content)"
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("c-1")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg merge 'desc("g-1")'
file 'd' was deleted in local [working copy] but was modified in other [merge rev].
You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
What do you want to do? u
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
[1]
$ hg resolve -t :other d
(no more unresolved files)
test-copies: improve description of the G+C case...
r47289 $ hg ci -m "mCGm-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg up 'desc("g-1")'
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("c-1")'
file 'd' was deleted in other [merge rev] but was modified in local [working copy].
You can use (c)hanged version, (d)elete, or leave (u)nresolved.
What do you want to do? u
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
[1]
$ hg resolve -t :local d
(no more unresolved files)
test-copies: improve description of the G+C case...
r47289 $ hg ci -m "mGCm-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
test-copies: improve description of the G+C case...
r47289 @ 31 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the G+C case...
r47289 +---o 30 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 25 g-1: update d
| |
o | 6 c-1 delete d
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Comparing with merge restoring an untouched deleted file
--------------------------------------------------------
Merge:
- one removing a file (d)
- one leaving the file untouched
- the merge actively restore the file to the same content.
In this case, the file keep on living after the merge. So we should not drop its
copy tracing chain.
test-copies: improve description of the B+C "revert/restore" case...
r47290 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
copies: split creation of the graph and actual checking again...
r46324 $ hg up 'desc("c-1")'
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg merge 'desc("b-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg revert --rev 'desc("b-1")' d
test-copies: improve description of the B+C "revert/restore" case...
r47290 $ hg ci -m "mCB-revert-m-0 $case_desc - one way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg up 'desc("b-1")'
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("c-1")'
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg revert --rev 'desc("b-1")' d
test-copies: improve description of the B+C "revert/restore" case...
r47290 $ hg ci -m "mBC-revert-m-0 $case_desc - the other way"
copies: split creation of the graph and actual checking again...
r46324 created new head
$ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
test-copies: improve description of the B+C "revert/restore" case...
r47290 @ 33 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the B+C "revert/restore" case...
r47290 +---o 32 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 6 c-1 delete d
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
$ hg up null --quiet
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 Merging a branch where a rename was deleted with a branch where the same file was renamed
------------------------------------------------------------------------------------------
Create a "conflicting" merge where `d` get removed on one branch before its
rename information actually conflict with the other branch.
(the copy information from the branch that was not deleted should win).
test-copies: improve description of the C+H case...
r47291 $ case_desc="simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch)"
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 $ hg up 'desc("i-0")'
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg mv b d
$ hg ci -m "h-1: b -(move)-> d"
created new head
$ hg up 'desc("c-1")'
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg merge 'desc("h-1")'
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: improve description of the C+H case...
r47291 $ hg ci -m "mCH-delete-before-conflict-m-0 $case_desc - one way"
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394
$ hg up 'desc("h-1")'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge 'desc("c-1")'
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
test-copies: improve description of the C+H case...
r47291 $ hg ci -m "mHC-delete-before-conflict-m-0 $case_desc - the other way"
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 created new head
$ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
test-copies: improve description of the C+H case...
r47291 @ 36 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 |\
test-copies: improve description of the C+H case...
r47291 +---o 35 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 | |/
| o 34 h-1: b -(move)-> d
| |
o | 6 c-1 delete d
| |
o | 2 i-2: c -move-> d
| |
o | 1 i-1: a -move-> c
|/
o 0 i-0 initial commit: a b h
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325
copies-tests: add a summary of all cases created in test-copies-chain-merge.t...
r46801 Summary of all created cases
----------------------------
copies-tests: update to null in test-copies-chain-merge.t...
r46802 $ hg up --quiet null
copies-tests: add a summary of all cases created in test-copies-chain-merge.t...
r46801 (This exists to help keeping a compact list of the various cases we have built)
$ hg log -T '{desc|firstline}\n'| sort
a-1: d -move-> e
a-2: e -move-> f
b-1: b update
c-1 delete d
d-1 delete d
d-2 re-add d
e-1 b -move-> g
e-2 g -move-> f
f-1: rename h -> i
f-2: rename i -> d
g-1: update d
h-1: b -(move)-> d
i-0 initial commit: a b h
i-1: a -move-> c
i-2: c -move-> d
test-copies: improve description of the A+B case...
r47283 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
test-copies: improve description of the A+E case...
r47286 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
test-copies: improve description of the A+B case...
r47283 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
test-copies: improve description of the B+C "revert/restore" case...
r47290 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
test-copies: improve description of the B+C case...
r47284 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
copies-tests: add a summary of all cases created in test-copies-chain-merge.t...
r46801 mBCm-1 re-add d
test-copies: improve description of the B+D case...
r47285 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
test-copies: improve description of the B+F case...
r47292 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
test-copies: improve description of the B+C "revert/restore" case...
r47290 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
test-copies: improve description of the B+C case...
r47284 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
copies-tests: add a summary of all cases created in test-copies-chain-merge.t...
r46801 mCBm-1 re-add d
test-copies: improve description of the G+C case...
r47289 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
test-copies: improve description of the C+H case...
r47291 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
test-copies: improve description of the B+D case...
r47285 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
test-copies: improve description of the D+G case...
r47287 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
test-copies: improve description of the A+E case...
r47286 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
test-copies: improve description of the B+F case...
r47292 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
test-copies: improve description of the G+F case...
r47288 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
test-copies: improve description of the G+C case...
r47289 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
test-copies: improve description of the D+G case...
r47287 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
test-copies: improve description of the G+F case...
r47288 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
test-copies: improve description of the C+H case...
r47291 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
copies-tests: add a summary of all cases created in test-copies-chain-merge.t...
r46801
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325 Test that sidedata computations during upgrades are correct
===========================================================
We upgrade a repository that is not using sidedata (the filelog case) and
check that the same side data have been generated as if they were computed at
commit time.
upgrade: allow sidedata upgrade to modify revision flag...
r46327 #if upgraded
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325 $ cat >> $HGRCPATH << EOF
> [format]
> exp-use-side-data = yes
> exp-use-copies-side-data-changeset = yes
> EOF
$ hg debugformat -v
format-variant repo config default
fncache: yes yes yes
dotencode: yes yes yes
generaldelta: yes yes yes
Pulkit Goyal
share: move share safe functionality out of experimental...
r47052 share-safe: no no no
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325 sparserevlog: yes yes yes
sidedata: no yes no
persistent-nodemap: no no no
copies-sdc: no yes no
plain-cl-delta: yes yes yes
compression: * (glob)
compression-level: default default default
$ hg debugupgraderepo --run --quiet
upgrade will perform the following actions:
requirements
preserved: * (glob)
added: exp-copies-sidedata-changeset, exp-sidedata-flag
upgrade: display the list of processed revlog before proceeding...
r46649 processed revlogs:
- all-filelogs
- changelog
- manifest
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325 #endif
upgrade: allow sidedata upgrade to modify revision flag...
r46327 #if no-compatibility no-filelog no-changeset
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325
copy-tracing: add a --compute flag to debugchangedfiles...
r47208 $ hg debugchangedfiles --compute 0
added : a, ;
added : b, ;
added : h, ;
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
> echo "##### revision $rev #####"
> hg debugsidedata -c -v -- $rev
> hg debugchangedfiles $rev
> done
##### revision 0 #####
1 sidedata entries
entry-0014 size 34
'\x00\x00\x00\x03\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00abh'
added : a, ;
added : b, ;
added : h, ;
##### revision 1 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac'
removed : a, ;
added p1: c, a;
##### revision 2 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd'
removed : c, ;
added p1: d, c;
##### revision 3 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
removed : d, ;
added p1: e, d;
##### revision 4 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
removed : e, ;
added p1: f, e;
##### revision 5 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
touched : b, ;
##### revision 6 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
removed : d, ;
##### revision 7 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
removed : d, ;
##### revision 8 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
added : d, ;
##### revision 9 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
removed : b, ;
added p1: g, b;
##### revision 10 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
added p1: f, g;
removed : g, ;
##### revision 11 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 12 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 13 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 14 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
added : d, ;
##### revision 15 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 16 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
added : d, ;
##### revision 17 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 18 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 19 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
merged : f, ;
##### revision 20 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
merged : f, ;
##### revision 21 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
removed : h, ;
added p1: i, h;
##### revision 22 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
touched p1: d, i;
removed : i, ;
##### revision 23 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 24 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 25 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
touched : d, ;
##### revision 26 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
merged : d, ;
##### revision 27 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
merged : d, ;
##### revision 28 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
merged : d, ;
##### revision 29 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
merged : d, ;
##### revision 30 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
salvaged : d, ;
##### revision 31 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
salvaged : d, ;
##### revision 32 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
salvaged : d, ;
##### revision 33 #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
salvaged : d, ;
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 ##### revision 34 #####
1 sidedata entries
entry-0014 size 24
'\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
removed : b, ;
added p1: d, b;
##### revision 35 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
##### revision 36 #####
1 sidedata entries
entry-0014 size 4
'\x00\x00\x00\x00'
test: move upgrade run and check earlier in test-copies-chain-merge...
r46325
#endif
copies: split creation of the graph and actual checking again...
r46324 Test copy information chaining
==============================
copies: properly match result during changeset centric copy tracing...
r46774 Check that matching only affect the destination and not intermediate path
-------------------------------------------------------------------------
The two status call should give the same value for f
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
A f
a
R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
A f
a (no-changeset no-compatibility !)
copies: split creation of the graph and actual checking again...
r46324 merging with unrelated change does not interfere with the renames
---------------------------------------------------------------
- rename on one side
- unrelated change on the other side
$ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
test-copies: improve description of the A+B case...
r47283 o 12 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
copies: split creation of the graph and actual checking again...
r46324 |\
test-copies: improve description of the A+B case...
r47283 +---o 11 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
copies: split creation of the graph and actual checking again...
r46324 | |/
| o 5 b-1: b update
| |
o | 4 a-2: e -move-> f
| |
o | 3 a-1: d -move-> e
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
A f
d
R d
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
A f
d
R d
$ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
M b
$ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
M b
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
M b
A f
d
R d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
M b
A f
d
R d
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
M b
A f
a
R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
M b
A f
a
R a
merging with the side having a delete
-------------------------------------
case summary:
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 - one with change to an unrelated file
- one deleting the change
and recreate an unrelated file after the merge
$ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
copies: split creation of the graph and actual checking again...
r46324 o 16 mCBm-1 re-add d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
test-copies: improve description of the B+C case...
r47284 o 15 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |\
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 | | o 14 mBCm-1 re-add d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 | | |
test-copies: improve description of the B+C case...
r47284 +---o 13 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 | |/
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 | o 6 c-1 delete d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 5 b-1: b update
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |/
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
- comparing from the merge
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
R d
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
R d
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
M b
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
M b
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
M b
R d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
M b
R d
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
M b
R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
M b
R a
- comparing with the merge children re-adding the file
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
M d
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
M d
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
M b
A d
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
M b
A d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
M b
M d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
M b
M d
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
M b
A d
R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
M b
A d
R a
Comparing with a merge re-adding the file afterward
---------------------------------------------------
Merge:
- one with change to an unrelated file
- one deleting and recreating the change
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
test-copies: improve description of the B+D case...
r47285 o 18 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 |\
test-copies: improve description of the B+D case...
r47285 +---o 17 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 | |/
| o 8 d-2 re-add d
| |
| o 7 d-1 delete d
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
M d
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
M d
$ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
M b
$ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
M b
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
M b
M d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
M b
M d
copies-tests: update the analysis of the BD/DB cases...
r44939 The bugs makes recorded copy is different depending of where we started the merge from since
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
$ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
Pulkit Goyal
mergestate: store about files resolved in favour of other...
r45178 b004912a8510032a0350a74daa2803dadfb00e12 644 d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
b004912a8510032a0350a74daa2803dadfb00e12 644 d
$ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
b004912a8510032a0350a74daa2803dadfb00e12 644 d
$ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
test-copies: don't use empty file for "same content" cases...
r47281 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
copies: split creation of the graph and actual checking again...
r46324 $ hg debugindex d | head -n 4
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 rev linkrev nodeid p1 p2
test-copies: don't use empty file for "same content" cases...
r47281 0 2 d8252ab2e760 000000000000 000000000000 (no-changeset !)
0 2 ae258f702dfe 000000000000 000000000000 (changeset !)
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 1 8 b004912a8510 000000000000 000000000000
test-copies: don't use empty file for "same content" cases...
r47281 2 22 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
2 25 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
Pulkit Goyal
tests: update/remove outdated comments in test-copies-chain-merge.t...
r46230 Log output should not include a merge commit as it did not happen
copies-tests: update the analysis of the BD/DB cases...
r44939
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg log -Gfr 'desc("mBDm-0")' d
Pulkit Goyal
mergestate: store about files resolved in favour of other...
r45178 o 8 d-2 re-add d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
Pulkit Goyal
mergestate: store about files resolved in favour of other...
r45178 ~
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
$ hg log -Gfr 'desc("mDBm-0")' d
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 o 8 d-2 re-add d
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 |
~
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
M b
A d
R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
M b
A d
R a
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169
copies-tests: clarify the description of the EA/AE cases...
r44940 Comparing with a merge with colliding rename
--------------------------------------------
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: new copy information on both side
``````````````````````````````````````````
copies-tests: clarify the description of the EA/AE cases...
r44940 - the "e-" branch renaming b to f (through 'g')
- the "a-" branch renaming d to f (through e)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
test-copies: improve description of the A+E case...
r47286 o 20 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 |\
test-copies: improve description of the A+E case...
r47286 +---o 19 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 | |/
| o 10 e-2 g -move-> f
| |
| o 9 e-1 b -move-> g
| |
o | 4 a-2: e -move-> f
| |
o | 3 a-1: d -move-> e
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 e8825b386367b29fec957283a80bb47b47483fe1 644 f
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg debugindex f
rev linkrev nodeid p1 p2
test-copies: don't use empty file for "same content" cases...
r47281 0 4 b76eb76580df 000000000000 000000000000
1 10 e8825b386367 000000000000 000000000000
2 19 2ff93c643948 b76eb76580df e8825b386367
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
$ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
test-copies: don't use empty file for "same content" cases...
r47281 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg debugindex f
rev linkrev nodeid p1 p2
test-copies: don't use empty file for "same content" cases...
r47281 0 4 ae258f702dfe 000000000000 000000000000
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #endif
copies: fix the changeset based algorithm regarding merge...
r45252
# Here the filelog based implementation is not looking at the rename
# information (because the file exist on both side). However the changelog
# based on works fine. We have different output.
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M f (no-changeset !)
b (no-filelog no-changeset !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 R b
$ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M f (no-changeset !)
b (no-filelog no-changeset !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 R b
$ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M f (no-changeset !)
d (no-filelog no-changeset !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 R d
$ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M f (no-changeset !)
d (no-filelog no-changeset !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 R d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
A f
d
R d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
A f
b
R b
copies: fix the changeset based algorithm regarding merge...
r45252
# From here, we run status against revision where both source file exists.
#
# The filelog based implementation picks an arbitrary side based on revision
# numbers. So the same side "wins" whatever the parents order is. This is
# sub-optimal because depending on revision numbers means the result can be
# different from one repository to the next.
#
# The changeset based algorithm use the parent order to break tie on conflicting
# information and will have a different order depending on who is p1 and p2.
# That order is stable accross repositories. (data from p1 prevails)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
A f
d
R b
R d
$ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
A f
copies: fix the changeset based algorithm regarding merge...
r45252 d (filelog !)
b (no-filelog !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 R b
R d
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
A f
a
R a
R b
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
A f
copies: fix the changeset based algorithm regarding merge...
r45252 a (filelog !)
b (no-filelog !)
copies: add a new test dedicated to testing chain of changeset with merge...
r44762 R a
R b
copies-tests: add a test with a rename overwriting another file...
r44943
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: existing copy information overwritten on one branch
````````````````````````````````````````````````````````````
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 Note:
| In this case, one of the merge wrongly record a merge while there is none.
| This lead to bad copy tracing information to be dug up.
copies-tests: add a test with a rename overwriting another file...
r44943 Merge:
- one with change to an unrelated file (b)
- one overwriting a file (d) with a rename (from h to i to d)
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
test-copies: improve description of the B+F case...
r47292 o 24 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 |\
test-copies: improve description of the B+F case...
r47292 +---o 23 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 | |/
| o 22 f-2: rename i -> d
| |
| o 21 f-1: rename h -> i
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
copies-tests: add a test with a rename overwriting another file...
r44943 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
M b
A d
Pulkit Goyal
mergestate: store about files resolved in favour of other...
r45178 h
copies-tests: add a test with a rename overwriting another file...
r44943 R a
R h
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
M b
A d
h
R a
R h
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M d (no-changeset !)
h (no-filelog no-changeset !)
copies-tests: add a test with a rename overwriting another file...
r44943 R h
$ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
M b
$ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
M b
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M d (no-changeset !)
i (no-filelog no-changeset !)
copies-tests: add a test with a rename overwriting another file...
r44943 R i
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M d (no-changeset !)
h (no-filelog no-changeset !)
copies-tests: add a test with a rename overwriting another file...
r44943 R h
$ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
M b
$ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
M b
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M d (no-changeset !)
i (no-filelog no-changeset !)
copies-tests: add a test with a rename overwriting another file...
r44943 R i
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies-tests: add a test with a rename overwriting another file...
r44943 $ hg log -Gfr 'desc("mBFm-0")' d
Pulkit Goyal
mergestate: store about files resolved in favour of other...
r45178 o 22 f-2: rename i -> d
copies-tests: add a test with a rename overwriting another file...
r44943 |
Pulkit Goyal
mergestate: store about files resolved in favour of other...
r45178 o 21 f-1: rename h -> i
:
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies-tests: add a test with a rename overwriting another file...
r44943
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
Martin von Zweigbergk
tests: add notes about broken `hg log --follow <file>` with copies in extras...
r46363 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg log -Gfr 'desc("mBFm-0")' d
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 o 2 i-2: c -move-> d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 |
~
#endif
copies-tests: add a test with a rename overwriting another file...
r44943
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies-tests: add a test with a rename overwriting another file...
r44943 $ hg log -Gfr 'desc("mFBm-0")' d
copies-tests: remove spurious `]` in the template...
r45153 o 22 f-2: rename i -> d
copies-tests: add a test with a rename overwriting another file...
r44943 |
copies-tests: remove spurious `]` in the template...
r45153 o 21 f-1: rename h -> i
copies-tests: add a test with a rename overwriting another file...
r44943 :
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies-tests: add a test with a rename overwriting another file...
r44943
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
Martin von Zweigbergk
tests: add notes about broken `hg log --follow <file>` with copies in extras...
r46363 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg log -Gfr 'desc("mFBm-0")' d
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 o 2 i-2: c -move-> d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 |
~
#endif
copies-tests: add a case where a file is deleted/added but with a merge...
r44944
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: reset of the copy history on one side
``````````````````````````````````````````````
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 Merge:
- one with change to a file
- one deleting and recreating the file
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 consider history and rename on both branch of the merge.
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
test-copies: improve description of the D+G case...
r47287 o 27 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 |\
test-copies: improve description of the D+G case...
r47287 +---o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 | |/
| o 25 g-1: update d
| |
o | 8 d-2 re-add d
| |
o | 7 d-1 delete d
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
copies: fix the changeset based algorithm regarding merge...
r45252 One side of the merge have a long history with rename. The other side of the
merge point to a new file with a smaller history. Each side is "valid".
(and again the filelog based algorithm only explore one, with a pick based on
revision numbers)
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
A d
copies: fix the changeset based algorithm regarding merge...
r45252 a (filelog !)
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
A d
a
R a
$ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
M d
$ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
M d
$ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
M d
$ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
M d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 $ hg log -Gfr 'desc("mDGm-0")' d
test-copies: improve description of the G+F case...
r47288 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |\
copies-tests: remove spurious `]` in the template...
r45153 | o 25 g-1: update d
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 | |
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 o | 8 d-2 re-add d
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |/
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies-tests: add a case where a file is deleted/added but with a merge...
r44944
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
Martin von Zweigbergk
tests: add notes about broken `hg log --follow <file>` with copies in extras...
r46363 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg log -Gfr 'desc("mDGm-0")' d
test-copies: improve description of the D+G case...
r47287 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 |\
| o 25 g-1: update d
| |
o | 8 d-2 re-add d
|/
o 2 i-2: c -move-> d
|
~
#endif
copies-tests: add a case where a file is deleted/added but with a merge...
r44944
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 $ hg log -Gfr 'desc("mDGm-0")' d
test-copies: improve description of the G+F case...
r47288 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |\
copies-tests: remove spurious `]` in the template...
r45153 | o 25 g-1: update d
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 | |
Martin von Zweigbergk
tests: collect all branch creation in one place in test-copies-chain-merge.t...
r45168 o | 8 d-2 re-add d
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |/
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies-tests: add a case where a file is deleted/added but with a merge...
r44944 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies-tests: add a case where a file is deleted/added but with a merge...
r44944
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
Martin von Zweigbergk
tests: add notes about broken `hg log --follow <file>` with copies in extras...
r46363 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg log -Gfr 'desc("mDGm-0")' d
test-copies: improve description of the D+G case...
r47287 o 26 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 |\
| o 25 g-1: update d
| |
o | 8 d-2 re-add d
|/
o 2 i-2: c -move-> d
|
~
#endif
copies-tests: add a case where with merge with an overwritten files...
r44945
test-copies: add subcase titles for various "conflicting" information variant...
r47293 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
````````````````````````````````````````````````````````````````````````````````````````````
copies-tests: add a case where with merge with an overwritten files...
r44945
Merge:
- one with change to a file (d)
- one overwriting that file with a rename (from h to i, to d)
This case is similar to BF/FB, but an actual merge happens, so both side of the
history are relevant.
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
test-copies: improve description of the G+F case...
r47288 o 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 |\
test-copies: improve description of the G+F case...
r47288 +---o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
Martin von Zweigbergk
tests: move verification closer to setup in test-copies-chain-merge.t...
r45169 | |/
| o 25 g-1: update d
| |
o | 22 f-2: rename i -> d
| |
o | 21 f-1: rename h -> i
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
copies: explain the "arbitrary" copy source pick in case of conflict...
r46775
Note:
| In this case, the merge get conflicting information since on one side we have
| "a -> c -> d". and one the other one we have "h -> i -> d".
|
| The current code arbitrarily pick one side depending the ordering of the merged hash:
In this case, the file hash from "f-2" is lower, so it will be `p1` of the resulting filenode its copy tracing information will win (and trace back to "h"):
Details on this hash ordering pick:
$ hg manifest --debug 'desc("g-1")' | egrep 'd$'
test-copies: don't use empty file for "same content" cases...
r47281 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
copies: explain the "arbitrary" copy source pick in case of conflict...
r46775 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
A d
a (no-changeset no-compatibility !)
$ hg manifest --debug 'desc("f-2")' | egrep 'd$'
test-copies: don't use empty file for "same content" cases...
r47281 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
copies: explain the "arbitrary" copy source pick in case of conflict...
r46775 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
A d
h (no-changeset no-compatibility !)
Copy tracing data on the resulting merge:
copies-tests: add a case where with merge with an overwritten files...
r44945 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
A d
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 h (no-filelog !)
a (filelog !)
copies-tests: add a case where with merge with an overwritten files...
r44945 R a
R h
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
A d
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 a (no-changeset !)
h (changeset !)
copies-tests: add a case where with merge with an overwritten files...
r44945 R a
R h
$ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
M d
$ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
M d
$ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
M d
copies: fix the changeset based algorithm regarding merge...
r45252 i (no-filelog !)
copies-tests: add a case where with merge with an overwritten files...
r44945 R i
$ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
M d
copies: fix the changeset based algorithm regarding merge...
r45252 i (no-filelog !)
copies-tests: add a case where with merge with an overwritten files...
r44945 R i
$ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M d (no-changeset !)
h (no-filelog no-changeset !)
copies-tests: add a case where with merge with an overwritten files...
r44945 R h
$ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 M d (no-changeset !)
h (no-filelog no-changeset !)
copies-tests: add a case where with merge with an overwritten files...
r44945 R h
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies-tests: add a case where with merge with an overwritten files...
r44945 $ hg log -Gfr 'desc("mFGm-0")' d
test-copies: improve description of the G+F case...
r47288 o 28 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
copies-tests: add a case where with merge with an overwritten files...
r44945 |\
copies-tests: remove spurious `]` in the template...
r45153 | o 25 g-1: update d
copies-tests: add a case where with merge with an overwritten files...
r44945 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 22 f-2: rename i -> d
copies-tests: add a case where with merge with an overwritten files...
r44945 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 21 f-1: rename h -> i
copies-tests: add a case where with merge with an overwritten files...
r44945 |/
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies-tests: add a case where with merge with an overwritten files...
r44945 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies-tests: add a case where with merge with an overwritten files...
r44945 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies-tests: add a case where with merge with an overwritten files...
r44945
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
Martin von Zweigbergk
tests: add notes about broken `hg log --follow <file>` with copies in extras...
r46363 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg log -Gfr 'desc("mFGm-0")' d
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 o 25 g-1: update d
|
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 o 2 i-2: c -move-> d
|
~
#endif
copies-tests: add a case where with merge with an overwritten files...
r44945
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #if no-changeset
copies-tests: add a case where with merge with an overwritten files...
r44945 $ hg log -Gfr 'desc("mGFm-0")' d
test-copies: improve description of the G+F case...
r47288 o 29 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
copies-tests: add a case where with merge with an overwritten files...
r44945 |\
copies-tests: remove spurious `]` in the template...
r45153 | o 25 g-1: update d
copies-tests: add a case where with merge with an overwritten files...
r44945 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 22 f-2: rename i -> d
copies-tests: add a case where with merge with an overwritten files...
r44945 | |
copies-tests: remove spurious `]` in the template...
r45153 o | 21 f-1: rename h -> i
copies-tests: add a case where with merge with an overwritten files...
r44945 |/
copies-tests: remove spurious `]` in the template...
r45153 o 2 i-2: c -move-> d
copies-tests: add a case where with merge with an overwritten files...
r44945 |
copies-tests: remove spurious `]` in the template...
r45153 o 1 i-1: a -move-> c
copies-tests: add a case where with merge with an overwritten files...
r44945 |
copies-tests: remove spurious `]` in the template...
r45153 o 0 i-0 initial commit: a b h
copies-tests: add a case where with merge with an overwritten files...
r44945
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 #else
Martin von Zweigbergk
tests: add notes about broken `hg log --follow <file>` with copies in extras...
r46363 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 $ hg log -Gfr 'desc("mGFm-0")' d
test-copies: reinstall initial identical (empty) files for chained copied...
r47277 o 25 g-1: update d
|
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 o 2 i-2: c -move-> d
|
~
#endif
copy-tracing: test case where we go across a changed/deleted merge...
r46032
Comparing with merging with a deletion (and keeping the file)
-------------------------------------------------------------
Merge:
- one removing a file (d)
- one updating that file
- the merge keep the modified version of the file (canceling the delete)
In this case, the file keep on living after the merge. So we should not drop its
copy tracing chain.
$ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
test-copies: improve description of the G+C case...
r47289 o 31 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
copy-tracing: test case where we go across a changed/deleted merge...
r46032 |\
test-copies: improve description of the G+C case...
r47289 +---o 30 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
copy-tracing: test case where we go across a changed/deleted merge...
r46032 | |/
| o 25 g-1: update d
| |
o | 6 c-1 delete d
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
salvaged: properly deal with salvaged file during copy tracing...
r46262 'a' is the copy source of 'd'
copy-tracing: test case where we go across a changed/deleted merge...
r46032
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
A d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 a (no-compatibility no-changeset !)
copy-tracing: test case where we go across a changed/deleted merge...
r46032 R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
A d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 a (no-compatibility no-changeset !)
copy-tracing: test case where we go across a changed/deleted merge...
r46032 R a
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
A d
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
A d
$ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
$ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
copy-tracing: test case where a merge reverted a file deletion...
r46033
Comparing with merge restoring an untouched deleted file
--------------------------------------------------------
Merge:
- one removing a file (d)
- one leaving the file untouched
- the merge actively restore the file to the same content.
In this case, the file keep on living after the merge. So we should not drop its
copy tracing chain.
$ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
test-copies: improve description of the B+C "revert/restore" case...
r47290 o 33 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
copy-tracing: test case where a merge reverted a file deletion...
r46033 |\
test-copies: improve description of the B+C "revert/restore" case...
r47290 +---o 32 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
copy-tracing: test case where a merge reverted a file deletion...
r46033 | |/
| o 6 c-1 delete d
| |
o | 5 b-1: b update
|/
o 2 i-2: c -move-> d
|
o 1 i-1: a -move-> c
|
o 0 i-0 initial commit: a b h
salvaged: properly deal with salvaged file during copy tracing...
r46262 'a' is the the copy source of 'd'
copy-tracing: test case where a merge reverted a file deletion...
r46033
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
M b
A d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 a (no-compatibility no-changeset !)
copy-tracing: test case where a merge reverted a file deletion...
r46033 R a
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
M b
A d
Martin von Zweigbergk
tests: run test-copies-chain-merge.t also with copies in changesets...
r46296 a (no-compatibility no-changeset !)
copy-tracing: test case where a merge reverted a file deletion...
r46033 R a
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
M b
A d
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
M b
A d
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
$ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394
Merging a branch where a rename was deleted with a branch where the same file was renamed
------------------------------------------------------------------------------------------
Create a "conflicting" merge where `d` get removed on one branch before its
rename information actually conflict with the other branch.
(the copy information from the branch that was not deleted should win).
$ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
test-copies: improve description of the C+H case...
r47291 o 36 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 |\
test-copies: improve description of the C+H case...
r47291 +---o 35 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
copies: make sure deleted copy info do not overwriting unrelated ones...
r46394 | |/
| o 34 h-1: b -(move)-> d
| |
o | 6 c-1 delete d
| |
o | 2 i-2: c -move-> d
| |
o | 1 i-1: a -move-> c
|/
o 0 i-0 initial commit: a b h
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
A d
b (no-compatibility no-changeset !)
R a
R b
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
A d
b
R a
R b
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
A d
b
R b
$ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
A d
b
R b
$ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
R a
$ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
R a