Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch rid-renumbering Excluding Merge-Ins
This is equivalent to a diff from 9c7fdea8 to 12a022b1
2019-01-21
| ||
16:54 | When SQLite detects that the repository associated with a checkout has been replaced by a clone (such that the RID values potentially change) then automatically adjust the content of the checkout database. ... (check-in: fff37e62 user: drh tags: trunk) | |
09:38 | Assorted improvements to the TLS/SSL docs. ... (check-in: 43166dcd user: wyoung tags: trunk) | |
2019-01-20
| ||
23:58 | Pick up the cherrypick merge arrow display fix from trunk. ... (Closed-Leaf check-in: 12a022b1 user: drh tags: rid-renumbering) | |
23:57 | Improved rendering of cherrypick merge arrows, especially on the "ardoise" and "eagle" skins. ... (check-in: 9c7fdea8 user: drh tags: trunk) | |
23:42 | Minor comment changes. ... (check-in: e2a73756 user: drh tags: rid-renumbering) | |
16:47 | Fix a hyperlink error on the graph-test page. (This should have been committed to trunk to begin with.) ... (check-in: 20431a7c user: drh tags: trunk) | |
Changes to src/add.c.
︙ | |||
185 186 187 188 189 190 191 | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - - + + | db_multi_exec("UPDATE vfile SET deleted=0" " WHERE pathname=%Q %s AND deleted", zPath, filename_collation()); }else{ char *zFullname = mprintf("%s%s", g.zLocalRoot, zPath); int isExe = file_isexe(zFullname, RepoFILE); db_multi_exec( |
︙ |
Changes to src/bisect.c.
︙ | |||
284 285 286 287 288 289 290 291 292 293 294 295 296 297 | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | + + + + + + + + + + + | db_column_text(&q, 3), db_column_text(&q, 2), (db_column_int(&q, 4) && zGoodBad[0]!='C') ? " CURRENT" : ""); } db_finalize(&q); } /* ** Reset the bisect subsystem. */ void bisect_reset(void){ db_multi_exec( "DELETE FROM vvar WHERE name IN " " ('bisect-good', 'bisect-bad', 'bisect-log')" ); } /* ** COMMAND: bisect ** ** Usage: %fossil bisect SUBCOMMAND ... ** ** Run various subcommands useful for searching for bugs. ** |
︙ | |||
487 488 489 490 491 492 493 | 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | - - - - + | if( i>=count(aBisectOption) ){ fossil_fatal("no such bisect option: %s", g.argv[3]); } }else{ usage("options ?NAME? ?VALUE?"); } }else if( strncmp(zCmd, "reset", n)==0 ){ |
︙ |
Changes to src/checkin.c.
︙ | |||
305 306 307 308 309 310 311 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + - | } blob_reset(&rewrittenPathname); db_finalize(&q); /* If C_MERGE, put merge contributors at the end of the report. */ skipFiles: if( flags & C_MERGE ){ |
︙ | |||
1633 1634 1635 1636 1637 1638 1639 | 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 | - - + + - | } db_finalize(&q); blob_appendf(pOut, "\n"); } free(zDate); db_prepare(&q, |
︙ | |||
1665 1666 1667 1668 1669 1670 1671 | 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 | - + | if( zColor && zColor[0] ){ /* One-time background color */ blob_appendf(pOut, "T +bgcolor * %F\n", zColor); } if( p->closeFlag ){ blob_appendf(pOut, "T +closed *\n"); } |
︙ | |||
2398 2399 2400 2401 2402 2403 2404 | 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 | - + + | blob_reset(&fname); } nrid = content_put(&content); blob_reset(&content); if( rid>0 ){ content_deltify(rid, &nrid, 1, 0); } |
︙ | |||
2506 2507 2508 2509 2510 2511 2512 | 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 | - - + | dryRunFlag ? MC_NONE : MC_PERMIT_HOOKS)==0 ){ fossil_fatal("%s", g.zErrMsg); } assert( blob_is_reset(&manifest) ); content_deltify(vid, &nvid, 1, 0); zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid); |
︙ | |||
2533 2534 2535 2536 2537 2538 2539 | 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 | - + | } /* Update the vfile and vmerge tables */ db_multi_exec( "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);" "DELETE FROM vmerge;" "UPDATE vfile SET vid=%d;" |
︙ |
Changes to src/db.c.
︙ | |||
1471 1472 1473 1474 1475 1476 1477 | 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | - - - - + + + + + + + + + + + + + + + - + - + - + + + + + + | /* ** If zDbName is a valid local database file, open it and return ** true. If it is not a valid local database file, return 0. */ static int isValidLocalDb(const char *zDbName){ i64 lsize; |
︙ | |||
1654 1655 1656 1657 1658 1659 1660 | 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 | + + - - - - - - + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + + + + + + + + + + + + + + + - + + | } /* Make a change to the CHECK constraint on the BLOB table for ** version 2.0 and later. */ rebuild_schema_update_2_0(); /* Do the Fossil-2.0 schema updates */ /* Additional checks that occur when opening the checkout database */ if( g.localOpen ){ |
︙ | |||
2878 2879 2880 2881 2882 2883 2884 | 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 | - + | } #if defined(_WIN32) || defined(__CYGWIN__) # define LOCALDB_NAME "./_FOSSIL_" #else # define LOCALDB_NAME "./.fslckout" #endif |
︙ |
Changes to src/foci.c.
︙ | |||
119 120 121 122 123 124 125 | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - + + | ** ** (0) A full scan. Visit every manifest in the repo. (Slow) ** (1) checkinID=?. visit only the single manifest specified. ** (2) symName=? visit only the single manifest specified. */ static int fociBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ int i; |
︙ |
Changes to src/json_status.c.
︙ | |||
152 153 154 155 156 157 158 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | - - + | cson_object_set( oPay, "errorCount", json_new_int( nErr ) ); db_finalize(&q); #if 0 /* TODO: add "merged with" status. First need (A) to decide on a structure and (B) to set up some tests for the multi-merge case.*/ |
︙ |
Changes to src/merge.c.
︙ | |||
162 163 164 165 166 167 168 169 170 171 172 173 174 175 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | + + + + + + + + + + | ); } free(zN); free(zV); } free(aChng); } /* Make an entry in the vmerge table for the given id, and rid. */ static void vmerge_insert(int id, int rid){ db_multi_exec( "INSERT OR IGNORE INTO vmerge(id,merge,mhash)" "VALUES(%d,%d,(SELECT uuid FROM blob WHERE rid=%d))", id, rid, rid ); } /* ** COMMAND: merge ** ** Usage: %fossil merge ?OPTIONS? ?VERSION? ** ** The argument VERSION is a version that should be merged into the |
︙ | |||
592 593 594 595 596 597 598 | 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | - - + + + + | const char *zName = db_column_text(&q, 2); int islinkm = db_column_int(&q, 3); /* Copy content from idm over into idv. Overwrite idv. */ fossil_print("UPDATE %s\n", zName); if( !dryRunFlag ){ undo_save(zName); db_multi_exec( |
︙ | |||
662 663 664 665 666 667 668 | 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | - - + | fossil_print("***** Cannot merge binary file %s\n", zName); nConflict++; } blob_reset(&p); blob_reset(&m); blob_reset(&r); } |
︙ | |||
784 785 786 787 788 789 790 | 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 | - - + + + + + + | " WHERE idp=0 AND idv=0 AND idm>0" ); while( db_step(&q)==SQLITE_ROW ){ int idm = db_column_int(&q, 0); const char *zName; char *zFullName; db_multi_exec( |
︙ | |||
824 825 826 827 828 829 830 | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | - + - + - + - + | } /* ** Clean up the mid and pid VFILE entries. Then commit the changes. */ db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid); if( pickFlag ){ |
Changes to src/schema.c.
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | /* ** Copyright (c) 2007 D. Richard Hipp ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the Simplified BSD License (also ** known as the "2-Clause License" or "FreeBSD License".) |
︙ | |||
350 351 352 353 354 355 356 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | - + | @ -- used to reduce push operations to a single HTTP request in the @ -- common case when one repository only talks to a single server. @ -- @ CREATE TABLE unsent( @ rid INTEGER PRIMARY KEY -- Record ID of the phantom @ ); @ |
︙ | |||
375 376 377 378 379 380 381 | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | - + | @ INSERT INTO tag VALUES(6, 'private'); -- TAG_PRIVATE @ INSERT INTO tag VALUES(7, 'cluster'); -- TAG_CLUSTER @ INSERT INTO tag VALUES(8, 'branch'); -- TAG_BRANCH @ INSERT INTO tag VALUES(9, 'closed'); -- TAG_CLOSED @ INSERT INTO tag VALUES(10,'parent'); -- TAG_PARENT @ INSERT INTO tag VALUES(11,'note'); -- TAG_NOTE @ |
︙ | |||
488 489 490 491 492 493 494 | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | - + | # define TAG_PARENT 10 /* Change to parentage on a check-in */ # define TAG_NOTE 11 /* Extra text appended to a check-in comment */ #endif /* ** The schema for the local FOSSIL database file found at the root ** of every check-out. This database contains the complete state of |
︙ | |||
513 514 515 516 517 518 519 | 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 582 583 584 585 586 587 | - - - - - + + + + + + - - - - + + + + + + + + + + + + + - + + - - - + + + + + + + + + + + + | @ @ -- Each entry in the vfile table represents a single file in the @ -- current checkout. @ -- @ -- The file.rid field is 0 for files or folders that have been @ -- added but not yet committed. @ -- |
︙ |
Changes to src/update.c.
︙ | |||
527 528 529 530 531 532 533 | 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | - - + | } /* Report on conflicts */ if( !dryRunFlag ){ Stmt q; int nMerge = 0; |
︙ | |||
863 864 865 866 867 868 869 | 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 | - + + | blob_write_to_file(&record, zFull); } file_setexe(zFull, rvPerm==PERM_EXE); fossil_print("REVERT %s\n", zFile); mtime = file_mtime(zFull, RepoFILE); db_multi_exec( "UPDATE vfile" |
︙ |
Changes to src/vfile.c.
︙ | |||
86 87 88 89 90 91 92 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - - + + | db_begin_transaction(); p = manifest_get(vid, CFTYPE_MANIFEST, 0); if( p==0 ) { db_end_transaction(1); return 0; } db_prepare(&ins, |
︙ | |||
240 241 242 243 244 245 246 | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - + | ** if --hash is used, check to see if they have been edited by ** looking at their artifact hashes */ const char *zUuid = db_column_text(&q, 5); int nUuid = db_column_bytes(&q, 5); assert( origSize==currentSize ); if( !hname_verify_file_hash(zName, zUuid, nUuid) ) chnged = 1; } |
︙ | |||
964 965 966 967 968 969 970 | 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | vfile_aggregate_checksum_repository(vid, &hash); printf("archive: %s\n", blob_str(&hash)); blob_reset(&hash); vfile_aggregate_checksum_manifest(vid, &hash, &hash2); printf("manifest: %s\n", blob_str(&hash)); printf("recorded: %s\n", blob_str(&hash2)); } /* ** This routine recomputes certain columns of the vfile and vmerge tables ** when the associated repository is swapped out for a clone of the same ** project, and the blob.rid value change. The following columns are ** updated: ** ** vmerge.merge ** vfile.vid ** vfile.rid ** vfile.mrid ** ** Also: ** ** vvar.value WHERE name='checkout' */ void vfile_rid_renumbering_event(int dryRun){ int oldVid; int newVid; char *zUnresolved; oldVid = db_lget_int("checkout", 0); newVid = db_int(0, "SELECT blob.rid FROM blob, vvar" " WHERE blob.uuid=vvar.value" " AND vvar.name='checkout-hash'"); /* The idMap table will make old RID values into new ones */ db_multi_exec( "CREATE TEMP TABLE idMap(oldrid INTEGER PRIMARY KEY, newrid INT);\n" ); /* Add the RID value for the current check-out */ db_multi_exec( "INSERT INTO idMap(oldrid, newrid) VALUES(%d,%d)", oldVid, newVid ); /* Add the RID values for any other check-ins that have been merged into ** the current check-out. */ db_multi_exec( "INSERT OR IGNORE INTO idMap(oldrid, newrid)" " SELECT vmerge.merge, blob.rid FROM vmerge, blob" " WHERE blob.uuid=vmerge.mhash;" ); /* Add RID values for files in the current check-out */ db_multi_exec( "CREATE TEMP TABLE hashoffile(name TEXT PRIMARY KEY, hash TEXT)" "WITHOUT ROWID;" "INSERT INTO hashoffile(name,hash)" " SELECT filename, uuid FROM vvar, files_of_checkin(vvar.value)" " WHERE vvar.name='checkout-hash';" "INSERT OR IGNORE INTO idMap(oldrid, newrid)" " SELECT vfile.rid, blob.rid FROM vfile, hashoffile, blob" " WHERE hashoffile.name=coalesce(vfile.origname,vfile.pathname)" " AND blob.uuid=hashoffile.hash;" ); /* Add RID values for merged-in files */ db_multi_exec( "INSERT OR IGNORE INTO idMap(oldrid, newrid)" " SELECT vfile.mrid, blob.rid FROM vfile, blob" " WHERE blob.uuid=vfile.mhash;" ); if( dryRun ){ Stmt q; db_prepare(&q, "SELECT oldrid, newrid, blob.uuid" " FROM idMap, blob WHERE blob.rid=idMap.newrid"); while( db_step(&q)==SQLITE_ROW ){ fossil_print("%8d -> %8d %.25s\n", db_column_int(&q,0), db_column_int(&q,1), db_column_text(&q,2)); } db_finalize(&q); } /* Verify that all RID values in the VFILE table and VMERGE table have ** been resolved. */ zUnresolved = db_text("", "WITH allrid(x) AS (" " SELECT rid FROM vfile" " UNION SELECT mrid FROM vfile" " UNION SELECT merge FROM vmerge" " UNION SELECT %d" ")" "SELECT group_concat(x,' ') FROM allrid" " WHERE x NOT IN (SELECT oldrid FROM idMap);", oldVid ); if( zUnresolved[0] ){ fossil_fatal("Unresolved RID values: %s\n", zUnresolved); } /* Make the changes to the VFILE and VMERGE tables */ if( !dryRun ){ db_multi_exec( "UPDATE vfile" " SET rid=(SELECT newrid FROM idMap WHERE oldrid=vfile.rid)" " WHERE vid=%d AND rid>0;", oldVid); db_multi_exec( "UPDATE vfile" " SET mrid=(SELECT newrid FROM idMap WHERE oldrid=vfile.mrid)" " WHERE vid=%d AND mrid>0;", oldVid); db_multi_exec( "UPDATE vfile" " SET vid=%d" " WHERE vid=%d", newVid, oldVid); db_multi_exec( "UPDATE vmerge" " SET merge=(SELECT newrid FROM idMap WHERE oldrid=vmerge.merge);"); db_lset_int("checkout",newVid); } /* Clear out the TEMP tables we constructed */ db_multi_exec( "DROP TABLE idMap;" "DROP TABLE hashoffile;" ); } |