D5962: copies: add test that makes both the merging csets dirty and fails
This revision was automatically updated to reflect the committed changes. Closed by commit rHGfc4b7a46fda1: copies: add test that makes both the merging csets dirty and fails (authored by khanchi97, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5962?vs=14456=14459 REVISION DETAIL https://phab.mercurial-scm.org/D5962 AFFECTED FILES tests/test-copies.t CHANGE DETAILS diff --git a/tests/test-copies.t b/tests/test-copies.t --- a/tests/test-copies.t +++ b/tests/test-copies.t @@ -1,6 +1,8 @@ #testcases filelog compatibility $ cat >> $HGRCPATH << EOF + > [extensions] + > rebase= > [alias] > l = log -G -T '{rev} {desc}\n{files}\n' > EOF @@ -552,3 +554,80 @@ b +baba +Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty +-- + + $ newrepo + $ echo a > a + $ hg add a + $ hg ci -m "added a" + $ echo b > b + $ hg add b + $ hg ci -m "added b" + + $ echo foobar > willconflict + $ hg add willconflict + $ hg ci -m "added willconflict" + $ echo c > c + $ hg add c + $ hg ci -m "added c" + + $ hg l + @ 3 added c + | c + o 2 added willconflict + | willconflict + o 1 added b + | b + o 0 added a + a + + $ hg up ".^^" + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo d > d + $ hg add d + $ hg ci -m "added d" + created new head + + $ echo barfoo > willconflict + $ hg add willconflict + $ hg ci --amend -m "added willconflict and d" + + $ hg l + @ 5 added willconflict and d + | d willconflict + | o 3 added c + | | c + | o 2 added willconflict + |/ willconflict + o 1 added b + | b + o 0 added a + a + + $ hg rebase -r . -d 2 -t :other + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + + $ hg up 3 -q + $ hg l --hidden + o 6 added willconflict and d + | d willconflict + | x 5 added willconflict and d + | | d willconflict + | | x 4 added d + | |/ d + +---@ 3 added c + | |c + o | 2 added willconflict + |/ willconflict + o 1 added b + | b + o 0 added a + a + +Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case +both the merging csets will be dirty as no one is descendent of base revision: + + $ hg graft -r 6 --base 4 --hidden 2>&1 | grep "AssertionError" + AssertionError + To: khanchi97, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 marked 2 inline comments as done. khanchi97 added a comment. Thanks, I have updated the patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5962 To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 updated this revision to Diff 14456. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5962?vs=14347=14456 REVISION DETAIL https://phab.mercurial-scm.org/D5962 AFFECTED FILES tests/test-copies.t CHANGE DETAILS diff --git a/tests/test-copies.t b/tests/test-copies.t --- a/tests/test-copies.t +++ b/tests/test-copies.t @@ -1,6 +1,8 @@ #testcases filelog compatibility $ cat >> $HGRCPATH << EOF + > [extensions] + > rebase= > [alias] > l = log -G -T '{rev} {desc}\n{files}\n' > EOF @@ -552,3 +554,80 @@ b +baba +Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty +-- + + $ newrepo + $ echo a > a + $ hg add a + $ hg ci -m "added a" + $ echo b > b + $ hg add b + $ hg ci -m "added b" + + $ echo foobar > willconflict + $ hg add willconflict + $ hg ci -m "added willconflict" + $ echo c > c + $ hg add c + $ hg ci -m "added c" + + $ hg l + @ 3 added c + | c + o 2 added willconflict + | willconflict + o 1 added b + | b + o 0 added a + a + + $ hg up ".^^" + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo d > d + $ hg add d + $ hg ci -m "added d" + created new head + + $ echo barfoo > willconflict + $ hg add willconflict + $ hg ci --amend -m "added willconflict and d" + + $ hg l + @ 5 added willconflict and d + | d willconflict + | o 3 added c + | | c + | o 2 added willconflict + |/ willconflict + o 1 added b + | b + o 0 added a + a + + $ hg rebase -r . -d 2 -t :other + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + + $ hg up 3 -q + $ hg l --hidden + o 6 added willconflict and d + | d willconflict + | x 5 added willconflict and d + | | d willconflict + | | x 4 added d + | |/ d + +---@ 3 added c + | |c + o | 2 added willconflict + |/ willconflict + o 1 added b + | b + o 0 added a + a + +Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case +both the merging csets will be dirty as no one is descendent of base revision: + + $ hg graft -r 6 --base 4 --hidden 2>&1 | grep "AssertionError" + AssertionError + To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
martinvonz added inline comments. INLINE COMMENTS > test-copies.t:575 > + > + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' > + @ 3 : 9a8bb7cc6814 added c As in the previous patch, I'd like to avoid hashes in the output by using `hg l`. > test-copies.t:608 > + > + $ hg rebase -r . -d 2 > + rebasing 5:5018b1509e94 "added willconflict and d" (tip) You can use `-t :other` here and not have to manually resolve it REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5962 To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 added a comment. Ping for review. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5962 To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 updated this revision to Diff 14347. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5962?vs=14309=14347 REVISION DETAIL https://phab.mercurial-scm.org/D5962 AFFECTED FILES tests/test-copies.t CHANGE DETAILS diff --git a/tests/test-copies.t b/tests/test-copies.t --- a/tests/test-copies.t +++ b/tests/test-copies.t @@ -1,6 +1,8 @@ #testcases filelog compatibility $ cat >> $HGRCPATH << EOF + > [extensions] + > rebase= > [alias] > l = log -G -T '{rev} {desc}\n{files}\n' > EOF @@ -552,3 +554,108 @@ b +baba +Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty +-- + + $ newrepo + $ echo a > a + $ hg add a + $ hg ci -m "added a" + $ echo b > b + $ hg add b + $ hg ci -m "added b" + + $ echo foobar > willconflict + $ hg add willconflict + $ hg ci -m "added willconflict" + $ echo c > c + $ hg add c + $ hg ci -m "added c" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 3 : 9a8bb7cc6814 added c + | draft + o 2 : d2ea38baf44e added willconflict + | draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg up ".^^" + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo d > d + $ hg add d + $ hg ci -m "added d" + created new head + + $ echo barfoo > willconflict + $ hg add willconflict + $ hg ci --amend -m "added willconflict and d" + + $ hg l + @ 5 added willconflict and d + | d willconflict + | o 3 added c + | | c + | o 2 added willconflict + |/ willconflict + o 1 added b + | b + o 0 added a + a + + $ hg rebase -r . -d 2 + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + merging willconflict + warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] + + $ hg diff + diff -r d2ea38baf44e d + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/d Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,1 @@ + +d + diff -r d2ea38baf44e willconflict + --- a/willconflict Thu Jan 01 00:00:00 1970 + + +++ b/willconflict Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,5 @@ + +<<< dest: d2ea38baf44e - test: added willconflict + foobar + +=== + +barfoo + +>>> source: 5018b1509e94 - test: added willconflict and d + + $ echo barfoo > willconflict + $ hg resolve -m + (no more unresolved files) + continue: hg rebase --continue + $ hg rebase --continue + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + + $ hg up 3 -q + + $ hg l --hidden + o 6 added willconflict and d + | d willconflict + | x 5 added willconflict and d + | | d willconflict + | | x 4 added d + | |/ d + +---@ 3 added c + | |c + o | 2 added willconflict + |/ willconflict + o 1 added b + | b + o 0 added a + a + +Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case +both the merging csets will be dirty as no one is descendent of base revision: + + $ hg graft -r 6 --base 4 --hidden 2>&1 | grep "AssertionError" + AssertionError + To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 updated this revision to Diff 14309. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5962?vs=14240=14309 REVISION DETAIL https://phab.mercurial-scm.org/D5962 AFFECTED FILES tests/test-copies.t CHANGE DETAILS diff --git a/tests/test-copies.t b/tests/test-copies.t --- a/tests/test-copies.t +++ b/tests/test-copies.t @@ -1,6 +1,8 @@ #testcases filelog compatibility $ cat >> $HGRCPATH << EOF + > [extensions] + > rebase= > [alias] > l = log -G -T '{rev} {desc}\n{files}\n' > EOF @@ -597,3 +599,108 @@ +baba +Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty +-- + + $ newrepo + $ echo a > a + $ hg add a + $ hg ci -m "added a" + $ echo b > b + $ hg add b + $ hg ci -m "added b" + + $ echo foobar > willconflict + $ hg add willconflict + $ hg ci -m "added willconflict" + $ echo c > c + $ hg add c + $ hg ci -m "added c" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 3 : 9a8bb7cc6814 added c + | draft + o 2 : d2ea38baf44e added willconflict + | draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg up ".^^" + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo d > d + $ hg add d + $ hg ci -m "added d" + created new head + + $ echo barfoo > willconflict + $ hg add willconflict + $ hg ci --amend -m "added willconflict and d" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 5 : 5018b1509e94 added willconflict and d + | draft + | o 3 : 9a8bb7cc6814 added c + | | draft + | o 2 : d2ea38baf44e added willconflict + |/ draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg rebase -r . -d 2 + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + merging willconflict + warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] + + $ hg diff + diff -r d2ea38baf44e d + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/d Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,1 @@ + +d + diff -r d2ea38baf44e willconflict + --- a/willconflict Thu Jan 01 00:00:00 1970 + + +++ b/willconflict Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,5 @@ + +<<< dest: d2ea38baf44e - test: added willconflict + foobar + +=== + +barfoo + +>>> source: 5018b1509e94 - test: added willconflict and d + + $ echo barfoo > willconflict + $ hg resolve -m + (no more unresolved files) + continue: hg rebase --continue + $ hg rebase --continue + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + + $ hg up 3 -q + + $ hg log -G --hidden -T '{rev} : {node|short} {desc} \n{phase}\n' + o 6 : 99802e4f1e46 added willconflict and d + | draft + | x 5 : 5018b1509e94 added willconflict and d + | | draft + | | x 4 : c9241b0f2d5b added d + | |/ draft + +---@ 3 : 9a8bb7cc6814 added c + | |draft + o | 2 : d2ea38baf44e added willconflict + |/ draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + +Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case +both the merging csets will be dirty as no one is descendent of base revision: + + $ hg graft -r 6 --base c9241b0f2d5b --hidden 2>&1 | grep "AssertionError" + AssertionError + To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5962: copies: add test that makes both the merging csets dirty and fails
@martinvonz updated this one too. On Mon, Feb 25, 2019 at 11:01 PM martinvonz (Martin von Zweigbergk) < phabrica...@mercurial-scm.org> wrote: > martinvonz added inline comments. > > INLINE COMMENTS > > > test-copytrace-heuristics.t:931-980 > > + $ hg graft -r 6 --base c9241b0f2d5b --hidden > > + grafting 6:99802e4f1e46 "added willconflict and d" (tip) > > + ** unknown exception encountered, please report by visiting > > + ** https://mercurial-scm.org/wiki/BugTracker > > + ** Python 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609] > > + ** Mercurial Distributed SCM (version 4.8.1+539-b6c610bf567e+20181221) > > + ** Extensions loaded: rebase, shelve > > nit: we usually redirect stderr and grep for the error (`AssertionError` > here) to make it a bit shorter. (besides, the test here with > `/home/khanchi/` paths is clearly not going to pass on most people's > machines) > > REPOSITORY > rHG Mercurial > > REVISION DETAIL > https://phab.mercurial-scm.org/D5962 > > To: khanchi97, #hg-reviewers > Cc: martinvonz, mercurial-devel > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 updated this revision to Diff 14240. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5962?vs=14091=14240 REVISION DETAIL https://phab.mercurial-scm.org/D5962 AFFECTED FILES tests/test-copies.t CHANGE DETAILS diff --git a/tests/test-copies.t b/tests/test-copies.t --- a/tests/test-copies.t +++ b/tests/test-copies.t @@ -1,6 +1,8 @@ #testcases filelog compatibility $ cat >> $HGRCPATH << EOF + > [extensions] + > rebase= > [alias] > l = log -G -T '{rev} {desc}\n{files}\n' > EOF @@ -597,3 +599,108 @@ +baba +Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty +-- + + $ newrepo + $ echo a > a + $ hg add a + $ hg ci -m "added a" + $ echo b > b + $ hg add b + $ hg ci -m "added b" + + $ echo foobar > willconflict + $ hg add willconflict + $ hg ci -m "added willconflict" + $ echo c > c + $ hg add c + $ hg ci -m "added c" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 3 : 9a8bb7cc6814 added c + | draft + o 2 : d2ea38baf44e added willconflict + | draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg up .^^ + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo d > d + $ hg add d + $ hg ci -m "added d" + created new head + + $ echo barfoo > willconflict + $ hg add willconflict + $ hg ci --amend -m "added willconflict and d" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 5 : 5018b1509e94 added willconflict and d + | draft + | o 3 : 9a8bb7cc6814 added c + | | draft + | o 2 : d2ea38baf44e added willconflict + |/ draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg rebase -r . -d 2 + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + merging willconflict + warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] + + $ hg diff + diff -r d2ea38baf44e d + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/d Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,1 @@ + +d + diff -r d2ea38baf44e willconflict + --- a/willconflict Thu Jan 01 00:00:00 1970 + + +++ b/willconflict Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,5 @@ + +<<< dest: d2ea38baf44e - test: added willconflict + foobar + +=== + +barfoo + +>>> source: 5018b1509e94 - test: added willconflict and d + + $ echo barfoo > willconflict + $ hg resolve -m + (no more unresolved files) + continue: hg rebase --continue + $ hg rebase --continue + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + + $ hg up 3 -q + + $ hg log -G --hidden -T '{rev} : {node|short} {desc} \n{phase}\n' + o 6 : 99802e4f1e46 added willconflict and d + | draft + | x 5 : 5018b1509e94 added willconflict and d + | | draft + | | x 4 : c9241b0f2d5b added d + | |/ draft + +---@ 3 : 9a8bb7cc6814 added c + | |draft + o | 2 : d2ea38baf44e added willconflict + |/ draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + +Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case +both the merging csets will be dirty as no one is descendent of base revision: + + $ hg graft -r 6 --base c9241b0f2d5b --hidden 2>&1 | grep "AssertionError" + AssertionError + To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
martinvonz added inline comments. INLINE COMMENTS > test-copytrace-heuristics.t:931-980 > + $ hg graft -r 6 --base c9241b0f2d5b --hidden > + grafting 6:99802e4f1e46 "added willconflict and d" (tip) > + ** unknown exception encountered, please report by visiting > + ** https://mercurial-scm.org/wiki/BugTracker > + ** Python 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609] > + ** Mercurial Distributed SCM (version 4.8.1+539-b6c610bf567e+20181221) > + ** Extensions loaded: rebase, shelve nit: we usually redirect stderr and grep for the error (`AssertionError` here) to make it a bit shorter. (besides, the test here with `/home/khanchi/` paths is clearly not going to pass on most people's machines) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5962 To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 added a comment. Ping for review. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5962 To: khanchi97, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5962: copies: add test that makes both the merging csets dirty and fails
khanchi97 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Discussion related to this issue can be found here: https://phab.mercurial-scm.org/D3896 There can be cases when both the changesets which we are merging are not descendants of the merge base. In those cases dirtyc1 and dirtyc2 both will be true. The existing code assumes that either of them will be true always but that is not a right assumption. Pulkit found this while working with content-divergence resolution. In content-divergence resolution, we use the common predecessor as the merge base for resolving content divergence and there it can be possible that the merge base is not the descendant of both the content-divergence changsets. Added tests reflects the broken behaviour for the above mentioned case. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5962 AFFECTED FILES tests/test-copytrace-heuristics.t CHANGE DETAILS diff --git a/tests/test-copytrace-heuristics.t b/tests/test-copytrace-heuristics.t --- a/tests/test-copytrace-heuristics.t +++ b/tests/test-copytrace-heuristics.t @@ -825,3 +825,156 @@ $ cd .. $ rm -rf repo +Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty +-- + + $ hg init repo + $ cd repo + $ echo a > a + $ hg add a + $ hg ci -m "added a" + $ echo b > b + $ hg add b + $ hg ci -m "added b" + + $ echo foobar > willconflict + $ hg add willconflict + $ hg ci -m "added willconflict" + $ echo c > c + $ hg add c + $ hg ci -m "added c" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 3 : 9a8bb7cc6814 added c + | draft + o 2 : d2ea38baf44e added willconflict + | draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg up .^^ + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo d > d + $ hg add d + $ hg ci -m "added d" + created new head + + $ echo barfoo > willconflict + $ hg add willconflict + $ hg ci --amend -m "added willconflict and d" + + $ hg log -G -T '{rev} : {node|short} {desc} \n{phase}\n' + @ 5 : 5018b1509e94 added willconflict and d + | draft + | o 3 : 9a8bb7cc6814 added c + | | draft + | o 2 : d2ea38baf44e added willconflict + |/ draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + + $ hg rebase -r . -d 2 + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + merging willconflict + warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] + + $ hg diff + diff -r d2ea38baf44e d + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/d Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,1 @@ + +d + diff -r d2ea38baf44e willconflict + --- a/willconflict Thu Jan 01 00:00:00 1970 + + +++ b/willconflict Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,5 @@ + +<<< dest: d2ea38baf44e - test: added willconflict + foobar + +=== + +barfoo + +>>> source: 5018b1509e94 - test: added willconflict and d + + $ echo barfoo > willconflict + $ hg resolve -m + (no more unresolved files) + continue: hg rebase --continue + $ hg rebase --continue + rebasing 5:5018b1509e94 "added willconflict and d" (tip) + + $ hg up 3 -q + + $ hg log -G --hidden -T '{rev} : {node|short} {desc} \n{phase}\n' + o 6 : 99802e4f1e46 added willconflict and d + | draft + | x 5 : 5018b1509e94 added willconflict and d + | | draft + | | x 4 : c9241b0f2d5b added d + | |/ draft + +---@ 3 : 9a8bb7cc6814 added c + | |draft + o | 2 : d2ea38baf44e added willconflict + |/ draft + o 1 : 5f6d8a4bf34a added b + | draft + o 0 : 9092f1db7931 added a + draft + +Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case +both the merging csets will be dirty as no one is descendent of base revision: + + $ hg graft -r 6 --base c9241b0f2d5b --hidden + grafting 6:99802e4f1e46 "added willconflict and d" (tip) + ** unknown exception encountered, please report by visiting + ** https://mercurial-scm.org/wiki/BugTracker + ** Python 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609] + ** Mercurial Distributed SCM (version 4.8.1+539-b6c610bf567e+20181221) + ** Extensions loaded: rebase, shelve + Traceback (most recent call last): +File "/home/khanchi/hg/hg-committed/hg", line 43, in + dispatch.run() +File "/home/khanchi/hg/hg-committed/mercurial/dispatch.py", line 99, in run + status = dispatch(req) +File "/home/khanchi/hg/hg-committed/mercurial/dispatch.py", line 225, in dispatch + ret = _runcatch(req) or 0 +