This make the transitions between case clearer.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
This make the transitions between case clearer.
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| Path | Packages | |||
|---|---|---|---|---|
| M | tests/test-copies-chain-merge.t (20 lines) |
| | | | | ||||
| o 0 i-0 initial commit: a b h | o 0 i-0 initial commit: a b h | ||||
| Comparing with a merge with colliding rename | Comparing with a merge with colliding rename | ||||
| -------------------------------------------- | -------------------------------------------- | ||||
| Subcase: new copy information on both side | |||||
| `````````````````````````````````````````` | |||||
| - the "e-" branch renaming b to f (through 'g') | - the "e-" branch renaming b to f (through 'g') | ||||
| - the "a-" branch renaming d to f (through e) | - the "a-" branch renaming d to f (through e) | ||||
| $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)" | $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)" | ||||
| $ hg up 'desc("a-2")' | $ hg up 'desc("a-2")' | ||||
| 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
| $ hg merge 'desc("e-2")' | $ hg merge 'desc("e-2")' | ||||
| |/ | |/ | ||||
| o 2 i-2: c -move-> d | o 2 i-2: c -move-> d | ||||
| | | | | ||||
| o 1 i-1: a -move-> c | o 1 i-1: a -move-> c | ||||
| | | | | ||||
| o 0 i-0 initial commit: a b h | o 0 i-0 initial commit: a b h | ||||
| Subcase: existing copy information overwritten on one branch | |||||
| ```````````````````````````````````````````````````````````` | |||||
| Merge: | Merge: | ||||
| - one with change to an unrelated file (b) | - one with change to an unrelated file (b) | ||||
| - one overwriting a file (d) with a rename (from h to i to d) | - one overwriting a file (d) with a rename (from h to i to d) | ||||
| $ case_desc="simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)" | $ case_desc="simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)" | ||||
| $ hg up 'desc("i-2")' | $ hg up 'desc("i-2")' | ||||
| o 2 i-2: c -move-> d | o 2 i-2: c -move-> d | ||||
| | | | | ||||
| o 1 i-1: a -move-> c | o 1 i-1: a -move-> c | ||||
| | | | | ||||
| o 0 i-0 initial commit: a b h | o 0 i-0 initial commit: a b h | ||||
| Subcase: reset of the copy history on one side | |||||
| `````````````````````````````````````````````` | |||||
| Merge: | Merge: | ||||
| - one with change to a file | - one with change to a file | ||||
| - one deleting and recreating the file | - one deleting and recreating the file | ||||
| Unlike in the 'BD/DB' cases, an actual merge happened here. So we should | Unlike in the 'BD/DB' cases, an actual merge happened here. So we should | ||||
| consider history and rename on both branch of the merge. | consider history and rename on both branch of the merge. | ||||
| $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content" | $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content" | ||||
| |/ | |/ | ||||
| o 2 i-2: c -move-> d | o 2 i-2: c -move-> d | ||||
| | | | | ||||
| o 1 i-1: a -move-> c | o 1 i-1: a -move-> c | ||||
| | | | | ||||
| o 0 i-0 initial commit: a b h | o 0 i-0 initial commit: a b h | ||||
| Subcase: merging a change to a file with a "copy overwrite" to that file from another branch | |||||
| ```````````````````````````````````````````````````````````````````````````````````````````` | |||||
| Merge: | Merge: | ||||
| - one with change to a file (d) | - one with change to a file (d) | ||||
| - one overwriting that file with a rename (from h to i, to 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 | This case is similar to BF/FB, but an actual merge happens, so both side of the | ||||
| history are relevant. | history are relevant. | ||||
| M b | M b | ||||
| A d | A d | ||||
| R a | R a | ||||
| Comparing with a merge with colliding rename | Comparing with a merge with colliding rename | ||||
| -------------------------------------------- | -------------------------------------------- | ||||
| Subcase: new copy information on both side | |||||
| `````````````````````````````````````````` | |||||
| - the "e-" branch renaming b to f (through 'g') | - the "e-" branch renaming b to f (through 'g') | ||||
| - the "a-" branch renaming d to f (through e) | - the "a-" branch renaming d to f (through e) | ||||
| $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))' | $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))' | ||||
| 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 | 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 | ||||
| |\ | |\ | ||||
| +---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 | +---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 | ||||
| | |/ | | |/ | ||||
| $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")' | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")' | ||||
| A f | A f | ||||
| a (filelog !) | a (filelog !) | ||||
| b (no-filelog !) | b (no-filelog !) | ||||
| R a | R a | ||||
| R b | R b | ||||
| Subcase: existing copy information overwritten on one branch | |||||
| ```````````````````````````````````````````````````````````` | |||||
| Note: | Note: | ||||
| | In this case, one of the merge wrongly record a merge while there is none. | | 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. | | This lead to bad copy tracing information to be dug up. | ||||
| Merge: | Merge: | ||||
| - one with change to an unrelated file (b) | - one with change to an unrelated file (b) | ||||
| - one overwriting a file (d) with a rename (from h to i to d) | - one overwriting a file (d) with a rename (from h to i to d) | ||||
| #else | #else | ||||
| BROKEN: `hg log --follow <file>` relies on filelog metadata to work | BROKEN: `hg log --follow <file>` relies on filelog metadata to work | ||||
| $ hg log -Gfr 'desc("mFBm-0")' d | $ hg log -Gfr 'desc("mFBm-0")' d | ||||
| o 2 i-2: c -move-> d | o 2 i-2: c -move-> d | ||||
| | | | | ||||
| ~ | ~ | ||||
| #endif | #endif | ||||
| Subcase: reset of the copy history on one side | |||||
| `````````````````````````````````````````````` | |||||
| Merge: | Merge: | ||||
| - one with change to a file | - one with change to a file | ||||
| - one deleting and recreating the file | - one deleting and recreating the file | ||||
| Unlike in the 'BD/DB' cases, an actual merge happened here. So we should | Unlike in the 'BD/DB' cases, an actual merge happened here. So we should | ||||
| consider history and rename on both branch of the merge. | consider history and rename on both branch of the merge. | ||||
| | | | | | | ||||
| o | 8 d-2 re-add d | o | 8 d-2 re-add d | ||||
| |/ | |/ | ||||
| o 2 i-2: c -move-> d | o 2 i-2: c -move-> d | ||||
| | | | | ||||
| ~ | ~ | ||||
| #endif | #endif | ||||
| Subcase: merging a change to a file with a "copy overwrite" to that file from another branch | |||||
| ```````````````````````````````````````````````````````````````````````````````````````````` | |||||
| Merge: | Merge: | ||||
| - one with change to a file (d) | - one with change to a file (d) | ||||
| - one overwriting that file with a rename (from h to i, to 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 | This case is similar to BF/FB, but an actual merge happens, so both side of the | ||||
| history are relevant. | history are relevant. | ||||