| 1 |
$ cat >> $HGRCPATH <<EOF |
| 2 |
> [extensions] |
| 3 |
> rebase= |
| 4 |
> histedit= |
| 5 |
> |
| 6 |
> [alias] |
| 7 |
> tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" |
| 8 |
> EOF |
| 9 |
|
| 10 |
|
| 11 |
$ hg init a |
| 12 |
$ cd a |
| 13 |
|
| 14 |
$ echo C1 > C1 |
| 15 |
$ hg ci -Am C1 |
| 16 |
adding C1 |
| 17 |
|
| 18 |
$ echo C2 > C2 |
| 19 |
$ hg ci -Am C2 |
| 20 |
adding C2 |
| 21 |
|
| 22 |
$ cd .. |
| 23 |
|
| 24 |
$ hg clone a b |
| 25 |
updating to branch default |
| 26 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 27 |
|
| 28 |
$ hg clone a c |
| 29 |
updating to branch default |
| 30 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 31 |
|
| 32 |
$ cd b |
| 33 |
|
| 34 |
$ echo L1 > L1 |
| 35 |
$ hg ci -Am L1 |
| 36 |
adding L1 |
| 37 |
|
| 38 |
|
| 39 |
$ cd ../a |
| 40 |
|
| 41 |
$ echo R1 > R1 |
| 42 |
$ hg ci -Am R1 |
| 43 |
adding R1 |
| 44 |
|
| 45 |
|
| 46 |
$ cd ../b |
| 47 |
|
| 48 |
Now b has one revision to be pulled from a: |
| 49 |
|
| 50 |
$ hg pull --rebase |
| 51 |
pulling from $TESTTMP/a |
| 52 |
searching for changes |
| 53 |
adding changesets |
| 54 |
adding manifests |
| 55 |
adding file changes |
| 56 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 57 |
new changesets 77ae9631bcca |
| 58 |
rebasing 2:ff8d69a621f9 "L1" |
| 59 |
saved backup bundle to $TESTTMP/b/.hg/strip-backup/ff8d69a621f9-160fa373-rebase.hg |
| 60 |
|
| 61 |
$ hg tglog |
| 62 |
@ 3: d80cc2da061e 'L1' |
| 63 |
| |
| 64 |
o 2: 77ae9631bcca 'R1' |
| 65 |
| |
| 66 |
o 1: 783333faa078 'C2' |
| 67 |
| |
| 68 |
o 0: 05d58a0c15dd 'C1' |
| 69 |
|
| 70 |
Re-run: |
| 71 |
|
| 72 |
$ hg pull --rebase |
| 73 |
pulling from $TESTTMP/a |
| 74 |
searching for changes |
| 75 |
no changes found |
| 76 |
|
| 77 |
Abort pull early if working dir is not clean: |
| 78 |
|
| 79 |
$ echo L1-mod > L1 |
| 80 |
$ hg pull --rebase |
| 81 |
abort: uncommitted changes |
| 82 |
(cannot pull with rebase: please commit or shelve your changes first) |
| 83 |
[20] |
| 84 |
$ hg update --clean --quiet |
| 85 |
|
| 86 |
Abort pull early if another operation (histedit) is in progress: |
| 87 |
|
| 88 |
$ hg histedit . -q --commands - << EOF |
| 89 |
> edit d80cc2da061e histedit: generate unfinished state |
| 90 |
> EOF |
| 91 |
Editing (d80cc2da061e), commit as needed now to split the change |
| 92 |
(to edit d80cc2da061e, `hg histedit --continue` after making changes) |
| 93 |
[240] |
| 94 |
$ hg pull --rebase |
| 95 |
abort: histedit in progress |
| 96 |
(use 'hg histedit --continue' or 'hg histedit --abort') |
| 97 |
[20] |
| 98 |
$ hg histedit --abort --quiet |
| 99 |
|
| 100 |
Abort pull early with pending uncommitted merge: |
| 101 |
|
| 102 |
$ cd .. |
| 103 |
$ hg clone --noupdate c d |
| 104 |
$ cd d |
| 105 |
$ hg tglog |
| 106 |
o 1: 783333faa078 'C2' |
| 107 |
| |
| 108 |
o 0: 05d58a0c15dd 'C1' |
| 109 |
|
| 110 |
$ hg update --quiet 0 |
| 111 |
$ echo M1 > M1 |
| 112 |
$ hg commit --quiet -Am M1 |
| 113 |
$ hg update --quiet 1 |
| 114 |
$ hg merge 2 |
| 115 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 116 |
(branch merge, don't forget to commit) |
| 117 |
$ hg pull --rebase |
| 118 |
abort: outstanding uncommitted merge |
| 119 |
(cannot pull with rebase: please commit or shelve your changes first) |
| 120 |
[20] |
| 121 |
$ hg update --clean --quiet |
| 122 |
|
| 123 |
Abort pull early with unclean subrepo: |
| 124 |
$ echo s = s > .hgsub |
| 125 |
$ hg add .hgsub |
| 126 |
$ hg init s |
| 127 |
$ hg commit -m "generated a subrepo" |
| 128 |
$ echo a > s/a |
| 129 |
$ hg -R s add s/a |
| 130 |
$ hg pull --rebase |
| 131 |
abort: uncommitted changes in subrepository "s" |
| 132 |
(cannot pull with rebase: please commit or shelve your changes first) |
| 133 |
[255] |
| 134 |
|
| 135 |
Invoke pull --rebase and nothing to rebase: |
| 136 |
|
| 137 |
$ cd ../c |
| 138 |
|
| 139 |
$ hg book norebase |
| 140 |
$ hg pull --rebase |
| 141 |
pulling from $TESTTMP/a |
| 142 |
searching for changes |
| 143 |
adding changesets |
| 144 |
adding manifests |
| 145 |
adding file changes |
| 146 |
added 1 changesets with 1 changes to 1 files |
| 147 |
new changesets 77ae9631bcca |
| 148 |
nothing to rebase - updating instead |
| 149 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 150 |
updating bookmark norebase |
| 151 |
|
| 152 |
$ hg tglog -l 1 |
| 153 |
@ 2: 77ae9631bcca 'R1' |
| 154 |
| |
| 155 |
~ |
| 156 |
|
| 157 |
pull --rebase --update should ignore --update: |
| 158 |
|
| 159 |
$ hg pull --rebase --update |
| 160 |
pulling from $TESTTMP/a |
| 161 |
searching for changes |
| 162 |
no changes found |
| 163 |
|
| 164 |
pull --rebase doesn't update if nothing has been pulled: |
| 165 |
|
| 166 |
$ hg up -q 1 |
| 167 |
|
| 168 |
$ hg pull --rebase |
| 169 |
pulling from $TESTTMP/a |
| 170 |
searching for changes |
| 171 |
no changes found |
| 172 |
|
| 173 |
$ hg tglog -l 1 |
| 174 |
o 2: 77ae9631bcca 'R1' |
| 175 |
| |
| 176 |
~ |
| 177 |
|
| 178 |
$ cd .. |
| 179 |
|
| 180 |
pull --rebase works when a specific revision is pulled (issue3619) |
| 181 |
|
| 182 |
$ cd a |
| 183 |
$ hg tglog |
| 184 |
@ 2: 77ae9631bcca 'R1' |
| 185 |
| |
| 186 |
o 1: 783333faa078 'C2' |
| 187 |
| |
| 188 |
o 0: 05d58a0c15dd 'C1' |
| 189 |
|
| 190 |
$ echo R2 > R2 |
| 191 |
$ hg ci -Am R2 |
| 192 |
adding R2 |
| 193 |
$ echo R3 > R3 |
| 194 |
$ hg ci -Am R3 |
| 195 |
adding R3 |
| 196 |
$ cd ../c |
| 197 |
$ hg tglog |
| 198 |
o 2: 77ae9631bcca 'R1' |
| 199 |
| |
| 200 |
@ 1: 783333faa078 'C2' |
| 201 |
| |
| 202 |
o 0: 05d58a0c15dd 'C1' |
| 203 |
|
| 204 |
$ echo L1 > L1 |
| 205 |
$ hg ci -Am L1 |
| 206 |
adding L1 |
| 207 |
created new head |
| 208 |
$ hg pull --rev tip --rebase |
| 209 |
pulling from $TESTTMP/a |
| 210 |
searching for changes |
| 211 |
adding changesets |
| 212 |
adding manifests |
| 213 |
adding file changes |
| 214 |
added 2 changesets with 2 changes to 2 files |
| 215 |
new changesets 31cd3a05214e:770a61882ace |
| 216 |
rebasing 3:ff8d69a621f9 "L1" |
| 217 |
saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-160fa373-rebase.hg |
| 218 |
$ hg tglog |
| 219 |
@ 5: 518d153c0ba3 'L1' |
| 220 |
| |
| 221 |
o 4: 770a61882ace 'R3' |
| 222 |
| |
| 223 |
o 3: 31cd3a05214e 'R2' |
| 224 |
| |
| 225 |
o 2: 77ae9631bcca 'R1' |
| 226 |
| |
| 227 |
o 1: 783333faa078 'C2' |
| 228 |
| |
| 229 |
o 0: 05d58a0c15dd 'C1' |
| 230 |
|
| 231 |
pull --rebase works with bundle2 turned on |
| 232 |
|
| 233 |
$ cd ../a |
| 234 |
$ echo R4 > R4 |
| 235 |
$ hg ci -Am R4 |
| 236 |
adding R4 |
| 237 |
$ hg tglog |
| 238 |
@ 5: 00e3b7781125 'R4' |
| 239 |
| |
| 240 |
o 4: 770a61882ace 'R3' |
| 241 |
| |
| 242 |
o 3: 31cd3a05214e 'R2' |
| 243 |
| |
| 244 |
o 2: 77ae9631bcca 'R1' |
| 245 |
| |
| 246 |
o 1: 783333faa078 'C2' |
| 247 |
| |
| 248 |
o 0: 05d58a0c15dd 'C1' |
| 249 |
|
| 250 |
$ cd ../c |
| 251 |
$ hg pull --rebase |
| 252 |
pulling from $TESTTMP/a |
| 253 |
searching for changes |
| 254 |
adding changesets |
| 255 |
adding manifests |
| 256 |
adding file changes |
| 257 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 258 |
new changesets 00e3b7781125 |
| 259 |
rebasing 5:518d153c0ba3 "L1" |
| 260 |
saved backup bundle to $TESTTMP/c/.hg/strip-backup/518d153c0ba3-73407f14-rebase.hg |
| 261 |
$ hg tglog |
| 262 |
@ 6: 0d0727eb7ce0 'L1' |
| 263 |
| |
| 264 |
o 5: 00e3b7781125 'R4' |
| 265 |
| |
| 266 |
o 4: 770a61882ace 'R3' |
| 267 |
| |
| 268 |
o 3: 31cd3a05214e 'R2' |
| 269 |
| |
| 270 |
o 2: 77ae9631bcca 'R1' |
| 271 |
| |
| 272 |
o 1: 783333faa078 'C2' |
| 273 |
| |
| 274 |
o 0: 05d58a0c15dd 'C1' |
| 275 |
|
| 276 |
|
| 277 |
pull --rebase only update if there is nothing to rebase |
| 278 |
|
| 279 |
$ cd ../a |
| 280 |
$ echo R5 > R5 |
| 281 |
$ hg ci -Am R5 |
| 282 |
adding R5 |
| 283 |
$ hg tglog |
| 284 |
@ 6: 88dd24261747 'R5' |
| 285 |
| |
| 286 |
o 5: 00e3b7781125 'R4' |
| 287 |
| |
| 288 |
o 4: 770a61882ace 'R3' |
| 289 |
| |
| 290 |
o 3: 31cd3a05214e 'R2' |
| 291 |
| |
| 292 |
o 2: 77ae9631bcca 'R1' |
| 293 |
| |
| 294 |
o 1: 783333faa078 'C2' |
| 295 |
| |
| 296 |
o 0: 05d58a0c15dd 'C1' |
| 297 |
|
| 298 |
$ cd ../c |
| 299 |
$ echo L2 > L2 |
| 300 |
$ hg ci -Am L2 |
| 301 |
adding L2 |
| 302 |
$ hg up 'desc(L1)' |
| 303 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 304 |
$ hg pull --rebase |
| 305 |
pulling from $TESTTMP/a |
| 306 |
searching for changes |
| 307 |
adding changesets |
| 308 |
adding manifests |
| 309 |
adding file changes |
| 310 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 311 |
new changesets 88dd24261747 |
| 312 |
rebasing 6:0d0727eb7ce0 "L1" |
| 313 |
rebasing 7:c1f58876e3bf "L2" |
| 314 |
saved backup bundle to $TESTTMP/c/.hg/strip-backup/0d0727eb7ce0-ef61ccb2-rebase.hg |
| 315 |
$ hg tglog |
| 316 |
o 8: 6dc0ea5dcf55 'L2' |
| 317 |
| |
| 318 |
@ 7: 864e0a2d2614 'L1' |
| 319 |
| |
| 320 |
o 6: 88dd24261747 'R5' |
| 321 |
| |
| 322 |
o 5: 00e3b7781125 'R4' |
| 323 |
| |
| 324 |
o 4: 770a61882ace 'R3' |
| 325 |
| |
| 326 |
o 3: 31cd3a05214e 'R2' |
| 327 |
| |
| 328 |
o 2: 77ae9631bcca 'R1' |
| 329 |
| |
| 330 |
o 1: 783333faa078 'C2' |
| 331 |
| |
| 332 |
o 0: 05d58a0c15dd 'C1' |
| 333 |
|
| 334 |
|
| 335 |
pull --rebase update (no rebase) use proper update: |
| 336 |
|
| 337 |
- warn about other head. |
| 338 |
|
| 339 |
$ cd ../a |
| 340 |
$ echo R6 > R6 |
| 341 |
$ hg ci -Am R6 |
| 342 |
adding R6 |
| 343 |
$ cd ../c |
| 344 |
$ hg up 'desc(R5)' |
| 345 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 346 |
$ hg pull --rebase |
| 347 |
pulling from $TESTTMP/a |
| 348 |
searching for changes |
| 349 |
adding changesets |
| 350 |
adding manifests |
| 351 |
adding file changes |
| 352 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 353 |
new changesets 65bc164c1d9b |
| 354 |
nothing to rebase - updating instead |
| 355 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 356 |
updated to "65bc164c1d9b: R6" |
| 357 |
1 other heads for branch "default" |
| 358 |
$ hg tglog |
| 359 |
@ 9: 65bc164c1d9b 'R6' |
| 360 |
| |
| 361 |
| o 8: 6dc0ea5dcf55 'L2' |
| 362 |
| | |
| 363 |
| o 7: 864e0a2d2614 'L1' |
| 364 |
|/ |
| 365 |
o 6: 88dd24261747 'R5' |
| 366 |
| |
| 367 |
o 5: 00e3b7781125 'R4' |
| 368 |
| |
| 369 |
o 4: 770a61882ace 'R3' |
| 370 |
| |
| 371 |
o 3: 31cd3a05214e 'R2' |
| 372 |
| |
| 373 |
o 2: 77ae9631bcca 'R1' |
| 374 |
| |
| 375 |
o 1: 783333faa078 'C2' |
| 376 |
| |
| 377 |
o 0: 05d58a0c15dd 'C1' |
| 378 |
|
| 379 |
|
| 380 |
Multiple pre-existing heads on the branch |
| 381 |
----------------------------------------- |
| 382 |
|
| 383 |
Pull bring content, but nothing on the current branch, we should not consider |
| 384 |
pre-existing heads. |
| 385 |
|
| 386 |
$ cd ../a |
| 387 |
$ hg branch unrelatedbranch |
| 388 |
marked working directory as branch unrelatedbranch |
| 389 |
(branches are permanent and global, did you want a bookmark?) |
| 390 |
$ echo B1 > B1 |
| 391 |
$ hg commit -Am B1 |
| 392 |
adding B1 |
| 393 |
$ cd ../c |
| 394 |
$ hg up 'desc(L2)' |
| 395 |
2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 396 |
$ hg pull --rebase |
| 397 |
pulling from $TESTTMP/a |
| 398 |
searching for changes |
| 399 |
adding changesets |
| 400 |
adding manifests |
| 401 |
adding file changes |
| 402 |
added 1 changesets with 1 changes to 1 files |
| 403 |
new changesets 39c381359968 |
| 404 |
nothing to rebase |
| 405 |
|
| 406 |
There is two local heads and we pull a third one. |
| 407 |
The second local head should not confuse the `hg pull rebase`. |
| 408 |
|
| 409 |
$ hg up 'desc(R6)' |
| 410 |
1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 411 |
$ echo M1 > M1 |
| 412 |
$ hg commit -Am M1 |
| 413 |
adding M1 |
| 414 |
$ cd ../a |
| 415 |
$ hg up 'desc(R6)' |
| 416 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 417 |
$ echo R7 > R7 |
| 418 |
$ hg commit -Am R7 |
| 419 |
adding R7 |
| 420 |
$ cd ../c |
| 421 |
$ hg up 'desc(L2)' |
| 422 |
2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 423 |
$ hg pull --rebase |
| 424 |
pulling from $TESTTMP/a |
| 425 |
searching for changes |
| 426 |
adding changesets |
| 427 |
adding manifests |
| 428 |
adding file changes |
| 429 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 430 |
new changesets f7d3e42052f9 |
| 431 |
rebasing 7:864e0a2d2614 "L1" |
| 432 |
rebasing 8:6dc0ea5dcf55 "L2" |
| 433 |
saved backup bundle to $TESTTMP/c/.hg/strip-backup/864e0a2d2614-2f72c89c-rebase.hg |
| 434 |
$ hg tglog |
| 435 |
@ 12: 3603a865eea0 'L2' |
| 436 |
| |
| 437 |
o 11: bcc8a9cd04bf 'L1' |
| 438 |
| |
| 439 |
o 10: f7d3e42052f9 'R7' |
| 440 |
| |
| 441 |
| o 9: 41fab4eef82f 'M1' |
| 442 |
|/ |
| 443 |
| o 8: 39c381359968 'B1' unrelatedbranch |
| 444 |
|/ |
| 445 |
o 7: 65bc164c1d9b 'R6' |
| 446 |
| |
| 447 |
o 6: 88dd24261747 'R5' |
| 448 |
| |
| 449 |
o 5: 00e3b7781125 'R4' |
| 450 |
| |
| 451 |
o 4: 770a61882ace 'R3' |
| 452 |
| |
| 453 |
o 3: 31cd3a05214e 'R2' |
| 454 |
| |
| 455 |
o 2: 77ae9631bcca 'R1' |
| 456 |
| |
| 457 |
o 1: 783333faa078 'C2' |
| 458 |
| |
| 459 |
o 0: 05d58a0c15dd 'C1' |
| 460 |
|