=============================================================Teststheresolutionofpubliccontentdivergence:maincases=============================================================Thisfileintendtocoverallthecommoncasesofpubliccontentdivergence.Thatisallthevariantof:parent:same/differentrelocation:[no-]conflictmerging:[no-]conflictSetup=====$cat>>$HGRCPATH<<EOF>[alias]>glog=log-GT"{rev}:{node|short}{desc|firstline}\n{phase}{instabilities}\n\n">[phases]>publish=False>[experimental]>evolution.allowdivergence=True>[extensions]>rebase=>EOF$echo"evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/">>$HGRCPATHTestingwhensameparent,noconflict:--------------------------------------Preparetherepository:$hginitpubdiv1$cdpubdiv1$forchinab;do>echo$ch>$ch;>hgci-Aqm"added "$ch;>done;$hgglog@1:5f6d8a4bf34aaddedb|draft|o0:9092f1db7931addedadraftMakeanamendandchangephasetopublic:$sed-i"1 i I am first"b$hgamend$hgphase--publicAmendagaintocreateacsetdivergenttopublicone:$hgup1--hidden-qupdatedtohiddenchangeset5f6d8a4bf34a(hiddenrevision'5f6d8a4bf34a'wasrewrittenas:44f360db368f)workingdirectoryparentisobsolete!(5f6d8a4bf34a)$echo"I am second">>b$hgci--amend-m"updated b"1newcontent-divergentchangesets$hgglog@3:dcdaf152280aupdatedb|draftcontent-divergent||o2:44f360db368faddedb|/public|o0:9092f1db7931addedapublicLetsresolvethepubliccontent-divergence:$hgevolve--content-divergentmerge:[2]addedbwith:[3]updatedbbase:[1]addedbmergingb0filesupdated,1filesmerged,0filesremoved,0filesunresolvedcommittedasc1aa9cfb6cf8workingdirectoryisnowatc1aa9cfb6cf8Followinggraphlogshowsthatitcorrectlymergedthetwodivergentcsets:$hgglog-p@5:c1aa9cfb6cf8phase-divergentupdateto44f360db368f:|draft||diff-r44f360db368f-rc1aa9cfb6cf8b|---a/bThuJan0100:00:001970+0000|+++b/bThuJan0100:00:001970+0000|@@-1,2+1,3@@|Iamfirst|b|+Iamsecond|o2:44f360db368faddedb|public||diff-r9092f1db7931-r44f360db368fb|---/dev/nullThuJan0100:00:001970+0000|+++b/bThuJan0100:00:001970+0000|@@-0,0+1,2@@|+Iamfirst|+b|o0:9092f1db7931addedapublicdiff-r000000000000-r9092f1db7931a---/dev/nullThuJan0100:00:001970+0000+++b/aThuJan0100:00:001970+0000@@-0,0+1,1@@+a$hgevolve-l$cd..Testingwhensameparent,mergingconflict:-------------------------------------------Preparetherepository:$hginitpubdiv2$cdpubdiv2$forchinab;do>echo$ch>$ch;>hgci-Aqm"added "$ch;>done;$hgglog@1:5f6d8a4bf34aaddedb|draft|o0:9092f1db7931addedadraftMakeanamendandchangephasetopublic:$echo"I am foo">b$hgamend$hgphase--publicAmendagaintocreateacsetdivergenttopublicone:$hgup1--hidden-qupdatedtohiddenchangeset5f6d8a4bf34a(hiddenrevision'5f6d8a4bf34a'wasrewrittenas:580f2d01e52c)workingdirectoryparentisobsolete!(5f6d8a4bf34a)$echo"I am bar">b$hgci--amend-m"updated b"1newcontent-divergentchangesets$hgglog@3:0e805383168eupdatedb|draftcontent-divergent||o2:580f2d01e52caddedb|/public|o0:9092f1db7931addedapublicLetsresolvethedivergence:$hgevolve--content-divergentmerge:[2]addedbwith:[3]updatedbbase:[1]addedbmergingbwarning:conflictswhilemergingb!(edit,thenuse'hg resolve --mark')0filesupdated,0filesmerged,0filesremoved,1filesunresolvedunresolvedmergeconflicts(see'hg help evolve.interrupted')[1]$echo"I am foobar">b$hgresolve-m--toolunion(nomoreunresolvedfiles)continue:hgevolve--continue$hgevolve--continuecommittedas1a739394e9d4workingdirectoryisnowat1a739394e9d4$hgglog@5:1a739394e9d4phase-divergentupdateto580f2d01e52c:|draft|o2:580f2d01e52caddedb|public|o0:9092f1db7931addedapublicTestingwhendifferentparent,noconflict:-------------------------------------------$hginitpubdiv3$cdpubdiv3$forchinabcd;do>echo$ch>$ch;>hgci-Aqm"added "$ch;>done;$hgup.^0filesupdated,0filesmerged,1filesremoved,0filesunresolved$echodd>d$hgaddd$hgci-m"added d"creatednewhead$hgup10filesupdated,0filesmerged,2filesremoved,0filesunresolved$echodd>d$echoe>e$hgaddde$hgci-m"added d e"creatednewhead$hgglog@5:4291d72ee19aaddedde|draft||o4:93cd84bbdacaaddedd||draft||||o3:9150fe93bec6addedd||/draft|||o2:155349b645beaddedc|/draft|o1:5f6d8a4bf34aaddedb|draft|o0:9092f1db7931addedadraft$hgprune3-s51changesetspruned$hgprune3-s4--hidden1changesetspruned2newcontent-divergentchangesetsChangephasetopublicforonehead:$hgphase-r4--public$hgglog@5:4291d72ee19aaddedde|draftcontent-divergent||o4:93cd84bbdacaaddedd||public|||o2:155349b645beaddedc|/public|o1:5f6d8a4bf34aaddedb|public|o0:9092f1db7931addedapublic$hgevolve--content-divergent--anymerge:[4]addeddwith:[5]addeddebase:[3]addeddrebasing"other"content-divergentchangeset4291d72ee19aon155349b645be1filesupdated,0filesmerged,0filesremoved,0filesunresolvedcommittedas4cbe48a0c3d9workingdirectoryisnowat4cbe48a0c3d9$hgglog-l1@8:4cbe48a0c3d9phase-divergentupdateto93cd84bbdaca:|draft~$hgevolve-l$cd..Testingwhendifferentparents,relocationconflict:----------------------------------------------------$hginitpubdiv4$cdpubdiv4$forchinabcd;do>echo$ch>$ch;>hgci-Aqm"added "$ch;>done;$hgup.^^0filesupdated,0filesmerged,2filesremoved,0filesunresolved$echod>d$echocfoo>c$echoe>e$hgadddce$hgci-m"added d c e"creatednewhead$hgup'desc("added c")'1filesupdated,0filesmerged,2filesremoved,0filesunresolved$echodd>d$hgaddd$hgci-m"added d"creatednewhead$hgglog@5:93cd84bbdacaaddedd|draft||o4:f31bcc378766addeddce||draft||+---o3:9150fe93bec6addedd||draft||o|2:155349b645beaddedc|/draft|o1:5f6d8a4bf34aaddedb|draft|o0:9092f1db7931addedadraft$hgprune'min(desc("re:added d$"))'-s'max(desc("re:added d$"))'1changesetspruned$hgprune'min(desc("re:added d$"))'-s'desc("added d c e")'--hidden1changesetspruned2newcontent-divergentchangesetsChangephasetopublicforonehead:$hgphase--public-r'max(desc("re:added d$"))'$hgglog@5:93cd84bbdacaaddedd|public||*4:f31bcc378766addeddce||draftcontent-divergent||o|2:155349b645beaddedc|/public|o1:5f6d8a4bf34aaddedb|public|o0:9092f1db7931addedapublic$hgevolve--content-divergent--any--updatemerge:[5]addeddwith:[4]addeddcebase:[3]addeddrebasing"other"content-divergentchangesetf31bcc378766on155349b645bemergingcwarning:conflictswhilemergingc!(edit,thenuse'hg resolve --mark')unresolvedmergeconflicts(see'hg help evolve.interrupted')[1]$hgdiffdiff-r155349b645bec---a/cThuJan0100:00:001970+0000+++b/cThuJan0100:00:001970+0000@@-1,1+1,5@@+<<<<<<<destination:155349b645be-test:addedcc+=======+cfoo+>>>>>>>evolving:f31bcc378766-test:addeddcediff-r155349b645bed---/dev/nullThuJan0100:00:001970+0000+++b/dThuJan0100:00:001970+0000@@-0,0+1,1@@+ddiff-r155349b645bee---/dev/nullThuJan0100:00:001970+0000+++b/eThuJan0100:00:001970+0000@@-0,0+1,1@@+e$echoc>c$hgres-m(nomoreunresolvedfiles)continue:hgevolve--continue$hgevolve--continueevolving4:f31bcc378766"added d c e"1filesupdated,0filesmerged,0filesremoved,0filesunresolvedcommittedas412dde898967workingdirectoryisnowat412dde898967$hgexport # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 412dde898967b50e7d334aefff778a9af46d29d1 # Parent 93cd84bbdacaeb8f881c29a609dbdd30c38cbc57phase-divergentupdateto93cd84bbdaca:addeddcediff-r93cd84bbdaca-r412dde898967e---/dev/nullThuJan0100:00:001970+0000+++b/eThuJan0100:00:001970+0000@@-0,0+1,1@@+e$hgevolve-l$cd..Testingwhenmergingconflicts,relocationdon't:------------------------------------------------- $ hg init pubdiv5 $ cd pubdiv5 $ for ch in a b c d; do > echo $ch > $ch; > hg ci -Aqm "added "$ch; > done; $ hg up .^^ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo dconflict > d $ hg add d $ hg ci -m "added d" created new head $ hg up 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo dd > d $ hg add d $ hg ci -m "added d" created new head $ hg glog @ 5:93cd84bbdaca added d | draft | | o 4:9411ad1fe615 added d | | draft | | +---o 3:9150fe93bec6 added d | | draft | | o | 2:155349b645be added c |/ draft | o 1:5f6d8a4bf34a added b | draft | o 0:9092f1db7931 added a draft $ hg prune 3 -s 5 1 changesets pruned $ hg prune 3 -s 4 --hidden 1 changesets pruned 2 new content-divergent changesetsChange phase to public for one head: $ hg phase --public -r 5 $ hg glog @ 5:93cd84bbdaca added d | public | | * 4:9411ad1fe615 added d | | draft content-divergent | | o | 2:155349b645be added c |/ public | o 1:5f6d8a4bf34a added b | public | o 0:9092f1db7931 added a public $ hg evolve --content-divergent --any merge:[5] added d with: [4] added d base: [3] added d rebasing "other" content-divergent changeset 9411ad1fe615 on 155349b645be merging d warning: conflicts while merging d! (edit, then use 'hgresolve--mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved unresolved merge conflicts (see 'hghelpevolve.interrupted') [1] $ echo d > d $ hg res -m (no more unresolved files) continue: hg evolve --continue $ hg evolve --continue committed as 2a0f44767904 working directory is now at 93cd84bbdaca $ hg evolve -l $ cd ..Testing when relocation, merging both conflict:----------------------------------------------- $ hg init pubdiv6 $ cd pubdiv6 $ for ch in a b c d; do > echo $ch > $ch; > hg ci -Aqm "added "$ch; > done; $ hg up .^^ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo cfoo > c $ echo e > e $ echo dconflict > d $ hg add c e d $ hg ci -m "added c e" created new head $ hg up 2 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo dd > d $ hg add d $ hg ci -m "added d" created new head $ hg glog @ 5:93cd84bbdaca added d | draft | | o 4:3c17c7afaf6e added c e | | draft | | +---o 3:9150fe93bec6 added d | | draft | | o | 2:155349b645be added c |/ draft | o 1:5f6d8a4bf34a added b | draft | o 0:9092f1db7931 added a draft $ hg prune 3 -s 5 1 changesets pruned $ hg prune 3 -s 4 --hidden 1 changesets pruned 2 new content-divergent changesetsChange phase to public for one head: $ hg phase --public -r 5 $ hg glog @ 5:93cd84bbdaca added d | public | | * 4:3c17c7afaf6e added c e | | draft content-divergent | | o | 2:155349b645be added c |/ public | o 1:5f6d8a4bf34a added b | public | o 0:9092f1db7931 added a public $ hg evolve --content-divergent --any merge:[5] added d with: [4] added c e base: [3] added d rebasing "other" content-divergent changeset 3c17c7afaf6e on 155349b645be merging c warning: conflicts while merging c! (edit, then use 'hgresolve--mark') unresolved merge conflicts (see 'hghelpevolve.interrupted') [1] $ hg diff diff -r 155349b645be c --- a/c Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,5 @@ +<<<<<<<destination:155349b645be-test:addedcc+=======+cfoo+>>>>>>> evolving: 3c17c7afaf6e - test: added c e diff -r 155349b645be d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/d Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +dconflict diff -r 155349b645be e --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +e $ echo cfoo > c $ hg res -m (no more unresolved files) continue: hg evolve --continue $ hg evolve --continue evolving 4:3c17c7afaf6e "added c e" merging d warning: conflicts while merging d! (edit, then use 'hgresolve--mark') 2 files updated, 0 files merged, 0 files removed, 1 files unresolved unresolved merge conflicts (see 'hghelpevolve.interrupted') [1] $ echo d > d $ hg res -m (no more unresolved files) continue: hg evolve --continue $ hg evolve --continue committed as b9082a9e66ce working directory is now at 93cd84bbdaca $ hg evolve -l $ cd ..