D7075: copies: add an explicit test using multiple roots
Closed by commit rHGdda9482f60d2: copies: add an explicit test using multiple roots (authored by marmoute). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7075?vs=17277&id=17359 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7075/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7075 AFFECTED FILES tests/test-copies-unrelated.t CHANGE DETAILS diff --git a/tests/test-copies-unrelated.t b/tests/test-copies-unrelated.t --- a/tests/test-copies-unrelated.t +++ b/tests/test-copies-unrelated.t @@ -394,3 +394,63 @@ $ hg debugpathcopies 2 1 $ hg graft -r 1 grafting 1:* "copy x to y" (glob) + +Copies involving a merge of multiple roots. + + $ newrepo + $ echo a > a + $ hg ci -Aqm 'add a' + $ echo a >> a + $ hg ci -Aqm 'update a' + $ echo a >> a + $ hg ci -Aqm 'update a' + + $ hg up null + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo b > a + $ hg ci -Aqm 'add a' + $ hg mv a b + $ hg ci -Aqm 'move a to b' + $ echo b >> b + $ hg ci -Aqm 'update b' + $ hg merge 0 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg ci -m "merge with other branch" + $ echo a >> a + $ echo a >> a + $ echo b >> b + $ hg ci -Aqm 'update a and b' + $ hg l + @ 7 update a and b + | a b + o6 merge with other branch + |\ + | o 5 update b + | | b + | o 4 move a to b + | | a b + | o 3 add a + |a + | o 2 update a + | | a + | o 1 update a + |/ a + o 0 add a + a + $ hg cat a -r 7 + a + a + a + $ hg cat a -r 2 + a + a + a + $ hg cat a -r 0 + a + $ hg debugpathcopies 7 2 + $ hg debugpathcopies 2 7 + $ hg merge 2 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7075: copies: add an explicit test using multiple roots
marmoute added inline comments. INLINE COMMENTS > martinvonz wrote in test-copies-unrelated.t:403-406 > nit: These seem unlikely to have any effect on the result. remove them? Or at > least one of them? OTOH, you seem to have deliberately made the contents > match in revision 2 and revision 7. What's the reason for that? Did that > trigger a bug in an earlier version of this series? I don't want to write too simple test. There are various optimisation to have around revision without copy informations. So I am adding them in various situation to cache potential error if we introduce such optimisation. The content match is just here so that `hg merge does not complains about a content conflicT) REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7075/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7075 To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7075: copies: add an explicit test using multiple roots
marmoute updated this revision to Diff 17277. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7075?vs=17115&id=17277 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7075/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7075 AFFECTED FILES tests/test-copies-unrelated.t CHANGE DETAILS diff --git a/tests/test-copies-unrelated.t b/tests/test-copies-unrelated.t --- a/tests/test-copies-unrelated.t +++ b/tests/test-copies-unrelated.t @@ -394,3 +394,63 @@ $ hg debugpathcopies 2 1 $ hg graft -r 1 grafting 1:* "copy x to y" (glob) + +Copies involving a merge of multiple roots. + + $ newrepo + $ echo a > a + $ hg ci -Aqm 'add a' + $ echo a >> a + $ hg ci -Aqm 'update a' + $ echo a >> a + $ hg ci -Aqm 'update a' + + $ hg up null + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo b > a + $ hg ci -Aqm 'add a' + $ hg mv a b + $ hg ci -Aqm 'move a to b' + $ echo b >> b + $ hg ci -Aqm 'update b' + $ hg merge 0 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg ci -m "merge with other branch" + $ echo a >> a + $ echo a >> a + $ echo b >> b + $ hg ci -Aqm 'update a and b' + $ hg l + @ 7 update a and b + | a b + o6 merge with other branch + |\ + | o 5 update b + | | b + | o 4 move a to b + | | a b + | o 3 add a + |a + | o 2 update a + | | a + | o 1 update a + |/ a + o 0 add a + a + $ hg cat a -r 7 + a + a + a + $ hg cat a -r 2 + a + a + a + $ hg cat a -r 0 + a + $ hg debugpathcopies 7 2 + $ hg debugpathcopies 2 7 + $ hg merge 2 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7075: copies: add an explicit test using multiple roots
martinvonz added inline comments. INLINE COMMENTS > test-copies-unrelated.t:398 > + > +Copies involving multiple roots. > + nit: maybe "involving *merge* of multiple roots" to clarify how it's different from the case above > test-copies-unrelated.t:403-406 > + $ echo a >> a > + $ hg ci -Aqm 'update a' > + $ echo a >> a > + $ hg ci -Aqm 'update a' nit: These seem unlikely to have any effect on the result. remove them? Or at least one of them? OTOH, you seem to have deliberately made the contents match in revision 2 and revision 7. What's the reason for that? Did that trigger a bug in an earlier version of this series? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7075/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7075 To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7075: copies: add an explicit test using multiple roots
marmoute created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We explicitly add a test checking for copies of connected revision but involving a different roots. This make sure the copies coming purely from the new roots does not interfere with the merge. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7075 AFFECTED FILES tests/test-copies-unrelated.t CHANGE DETAILS diff --git a/tests/test-copies-unrelated.t b/tests/test-copies-unrelated.t --- a/tests/test-copies-unrelated.t +++ b/tests/test-copies-unrelated.t @@ -394,3 +394,63 @@ $ hg debugpathcopies 2 1 $ hg graft -r 1 grafting 1:* "copy x to y" (glob) + +Copies involving multiple roots. + + $ newrepo + $ echo a > a + $ hg ci -Aqm 'add a' + $ echo a >> a + $ hg ci -Aqm 'update a' + $ echo a >> a + $ hg ci -Aqm 'update a' + + $ hg up null + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo b > a + $ hg ci -Aqm 'add a' + $ hg mv a b + $ hg ci -Aqm 'move a to b' + $ echo b >> b + $ hg ci -Aqm 'update b' + $ hg merge 0 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg ci -m "merge with other branch" + $ echo a >> a + $ echo a >> a + $ echo b >> b + $ hg ci -Aqm 'update a and b' + $ hg l + @ 7 update a and b + | a b + o6 merge with other branch + |\ + | o 5 update b + | | b + | o 4 move a to b + | | a b + | o 3 add a + |a + | o 2 update a + | | a + | o 1 update a + |/ a + o 0 add a + a + $ hg cat a -r 7 + a + a + a + $ hg cat a -r 2 + a + a + a + $ hg cat a -r 0 + a + $ hg debugpathcopies 7 2 + $ hg debugpathcopies 2 7 + $ hg merge 2 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + To: marmoute, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel