Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch merge-renames Excluding Merge-Ins
This is equivalent to a diff from 5399251230 to 3683508e98
|
2016-05-16
| ||
| 17:46 | Improve the merge command's ability to handle various scenarios involving renames. check-in: 41c2220934 user: drh tags: trunk | |
|
2016-05-12
| ||
| 21:11 | Properly update the execute bit if it has changed in the commit being merged, and add info about changed permissions to the merge command's output. Closed-Leaf check-in: 3683508e98 user: joel tags: merge-renames | |
| 20:18 | Remove unnecessary code. check-in: c8421e923c user: joel tags: merge-renames | |
|
2016-05-09
| ||
| 04:58 | Change the help for 'export' to refer to 'tech notes', not 'events'. check-in: 2fd471dc92 user: mistachkin tags: trunk | |
|
2016-05-06
| ||
| 19:49 | Improve the merge command's ability to handle various scenarios involving renames. check-in: 423029b153 user: joel tags: merge-renames | |
|
2016-05-03
| ||
| 21:30 | Update referenced OpenSSL version. check-in: a47ce4d979 user: jan.nijtmans tags: branch-1.34 | |
| 20:30 | Update referenced OpenSSL version. check-in: 5399251230 user: mistachkin tags: trunk | |
|
2016-05-02
| ||
| 16:19 | Do not run "all" commands against encrypted repos if encryption is not supported. check-in: a13ef5e6a6 user: drh tags: trunk | |
Changes to src/merge.c.
| ︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 138 139 | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
fForkSeen = fossil_find_nearest_fork(rid, db_open_local(0))!=0;
}
}
}
db_finalize(&q);
return fForkSeen;
}
/*
** Add an entry to the FV table for all files renamed between
** version N and the version specified by vid.
*/
static void add_renames(
const char *zFnCol, /* The FV column for the filename in vid */
int vid, /* The desired version's RID */
int nid, /* Version N's RID */
int revOk, /* Ok to move backwards (child->parent) if true */
const char *zDebug /* Generate trace output if not NULL */
){
int nChng; /* Number of file name changes */
int *aChng; /* An array of file name changes */
int i; /* Loop counter */
find_filename_changes(nid, vid, revOk, &nChng, &aChng, zDebug);
if( nChng==0 ) return;
for(i=0; i<nChng; i++){
char *zN, *zV;
zN = db_text(0, "SELECT name FROM filename WHERE fnid=%d", aChng[i*2]);
zV = db_text(0, "SELECT name FROM filename WHERE fnid=%d", aChng[i*2+1]);
db_multi_exec(
"INSERT OR IGNORE INTO fv(%s,fnn) VALUES(%Q,%Q)",
zFnCol /*safe-for-%s*/, zV, zN
);
if( db_changes()==0 ){
db_multi_exec(
"UPDATE fv SET %s=%Q WHERE fnn=%Q",
zFnCol /*safe-for-%s*/, zV, zN
);
}
free(zN);
free(zV);
}
free(aChng);
}
/*
** COMMAND: merge
**
** Usage: %fossil merge ?OPTIONS? ?VERSION?
**
** The argument VERSION is a version that should be merged into the
|
| ︙ | |||
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | + - - - + + |
**
** -v|--verbose Show additional details of the merge
*/
void merge_cmd(void){
int vid; /* Current version "V" */
int mid; /* Version we are merging from "M" */
int pid; /* The pivot version - most recent common ancestor P */
int nid = 0; /* The name pivot version "N" */
int verboseFlag; /* True if the -v|--verbose option is present */
int integrateFlag; /* True if the --integrate option is present */
int pickFlag; /* True if the --cherrypick option is present */
int backoutFlag; /* True if the --backout option is present */
int dryRunFlag; /* True if the --dry-run or -n option is present */
int forceFlag; /* True if the --force or -f option is present */
int forceMissingFlag; /* True if the --force-missing option is present */
const char *zBinGlob; /* The value of --binary */
const char *zPivot; /* The value of --baseline */
int debugFlag; /* True if --debug is present */
|
| ︙ | |||
289 290 291 292 293 294 295 | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | + - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + |
pid = name_to_typed_rid(zPivot, "ci");
if( pid==0 || !is_a_version(pid) ){
fossil_fatal("not a version: %s", zPivot);
}
if( pickFlag ){
fossil_fatal("incompatible options: --cherrypick & --baseline");
}
}
|
| ︙ | |||
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | + + + + + + + + + + + + + - - - - + + + + - - - + + + - - + + + - + + + + + + + + + + - + - - - - - + + + + + + + + - - - - - - - - - - - - - - - - + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + - + - - + - - - - + + - - - - + + - - - - - - - + + - - - - + + - - - - + + + - - - - - - + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
if( !dryRunFlag ) undo_begin();
if( load_vfile_from_rid(mid) && !forceMissingFlag ){
fossil_fatal("missing content, unable to merge");
}
if( load_vfile_from_rid(pid) && !forceMissingFlag ){
fossil_fatal("missing content, unable to merge");
}
if( zPivot ){
vAncestor = db_exists(
"WITH RECURSIVE ancestor(id) AS ("
" VALUES(%d)"
" UNION ALL"
" SELECT pid FROM plink, ancestor"
" WHERE cid=ancestor.id AND pid!=%d AND cid!=%d)"
"SELECT 1 FROM ancestor WHERE id=%d LIMIT 1",
vid, nid, pid, pid
) ? 'p' : 'n';
}
if( debugFlag ){
char *z;
z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nid);
fossil_print("N=%d %z\n", nid, z);
z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pid);
fossil_print("P=%d %z\n", pid, z);
z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
fossil_print("M=%d %z\n", mid, z);
z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
fossil_print("V=%d %z\n", vid, z);
}
/*
** The vfile.pathname field is used to match files against each other. The
** FV table contains one row for each each unique filename in
** in the current checkout, the pivot, and the version being merged.
*/
db_multi_exec(
"DROP TABLE IF EXISTS fv;"
"CREATE TEMP TABLE fv("
|
| ︙ | |||
659 660 661 662 663 664 665 666 667 668 669 670 671 | 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | + + + + + + + + + + - + + + + - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
char *zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
file_delete(zFullPath);
free(zFullPath);
}
}
db_finalize(&q);
/* For certain sets of renames (e.g. A -> B and B -> A), a file that is
** being renamed must first be moved to a temporary location to avoid
** being overwritten by another rename operation. A row is added to the
** TMPRN table for each of these temporary renames.
*/
db_multi_exec(
"DROP TABLE IF EXISTS tmprn;"
"CREATE TEMP TABLE tmprn(fn UNIQUE, tmpfn);"
);
/*
** Rename files that have taken a rename on P->M but which keep the same
** name on P->V. If a file is renamed on P->V only or on both P->V and
** P->M then we retain the V name of the file.
*/
db_prepare(&q,
|
| ︙ |
Changes to src/path.c.
| ︙ | |||
450 451 452 453 454 455 456 | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | - |
}
db_finalize(&q1);
if( nChng ){
aChng = *aiChng = fossil_malloc( nChng*2*sizeof(int) );
for(pChng=pAll, i=0; pChng; pChng=pChng->pNext){
if( pChng->newName==0 ) continue;
if( pChng->origName==0 ) continue;
|
| ︙ |
Changes to src/pivot.c.
| ︙ | |||
71 72 73 74 75 76 77 78 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | + + - + | ); } /* ** Find the most recent common ancestor of the primary and one of ** the secondaries. Return its rid. Return 0 if no common ancestor ** can be found. ** ** If ignoreMerges is true, follow only "primary" parent links. */ |
| ︙ | |||
100 101 102 103 104 105 106 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - + + - + + |
** is not.
*/
db_prepare(&q2,
"SELECT 1 FROM aqueue A, plink, aqueue B"
" WHERE plink.pid=:rid"
" AND plink.cid=B.rid"
" AND A.rid=:rid"
|
| ︙ | |||
159 160 161 162 163 164 165 | 163 164 165 166 167 168 169 170 171 172 173 174 | - + |
usage("PRIMARY SECONDARY ...");
}
db_must_be_within_tree();
pivot_set_primary(name_to_rid(g.argv[2]));
for(i=3; i<g.argc; i++){
pivot_set_secondary(name_to_rid(g.argv[i]));
}
|
Changes to test/merge6.test.
| ︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 | - + |
fossil merge branch_for_f3_f4
fossil commit -m "new trunk files f2, f3, and f4 via merge"
fossil ls
test merge_multi-4 {[normalize_result] eq {f1
f2
f3
|
Added test/merge_exe.test.