| 1 |
#require bzr |
| 2 |
|
| 3 |
N.B. bzr 1.13 has a bug that breaks this test. If you see this |
| 4 |
test fail, check your bzr version. Upgrading to bzr 1.13.1 |
| 5 |
should fix it. |
| 6 |
|
| 7 |
$ . "$TESTDIR/bzr-definitions" |
| 8 |
|
| 9 |
test multiple merges at once |
| 10 |
|
| 11 |
$ mkdir test-multimerge |
| 12 |
$ cd test-multimerge |
| 13 |
$ brz init -q source |
| 14 |
$ cd source |
| 15 |
$ echo content > file |
| 16 |
$ echo text > rename_me |
| 17 |
$ brz add -q file rename_me |
| 18 |
$ brz commit -q -m 'Initial add' '--commit-time=2009-10-10 08:00:00 +0100' |
| 19 |
$ cd .. |
| 20 |
$ brz branch -q source source-branch1 |
| 21 |
$ cd source-branch1 |
| 22 |
$ echo morecontent >> file |
| 23 |
$ echo evenmorecontent > file-branch1 |
| 24 |
$ brz add -q file-branch1 |
| 25 |
$ brz commit -q -m 'Added branch1 file' '--commit-time=2009-10-10 08:00:01 +0100' |
| 26 |
$ cd ../source |
| 27 |
$ sleep 1 |
| 28 |
$ echo content > file-parent |
| 29 |
$ brz add -q file-parent |
| 30 |
$ brz commit -q -m 'Added parent file' '--commit-time=2009-10-10 08:00:02 +0100' |
| 31 |
$ cd .. |
| 32 |
$ brz branch -q source source-branch2 |
| 33 |
$ cd source-branch2 |
| 34 |
$ echo somecontent > file-branch2 |
| 35 |
$ brz add -q file-branch2 |
| 36 |
$ brz mv -q rename_me renamed |
| 37 |
$ echo change > renamed |
| 38 |
$ brz commit -q -m 'Added brach2 file' '--commit-time=2009-10-10 08:00:03 +0100' |
| 39 |
$ sleep 1 |
| 40 |
$ cd ../source |
| 41 |
$ brz merge -q ../source-branch1 |
| 42 |
$ brz merge -q --force ../source-branch2 |
| 43 |
$ brz commit -q -m 'Merged branches' '--commit-time=2009-10-10 08:00:04 +0100' |
| 44 |
$ cd .. |
| 45 |
|
| 46 |
BUG: file-branch2 should not be added in rev 4, and the rename_me -> renamed |
| 47 |
move should be recorded in the fixup merge. |
| 48 |
$ hg convert --datesort --config convert.bzr.saverev=False source source-hg |
| 49 |
initializing destination source-hg repository |
| 50 |
scanning source... |
| 51 |
sorting... |
| 52 |
converting... |
| 53 |
4 Initial add |
| 54 |
3 Added branch1 file |
| 55 |
2 Added parent file |
| 56 |
1 Added brach2 file |
| 57 |
0 Merged branches |
| 58 |
warning: can't find ancestor for 'renamed' copied from 'rename_me'! |
| 59 |
$ glog -R source-hg |
| 60 |
o 5@source "(octopus merge fixup)" files+: [], files-: [], files: [renamed] |
| 61 |
|\ |
| 62 |
| o 4@source "Merged branches" files+: [file-branch2 renamed], files-: [rename_me], files: [] |
| 63 |
| |\ |
| 64 |
o---+ 3@source-branch2 "Added brach2 file" files+: [file-branch2 renamed], files-: [rename_me], files: [] |
| 65 |
/ / |
| 66 |
| o 2@source "Added parent file" files+: [file-parent], files-: [], files: [] |
| 67 |
| | |
| 68 |
o | 1@source-branch1 "Added branch1 file" files+: [file-branch1], files-: [], files: [file] |
| 69 |
|/ |
| 70 |
o 0@source "Initial add" files+: [file rename_me], files-: [], files: [] |
| 71 |
|
| 72 |
$ manifest source-hg tip |
| 73 |
% manifest of tip |
| 74 |
644 file |
| 75 |
644 file-branch1 |
| 76 |
644 file-branch2 |
| 77 |
644 file-parent |
| 78 |
644 renamed |
| 79 |
|
| 80 |
$ hg convert source-hg hg2hg |
| 81 |
initializing destination hg2hg repository |
| 82 |
scanning source... |
| 83 |
sorting... |
| 84 |
converting... |
| 85 |
5 Initial add |
| 86 |
4 Added branch1 file |
| 87 |
3 Added parent file |
| 88 |
2 Added brach2 file |
| 89 |
1 Merged branches |
| 90 |
0 (octopus merge fixup) |
| 91 |
|
| 92 |
BUG: The manifest entries should be the same for matching revisions, and |
| 93 |
nothing should be outgoing |
| 94 |
|
| 95 |
$ hg -R source-hg manifest --debug -r tip | grep renamed |
| 96 |
67109fdebf6c556eb0a9d5696dd98c8420520405 644 renamed |
| 97 |
$ hg -R hg2hg manifest --debug -r tip | grep renamed |
| 98 |
27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed |
| 99 |
$ hg -R source-hg manifest --debug -r 'tip^' | grep renamed |
| 100 |
27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed |
| 101 |
$ hg -R hg2hg manifest --debug -r 'tip^' | grep renamed |
| 102 |
27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed |
| 103 |
|
| 104 |
BUG: The revisions found should be the same in both repos |
| 105 |
|
| 106 |
$ hg --cwd source-hg log -r 'file("renamed")' -G -Tcompact |
| 107 |
o 5[tip]:4,3 6652429c300a 2009-10-10 08:00 +0100 foo |
| 108 |
|\ (octopus merge fixup) |
| 109 |
| | |
| 110 |
| o 4:2,1 e0ae8af3503a 2009-10-10 08:00 +0100 foo |
| 111 |
| |\ Merged branches |
| 112 |
| ~ ~ |
| 113 |
o 3 138bed2e14be 2009-10-10 08:00 +0100 foo |
| 114 |
| Added brach2 file |
| 115 |
~ |
| 116 |
$ hg --cwd hg2hg log -r 'file("renamed")' -G -Tcompact |
| 117 |
o 4:2,1 e0ae8af3503a 2009-10-10 08:00 +0100 foo |
| 118 |
|\ Merged branches |
| 119 |
~ ~ |
| 120 |
o 3 138bed2e14be 2009-10-10 08:00 +0100 foo |
| 121 |
| Added brach2 file |
| 122 |
~ |
| 123 |
|
| 124 |
BUG(?): The move seems to be recorded in rev 4, so it should probably show up |
| 125 |
there. It's not recorded as a move in rev 5, even in source-hg. |
| 126 |
|
| 127 |
$ hg -R source-hg up -q tip |
| 128 |
$ hg -R hg2hg up -q tip |
| 129 |
$ hg --cwd source-hg log -r 'follow("renamed")' -G -Tcompact |
| 130 |
@ 5[tip]:4,3 6652429c300a 2009-10-10 08:00 +0100 foo |
| 131 |
|\ (octopus merge fixup) |
| 132 |
| : |
| 133 |
o : 3 138bed2e14be 2009-10-10 08:00 +0100 foo |
| 134 |
:/ Added brach2 file |
| 135 |
: |
| 136 |
o 0 18b86f5df51b 2009-10-10 08:00 +0100 foo |
| 137 |
Initial add |
| 138 |
|
| 139 |
$ hg --cwd hg2hg log -r 'follow("renamed")' -G -Tcompact |
| 140 |
o 3 138bed2e14be 2009-10-10 08:00 +0100 foo |
| 141 |
: Added brach2 file |
| 142 |
: |
| 143 |
o 0 18b86f5df51b 2009-10-10 08:00 +0100 foo |
| 144 |
Initial add |
| 145 |
|
| 146 |
|
| 147 |
$ hg -R hg2hg out source-hg -T compact |
| 148 |
comparing with source-hg |
| 149 |
searching for changes |
| 150 |
5[tip]:4,3 3be2299ccd31 2009-10-10 08:00 +0100 foo |
| 151 |
(octopus merge fixup) |
| 152 |
|
| 153 |
|
| 154 |
$ glog -R hg2hg |
| 155 |
@ 5@source "(octopus merge fixup)" files+: [], files-: [], files: [] |
| 156 |
|\ |
| 157 |
| o 4@source "Merged branches" files+: [file-branch2 renamed], files-: [rename_me], files: [] |
| 158 |
| |\ |
| 159 |
o---+ 3@source-branch2 "Added brach2 file" files+: [file-branch2 renamed], files-: [rename_me], files: [] |
| 160 |
/ / |
| 161 |
| o 2@source "Added parent file" files+: [file-parent], files-: [], files: [] |
| 162 |
| | |
| 163 |
o | 1@source-branch1 "Added branch1 file" files+: [file-branch1], files-: [], files: [file] |
| 164 |
|/ |
| 165 |
o 0@source "Initial add" files+: [file rename_me], files-: [], files: [] |
| 166 |
|
| 167 |
|
| 168 |
$ hg -R source-hg log --debug -r tip |
| 169 |
changeset: 5:6652429c300ab66fdeaf2e730945676a00b53231 |
| 170 |
branch: source |
| 171 |
tag: tip |
| 172 |
phase: draft |
| 173 |
parent: 4:e0ae8af3503af9bbffb0b29268a02744cc61a561 |
| 174 |
parent: 3:138bed2e14be415a2692b02e41405b2864f758b4 |
| 175 |
manifest: 5:1eabd5f5d4b985784cf2c45c717ff053eca14b0d |
| 176 |
user: Foo Bar <[email protected]> |
| 177 |
date: Sat Oct 10 08:00:04 2009 +0100 |
| 178 |
files: renamed |
| 179 |
extra: branch=source |
| 180 |
description: |
| 181 |
(octopus merge fixup) |
| 182 |
|
| 183 |
|
| 184 |
$ hg -R hg2hg log --debug -r tip |
| 185 |
changeset: 5:3be2299ccd315ff9aab2b49bdb0d14e3244435e8 |
| 186 |
branch: source |
| 187 |
tag: tip |
| 188 |
phase: draft |
| 189 |
parent: 4:e0ae8af3503af9bbffb0b29268a02744cc61a561 |
| 190 |
parent: 3:138bed2e14be415a2692b02e41405b2864f758b4 |
| 191 |
manifest: 4:3ece3c7f2cc6df15b3cbbf3273c69869fc7c3ab0 |
| 192 |
user: Foo Bar <[email protected]> |
| 193 |
date: Sat Oct 10 08:00:04 2009 +0100 |
| 194 |
extra: branch=source |
| 195 |
description: |
| 196 |
(octopus merge fixup) |
| 197 |
|
| 198 |
|
| 199 |
$ hg -R source-hg manifest --debug -r tip |
| 200 |
cdf31ed9242b209cd94697112160e2c5b37a667d 644 file |
| 201 |
5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 |
| 202 |
80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 |
| 203 |
7108421418404a937c684d2479a34a24d2ce4757 644 file-parent |
| 204 |
67109fdebf6c556eb0a9d5696dd98c8420520405 644 renamed |
| 205 |
$ hg -R source-hg manifest --debug -r 'tip^' |
| 206 |
cdf31ed9242b209cd94697112160e2c5b37a667d 644 file |
| 207 |
5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 |
| 208 |
80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 |
| 209 |
7108421418404a937c684d2479a34a24d2ce4757 644 file-parent |
| 210 |
27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed |
| 211 |
|
| 212 |
$ hg -R hg2hg manifest --debug -r tip |
| 213 |
cdf31ed9242b209cd94697112160e2c5b37a667d 644 file |
| 214 |
5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 |
| 215 |
80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 |
| 216 |
7108421418404a937c684d2479a34a24d2ce4757 644 file-parent |
| 217 |
27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed |
| 218 |
$ hg -R hg2hg manifest --debug -r 'tip^' |
| 219 |
cdf31ed9242b209cd94697112160e2c5b37a667d 644 file |
| 220 |
5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 |
| 221 |
80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 |
| 222 |
7108421418404a937c684d2479a34a24d2ce4757 644 file-parent |
| 223 |
27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed |
| 224 |
|
| 225 |
$ cd .. |