Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch StvPrivateHook2 Excluding Merge-Ins
This is equivalent to a diff from f88368742d to e6dce6a16a
2010-10-29
| ||
21:11 | merge from trunk and add sqlite shell to windows make check-in: 6d334ac9ed user: wolfgang tags: StvPrivateHook2 | |
2010-10-28
| ||
17:41 | merge from trunk Leaf check-in: e6dce6a16a user: wolfgang tags: StvPrivateHook2 | |
14:41 | Fix a few harmless compiler warnings. check-in: d03718ad5f user: drh tags: trunk | |
2010-10-27
| ||
20:39 | added missing dependency in dmc windows make for resource file check-in: 304c71a09c user: wolfgang tags: StvPrivateHook2 | |
2010-10-17
| ||
16:37 | merge from old hook branch check-in: 9cf288de27 user: wolfgang tags: StvPrivateHook2 | |
2010-10-16
| ||
19:07 | PellesC doesn't have pgmptr, update Makefile Leaf check-in: f88368742d user: wolfgang tags: wolfgangHelpCmd | |
17:33 | merge from trunk check-in: 586b0eb144 user: wolfgang tags: wolfgangHelpCmd | |
Changes to Makefile.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - - - + + + + + + + + + + + + + | #### Extra arguments for linking the finished binary. Fossil needs # to link against the Z-Lib compression library. There are no # other dependencies. We sometimes add the -static option here # so that we can build a static executable that will run in a # chroot jail. # LIB = -lz $(LDFLAGS) |
Changes to src/branch.c.
︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - - + | char *zUuid; /* Artifact ID of origin */ Stmt q; /* Generic query */ const char *zBranch; /* Name of the new branch */ char *zDate; /* Date that branch was created */ char *zComment; /* Check-in comment for the new branch */ const char *zColor; /* Color of the new branch */ Blob branch; /* manifest for the new branch */ |
︙ | |||
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | + + + + + + + + - - - - - - + - - - - - + + + + - - + - - - - + + + + - - + + | user_select(); db_begin_transaction(); rootid = name_to_rid(g.argv[4]); if( rootid==0 ){ fossil_fatal("unable to locate check-in off of which to branch"); } pParent = manifest_get(rootid, CFTYPE_MANIFEST); if( pParent==0 ){ fossil_fatal("%s is not a valid check-in", g.argv[4]); } /* Create a manifest for the new branch */ blob_zero(&branch); if( pParent->zBaseline ){ blob_appendf(&branch, "B %s\n", pParent->zBaseline); } zComment = mprintf("Create new branch named \"%h\"", zBranch); blob_appendf(&branch, "C %F\n", zComment); zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now"); zDate[10] = 'T'; blob_appendf(&branch, "D %s\n", zDate); /* Copy all of the content from the parent into the branch */ |
︙ |
Changes to src/browse.c.
︙ | |||
69 70 71 72 73 74 75 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 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 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 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 | - + + + + + - - + + + + - - + - - - + + + - - + - + + + + + + - - + + + + - + + - + + + - - - - - + + + + + + + + + + + + + + + + - - - - - - + - - - - + + + + - - + + | ** to the "dir" page for the directory. ** ** There is no hyperlink on the file element of the path. ** ** The computed string is appended to the pOut blob. pOut should ** have already been initialized. */ |
︙ | |||
244 245 246 247 248 249 250 251 252 253 | 264 265 266 267 268 269 270 271 272 273 274 | + | @ <li><a href="%s(g.zBaseURL)/artifact?name=%s(zUuid)">%h(zFN)</a></li> }else{ @ <li><a href="%s(g.zBaseURL)/finfo?name=%T(zPrefix)%T(zFN)">%h(zFN) @ </a></li> } } db_finalize(&q); manifest_destroy(pM); @ </ul></td></tr></table> style_footer_cmdref("ls",0); } |
Changes to src/checkin.c.
︙ | |||
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | + - + + + | void extra_cmd(void){ Blob path; Blob repo; Stmt q; int n; const char *zIgnoreFlag = find_option("ignore",0,1); int allFlag = find_option("dotfiles",0,0)!=0; int outputManifest = db_get_boolean("manifest",0); db_must_be_within_tree(); db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); n = strlen(g.zLocalRoot); blob_init(&path, g.zLocalRoot, n-1); if( zIgnoreFlag==0 ){ zIgnoreFlag = db_get("ignore-glob", 0); } vfile_scan(0, &path, blob_size(&path), allFlag); db_prepare(&q, "SELECT x FROM sfile" |
︙ | |||
539 540 541 542 543 544 545 | 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 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 | - - - + - - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | assert( strlen(zDate)==19 ); assert( zDate[10]==' ' ); zDate[10] = 'T'; return zDate; } /* |
︙ | |||
588 589 590 591 592 593 594 595 596 597 | 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 | + + - - - - - + + + + + + + - - + + + + + - + - - + - + + + + + + + + + + + + + + + + + + + + | ** ** --comment|-m COMMENT-TEXT ** --branch NEW-BRANCH-NAME ** --bgcolor COLOR ** --nosign ** --force|-f ** --private ** --baseline ** --delta ** */ void commit_cmd(void){ |
︙ | |||
683 684 685 686 687 688 689 | 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | - + - + | /* ** Check that the user exists. */ if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ fossil_fatal("no such user: %s", g.zLogin); } |
︙ | |||
722 723 724 725 726 727 728 | 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 | - + | */ if( db_exists("SELECT 1 FROM tagxref" " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, vid) ){ fossil_fatal("cannot commit against a closed leaf"); } |
︙ | |||
777 778 779 780 781 782 783 | 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 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 1098 1099 1100 1101 1102 1103 1104 1105 1106 | - + - - + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + - - - - - + + + + + + + + + + + + + + - - - - - - - - + - - - - + + + + + - - + - - - - - - - + + + + - - - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + - - + - - - - - - - + - - - - + - - + - - - - + + + + + + + + + - + + - - - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + | content_deltify(rid, nrid, 0); } db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id); db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid); } db_finalize(&q); |
Changes to src/checkout.c.
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 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 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 176 177 178 | - - - - + - + + - - + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + + + - + + + + + + + + | return vid; } /* ** Load a vfile from a record ID. */ void load_vfile_from_rid(int vid){ |
︙ | |||
226 227 228 229 230 231 232 233 234 235 236 237 238 239 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | + | if( !keepFlag ){ uncheckout(prior); } db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid); if( !keepFlag ){ vfile_to_disk(vid, 0, 1, promptFlag); } checkout_set_all_exe(vid); manifest_to_disk(vid); db_lset_int("checkout", vid); undo_reset(); db_multi_exec("DELETE FROM vmerge"); if( !keepFlag ){ vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b); vfile_aggregate_checksum_disk(vid, &cksum2); |
︙ |
Changes to src/configure.c.
︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | + | { "css", CONFIGSET_SKIN }, { "header", CONFIGSET_SKIN }, { "footer", CONFIGSET_SKIN }, { "logo-mimetype", CONFIGSET_SKIN }, { "logo-image", CONFIGSET_SKIN }, { "project-name", CONFIGSET_PROJ }, { "project-description", CONFIGSET_PROJ }, { "manifest", CONFIGSET_PROJ }, { "index-page", CONFIGSET_SKIN }, { "timeline-block-markup", CONFIGSET_SKIN }, { "timeline-max-comment", CONFIGSET_SKIN }, { "ticket-table", CONFIGSET_TKT }, { "ticket-common", CONFIGSET_TKT }, { "ticket-newpage", CONFIGSET_TKT }, { "ticket-viewpage", CONFIGSET_TKT }, |
︙ |
Changes to src/content.c.
︙ | |||
279 280 281 282 283 284 285 | 279 280 281 282 283 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 309 310 311 | - + - + + + + + + - + - | }else{ bag_insert(&contentCache.available, rid); } return rc; } /* |
︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | 323 324 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 378 379 380 381 382 383 384 385 386 387 388 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 | + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | rid = name_to_rid(g.argv[2]); blob_zero(&content); db_blob(&content, "SELECT content FROM blob WHERE rid=%d", rid); blob_uncompress(&content, &content); blob_write_to_file(&content, zFile); } /* ** The following flag is set to disable the automatic calls to ** manifest_crosslink() when a record is dephantomized. This ** flag can be set (for example) when doing a clone when we know ** that rebuild will be run over all records at the conclusion ** of the operation. */ static int ignoreDephantomizations = 0; /* ** When a record is converted from a phantom to a real record, ** if that record has other records that are derived by delta, ** then call manifest_crosslink() on those other records. ** ** If the formerly phantom record or any of the other records ** derived by delta from the former phantom are a baseline manifest, ** then also invoke manifest_crosslink() on the delta-manifests ** associated with that baseline. ** ** Tail recursion is used to minimize stack depth. */ void after_dephantomize(int rid, int linkFlag){ Stmt q; int nChildAlloc = 0; int *aChild = 0; Blob content; if( ignoreDephantomizations ) return; while( rid ){ int nChildUsed = 0; int i; /* Parse the object rid itself */ if( linkFlag ){ |
︙ |
Changes to src/db.c.
︙ | |||
1508 1509 1510 1511 1512 1513 1514 | 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 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 | - - - - - - - + + + + + + + - - + + + + + + + + + + + + + | char const *name; /* Name of the setting */ char const *var; /* Internal variable name used by db_set() */ int width; /* Width of display. 0 for boolean values */ char const *def; /* Default value */ }; #endif /* INTERFACE */ struct stControlSettings const ctrlSettings[] = { |
︙ | |||
1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** Example: *.o,*.obj,*.exe ** ** localauth If enabled, require that HTTP connections from ** 127.0.0.1 be authenticated by password. If ** false, all HTTP requests from localhost have ** unrestricted access to the repository. ** ** manifest If enabled, automatically create files "manifest" and ** "manifest.uuid" in every checkout. The SQLite and ** Fossil repositories both require this. Default: off. ** ** mtime-changes Use file modification times (mtimes) to detect when ** files have been modified. (Default "on".) ** ** pgp-command Command used to clear-sign manifests at check-in. ** The default is "gpg --clearsign -o ". ** ** proxy URL of the HTTP proxy. If undefined or "off" then ** the "http_proxy" environment variable is consulted. ** If the http_proxy environment variable is undefined ** then a direct HTTP connection is used. ** ** push-hook-cmd this is the command line, that will be activated ** as push hook. Output redirects should be added to ** this command line. ** The complete command line looks like: ** command name: the configured value for push-hook-cmd ** argument 1: timestamp followed by random-number ** argument 2: pattern sent by client ** As fallback, stdin/stderr are redirected to files ** hook-log-<timestamp followed by random-number> ** ** push-hook-force ** if this is set on the client, it will request always ** the hook activation, even if no files where pushed on ** the sync. ** if this is set on the server, it will accept hook ** activiation, even if no files where pushed. ** Default: on ** ** push-hook-pattern-client ** if set, a client push will sent this message to the ** server, to activate the push hook command. ** Default: on ** ** push-hook-pattern-server ** if set, and a client send this pattern at the end of ** a push, the push hook command will be executed. This ** might be a prefix of the pattern, sent by the client. ** ** push-hook-privilege ** if set, the user doing the push needs this privilege ** to trigger the hook. Valid privileges are: ** s (setup), a (admin), i (checkin) or o (checkout) ** ** repo-cksum Compute checksums over all files in each checkout ** as a double-check of correctness. Defaults to "on". ** Disable on large repositories for a performance ** improvement. ** ** ssh-command Command used to talk to a remote machine with ** the "ssh://" protocol. ** ** web-browser A shell command used to launch your preferred ** web browser when given a URL as an argument. ** Defaults to "start" on windows, "open" on Mac, |
︙ | |||
1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 | 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 | + + + + + + + + + | } if( g.argc==2 ){ for(i=0; ctrlSettings[i].name; i++){ print_setting(ctrlSettings[i].name); } }else if( g.argc==3 || g.argc==4 ){ const char *zName = g.argv[2]; int isManifest; int n = strlen(zName); for(i=0; ctrlSettings[i].name; i++){ if( strncmp(ctrlSettings[i].name, zName, n)==0 ) break; } if( !ctrlSettings[i].name ){ fossil_fatal("no such setting: %s", zName); } isManifest = strcmp(ctrlSettings[i].name, "manifest")==0; if( isManifest && globalFlag ){ fossil_fatal("cannot set 'manifest' globally"); } if( unsetFlag ){ db_unset(ctrlSettings[i].name, globalFlag); }else if( g.argc==4 ){ db_set(ctrlSettings[i].name, g.argv[3], globalFlag); }else{ isManifest = 0; print_setting(ctrlSettings[i].name); } if( isManifest ){ manifest_to_disk(db_lget_int("checkout", 0)); } }else{ usage("?PROPERTY? ?VALUE?"); } } /* ** The input in a a timespan measured in days. Return a string which |
︙ |
Changes to src/delta.c.
︙ | |||
193 194 195 196 197 198 199 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - + + + + - - - - + + + + - + + + + + - - - + + + - + | } /* ** Compute a 32-bit checksum on the N-byte buffer. Return the result. */ static unsigned int checksum(const char *zIn, size_t N){ const unsigned char *z = (const unsigned char *)zIn; |
︙ | |||
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 | 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | + + | int lenSrc, /* Length of the source file */ const char *zDelta, /* Delta to apply to the pattern */ int lenDelta, /* Length of the delta */ char *zOut /* Write the output into this preallocated buffer */ ){ unsigned int limit; unsigned int total = 0; #ifndef FOSSIL_OMIT_DELTA_CKSUM_TEST char *zOrigOut = zOut; #endif limit = getInt(&zDelta, &lenDelta); if( *zDelta!='\n' ){ /* ERROR: size integer not terminated by "\n" */ return -1; } zDelta++; lenDelta--; |
︙ | |||
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | + + | zDelta += cnt; lenDelta -= cnt; break; } case ';': { zDelta++; lenDelta--; zOut[0] = 0; #ifndef FOSSIL_OMIT_DELTA_CKSUM_TEST if( cnt!=checksum(zOrigOut, total) ){ /* ERROR: bad checksum */ return -1; } #endif if( total!=limit ){ /* ERROR: generated size does not match predicted size */ return -1; } return total; } default: { |
︙ |
Changes to src/diffcmd.c.
︙ | |||
33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | + | int portable_system(const char *zOrigCmd){ int rc; #if defined(_WIN32) /* On windows, we have to put double-quotes around the entire command. ** Who knows why - this is just the way windows works. */ char *zNewCmd = mprintf("\"%s\"", zOrigCmd); fflush(0); rc = system(zNewCmd); free(zNewCmd); #else /* On unix, evaluate the command directly. */ rc = system(zOrigCmd); #endif |
︙ | |||
353 354 355 356 357 358 359 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 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 | - - + + + - - - - + + + + + + + - + - + - + - + - + - + - + - + - - + + - - + + - + - - - - + + + - - + + | */ static void diff_all_two_versions( const char *zFrom, const char *zTo, const char *zDiffCmd, int diffFlags ){ |
︙ |
Changes to src/doc.c.
︙ | |||
386 387 388 389 390 391 392 | 386 387 388 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 | - - + + - + - - - + - - - + + + + - + | " WHERE vid=%d AND fname=%Q", vid, zName); if( rid==0 && db_exists("SELECT 1 FROM vcache WHERE vid=%d", vid) ){ goto doc_not_found; } if( rid==0 ){ Stmt s; |
︙ |
Changes to src/encode.c.
︙ | |||
265 266 267 268 269 270 271 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | - - + + + | } /* ** Decode a fossilized string in-place. */ void defossilize(char *z){ int i, j, c; |
︙ |
Changes to src/event.c.
︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - + - | int rid = 0; /* rid of the event artifact */ char *zUuid; /* UUID corresponding to rid */ const char *zEventId; /* Event identifier */ char *zETime; /* Time of the event */ char *zATime; /* Time the artifact was created */ int specRid; /* rid specified by aid= parameter */ int prevRid, nextRid; /* Previous or next edits of this event */ |
︙ | |||
111 112 113 114 115 116 117 | 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 139 | - - - + - - + - + - + | return; } zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); showDetail = atoi(PD("detail","0")); /* Extract the event content. */ |
︙ | |||
164 165 166 167 168 169 170 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - + - + - - - + + + - + - + | } if( showDetail && g.okHistory ){ int i; const char *zClr = 0; Blob comment; |
︙ | |||
257 258 259 260 261 262 263 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | - + - - - - + - - - + + - + - + | if( strcmp(zClr,"##")==0 ) zClr = PD("cclr",""); /* If editing an existing event, extract the key fields to use as ** a starting point for the edit. */ if( rid && (zBody==0 || zETime==0 || zComment==0 || zTags==0) ){ |
︙ |
Changes to src/finfo.c.
︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - + | " AND event.objid=mlink.mid" " ORDER BY event.mtime DESC /*sort*/", TAG_BRANCH, zFilename ); blob_zero(&title); blob_appendf(&title, "History of "); |
︙ |
Changes to src/http.c.
︙ | |||
265 266 267 268 269 270 271 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | - + | } z[j] = z[i]; } z[j] = 0; fossil_fatal("server sends error: %s", z); } if( g.fHttpTrace ){ |
︙ |
Changes to src/info.c.
︙ | |||
543 544 545 546 547 548 549 | 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | - - + - - - + - - + - + - + | }else{ style_header("Wiki Information"); rid = 0; } db_finalize(&q); showTags(rid, "wiki-*"); if( rid ){ |
︙ | |||
580 581 582 583 584 585 586 | 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | - + - - + - + - - - + | style_footer(); } /* ** Find an checkin based on query parameter zParam and parse its ** manifest. Return the number of errors. */ |
︙ | |||
637 638 639 640 641 642 643 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 | - - + + | ** Show all differences between two checkins. */ void vdiff_page(void){ int ridFrom, ridTo; int showDetail = atoi(PD("detail","0")); const char *zFrom = P("from"); const char *zTo = P("to"); |
︙ | |||
663 664 665 666 667 668 669 670 | 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 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 | + - - + + + - - + - + + - - + + + + - + - + - + - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - + + | @ name="to" value="%s(zTo?zTo:"")" /></td><td></td></tr> @ <tr><td>details:</td><td><input type="checkbox" name="detail" @ checked="checked" value="1" /></td></tr> @ <tr><td></td><td></td><td> @ <input type="submit" name="diff" value="diff" /></td></tr></table> @ </div></form> style_footer_cmdref("diff",0); return; } |
︙ | |||
1067 1068 1069 1070 1071 1072 1073 | 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 | - - + - + - - - - - - + + + + + + + + | ** Look for "ci" and "filename" query parameters. If found, try to ** use them to extract the record ID of an artifact for the file. */ int artifact_from_ci_and_filename(void){ const char *zFilename; const char *zCI; int cirid; |
︙ | |||
1192 1193 1194 1195 1196 1197 1198 | 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 | - - + - - + + - - - - - + + - + + - + - - + + - + - - + + | ** WEBPAGE: tinfo ** URL: /tinfo?name=ARTIFACTID ** ** Show the details of a ticket change control artifact. */ void tinfo_page(void){ int rid; |
︙ |
Changes to src/manifest.c.
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | + + + + + + + + + + + + + + + - - + - - - - - + | #include "manifest.h" #include <assert.h> #if INTERFACE /* ** Types of control files */ #define CFTYPE_ANY 0 #define CFTYPE_MANIFEST 1 #define CFTYPE_CLUSTER 2 #define CFTYPE_CONTROL 3 #define CFTYPE_WIKI 4 #define CFTYPE_TICKET 5 #define CFTYPE_ATTACHMENT 6 #define CFTYPE_EVENT 7 /* ** A single F-card within a manifest */ struct ManifestFile { char *zName; /* Name of a file */ char *zUuid; /* UUID of the file */ char *zPerm; /* File permissions */ char *zPrior; /* Prior name if the name was changed */ }; /* ** A parsed manifest or cluster. */ struct Manifest { Blob content; /* The original content blob */ int type; /* Type of artifact. One of CFTYPE_xxxxx */ int rid; /* The blob-id for this manifest */ char *zBaseline; /* Baseline manifest. The B card. */ Manifest *pBaseline; /* The actual baseline manifest */ char *zComment; /* Decoded comment. The C card. */ double rDate; /* Date and time from D card. 0.0 if no D card. */ char *zUser; /* Name of the user from the U card. */ char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */ char *zWiki; /* Text of the wiki page. W card. */ char *zWikiTitle; /* Name of the wiki page. L card. */ double rEventDate; /* Date of an event. E card. */ char *zEventId; /* UUID for an event. E card. */ char *zTicketUuid; /* UUID for a ticket. K card. */ char *zAttachName; /* Filename of an attachment. A card. */ char *zAttachSrc; /* UUID of document being attached. A card. */ char *zAttachTarget; /* Ticket or wiki that attachment applies to. A card */ int nFile; /* Number of F cards */ int nFileAlloc; /* Slots allocated in aFile[] */ |
︙ | |||
85 86 87 88 89 90 91 | 95 96 97 98 99 100 101 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 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 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 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - + - - + - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | }; #endif /* ** A cache of parsed manifests. This reduces the number of ** calls to manifest_parse() when doing a rebuild. */ |
︙ | |||
193 194 195 196 197 198 199 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 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 378 379 380 381 382 383 384 385 386 387 388 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 | - - + + - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - + + - - - - - - - - - - - - - - - - - - - + - - - + + + + + - - - - - + - - + + + + + + + + + + + + + + + + - - - + + - - - - + - - - - + + - - - + - - - - - + + - + - - + - + - - - - - - + - - + - + + + + + - - - + + + - - - - - - - + + + - - + | ** The file consists of zero or more cards, one card per line. ** (Except: the content of the W card can extend of multiple lines.) ** Each card is divided into tokens by a single space character. ** The first token is a single upper-case letter which is the card type. ** The card type determines the other parameters to the card. ** Cards must occur in lexicographical order. */ |
︙ | |||
424 425 426 427 428 429 430 | 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 | - - - - - - + + + + - - - - - + + - - + - - + - - + | /* ** K <uuid> ** ** A K-line gives the UUID for the ticket which this control file ** is amending. */ case 'K': { |
︙ | |||
488 489 490 491 492 493 494 | 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | - - + - - + - - - + - - + - - + - - - + + - - - + + - - - - - + - - - + - - + - + | ** P <uuid> ... ** ** Specify one or more other artifacts where are the parents of ** this artifact. The first parent is the primary parent. All ** others are parents by merge. */ case 'P': { |
︙ | |||
591 592 593 594 595 596 597 | 680 681 682 683 684 685 686 687 688 689 690 691 692 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 | - - + + - - + - + - - - - + + + + + + - - + - - - - - + + + + + - - - - - + - - - + + - - - - - - - + - + | ** U ?<login>? ** ** Identify the user who created this control file by their ** login. Only one U line is allowed. Prohibited in clusters. ** If the user name is omitted, take that to be "anonymous". */ case 'U': { |
︙ | |||
752 753 754 755 756 757 758 | 830 831 832 833 834 835 836 837 838 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 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 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 | - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if( p->nField>0 ) goto manifest_syntax_error; if( p->zTicketUuid ) goto manifest_syntax_error; if( p->zWikiTitle ) goto manifest_syntax_error; if( p->zTicketUuid ) goto manifest_syntax_error; p->type = CFTYPE_MANIFEST; } md5sum_init(); |
︙ | |||
816 817 818 819 820 821 822 | 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 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 | - - + + - + - + - + - - - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + - - + + + + - - - + + + + + + - + - + - + - + + + - - + + + - - - + - - - - - - - - + + + + + - - + - - + - - + + - - - + - - - + - - - - - - + + + + + + + - - - - - - + + + + - - + - - - - + + + + + + - - + - - - - - - - - + - - - + | /* ** Add a single entry to the mlink table. Also add the filename to ** the filename table if it is not there already. */ static void add_one_mlink( int mid, /* The record ID of the manifest */ |
︙ | |||
1112 1113 1114 1115 1116 1117 1118 | 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 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 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 | - + - + - + - - + + + + + + - + - - + + - + - + - + - - + + - + - - - - - + + + + + + + + + + + + + + + + + + + - + - + + + - - - + + + - + - - + + - + - + - - + + - - + + - - + + - + - + - + - + - + - - + + - - + + - + - + - + - + - + - - + + - + - + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - | ** Historical note: This routine original processed manifests only. ** Processing for other control artifacts was added later. The name ** of the routine, "manifest_crosslink", and the name of this source ** file, is a legacy of its original use. */ int manifest_crosslink(int rid, Blob *pContent){ int i; |
Changes to src/md5.c.
︙ | |||
39 40 41 42 43 44 45 46 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + + + - + + + | int isInit; uint32 buf[4]; uint32 bits[2]; unsigned char in[64]; }; typedef struct Context MD5Context; #if defined(__i386__) || defined(__x86_64__) || defined(_WIN32) # define byteReverse(A,B) #else /* * Convert an array of integers to little-endian. |
︙ | |||
312 313 314 315 316 317 318 319 320 321 322 323 324 325 | 318 319 320 321 322 323 324 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 | + + + + + + + + + + + + + + + + + + + + | /* ** Add the content of a blob to the incremental MD5 checksum. */ void md5sum_step_blob(Blob *p){ md5sum_step_text(blob_buffer(p), blob_size(p)); } /* ** For trouble-shooting only: ** ** Report the current state of the incremental checksum. */ const char *md5sum_current_state(void){ unsigned int cksum = 0; unsigned int *pFirst, *pLast; static char zResult[12]; pFirst = (unsigned int*)&incrCtx; pLast = (unsigned int*)((&incrCtx)+1); while( pFirst<pLast ){ cksum += *pFirst; pFirst++; } sqlite3_snprintf(sizeof(zResult), zResult, "%08x", cksum); return zResult; } /* ** Finish the incremental MD5 checksum. Store the result in blob pOut ** if pOut!=0. Also return a pointer to the result. ** ** This resets the incremental checksum preparing for the next round ** of computation. The return pointer points to a static buffer that |
︙ |
Changes to src/rebuild.c.
︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | + + + + + + + + + + + + + + + - + - | static int totalSize; /* Total number of artifacts to process */ static int processCnt; /* Number processed so far */ static int ttyOutput; /* Do progress output */ static Bag bagDone; /* Bag of records rebuilt */ static char *zFNameFormat; /* Format string for filenames on deconstruct */ static int prefixLength; /* Length of directory prefix for deconstruct */ /* ** Draw the percent-complete message. ** The input is actually the permill complete. */ static void percent_complete(int permill){ static int lastOutput = -1; if( permill>lastOutput ){ printf(" %d.%d%% complete...\r", permill/10, permill%10); fflush(stdout); lastOutput = permill; } } /* ** Called after each artifact is processed */ static void rebuild_step_done(rid){ /* assert( bag_find(&bagDone, rid)==0 ); */ bag_insert(&bagDone, rid); if( ttyOutput ){ processCnt++; if (!g.fQuiet) { |
︙ | |||
165 166 167 168 169 170 171 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - + - + + - + - + | } blob_reset(pUse); rebuild_step_done(rid); /* Call all children recursively */ rid = 0; for(cid=bag_first(&children), i=1; cid; cid=bag_next(&children, cid), i++){ |
︙ | |||
230 231 232 233 234 235 236 237 238 239 240 241 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | + - + - | ** ability of fossil to accept records in any order and still ** construct a sane repository. */ int rebuild_db(int randomize, int doOut){ Stmt s; int errCnt = 0; char *zTable; int incrSize; bag_init(&bagDone); ttyOutput = doOut; processCnt = 0; if (!g.fQuiet) { |
︙ | |||
268 269 270 271 272 273 274 275 276 277 278 279 280 281 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | + + | "DELETE FROM unclustered" " WHERE rid IN (SELECT rid FROM shun JOIN blob USING(uuid))" ); db_multi_exec( "DELETE FROM config WHERE name IN ('remote-code', 'remote-maxid')" ); totalSize = db_int(0, "SELECT count(*) FROM blob"); incrSize = totalSize/100; totalSize += incrSize*2; db_prepare(&s, "SELECT rid, size FROM blob /*scan*/" " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)" " AND NOT EXISTS(SELECT 1 FROM delta WHERE rid=blob.rid)" ); manifest_crosslink_begin(); while( db_step(&s)==SQLITE_ROW ){ |
︙ | |||
305 306 307 308 309 310 311 312 313 314 315 316 317 318 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | + + + + + + + + + | db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid); rebuild_step_done(rid); } } db_finalize(&s); manifest_crosslink_end(); rebuild_tag_trunk(); if (!g.fQuiet) { processCnt += incrSize; percent_complete((processCnt*1000)/totalSize); } create_cluster(); if (!g.fQuiet) { processCnt += incrSize; percent_complete((processCnt*1000)/totalSize); } if(!g.fQuiet && ttyOutput ){ printf("\n"); } return errCnt; } /* |
︙ | |||
369 370 371 372 373 374 375 376 377 378 379 380 381 382 | 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 | + + + + + + + + + + + + + + + + + + + + + + | "UPDATE config SET value=lower(hex(randomblob(20)))" " WHERE name='project-code';" "UPDATE config SET value='detached-' || value" " WHERE name='project-name' AND value NOT GLOB 'detached-*';" ); db_end_transaction(0); } /* ** COMMAND: test-create-clusters ** ** Create clusters for all unclustered artifacts if the number of unclustered ** artifacts exceeds the current clustering threshold. */ void test_createcluster_cmd(void){ if( g.argc==3 ){ db_open_repository(g.argv[2]); }else{ db_find_and_open_repository(1); if( g.argc!=2 ){ usage("?REPOSITORY-FILENAME?"); } db_close(); db_open_repository(g.zRepositoryName); } db_begin_transaction(); create_cluster(); db_end_transaction(0); } /* ** COMMAND: scrub ** %fossil scrub [--verily] [--force] [REPOSITORY] ** ** The command removes sensitive information (such as passwords) from a ** repository so that the respository can be sent to an untrusted reader. |
︙ |
Changes to src/schema.c.
︙ | |||
239 240 241 242 243 244 245 246 247 248 249 250 251 252 | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | + + + + + + + + + + | @ @ -- A record of phantoms. A phantom is a record for which we know the @ -- UUID but we do not (yet) know the file content. @ -- @ CREATE TABLE phantom( @ rid INTEGER PRIMARY KEY -- Record ID of the phantom @ ); @ @ -- A record of orphaned delta-manifests. An orphan is a delta-manifest @ -- for which we have content, but its baseline-manifest is a phantom. @ -- We have to track all orphan maniftests so that when the baseline arrives, @ -- we know to process the orphaned deltas. @ CREATE TABLE orphan( @ rid INTEGER PRIMARY KEY, -- Delta manifest with a phantom baseline @ baseline INTEGER -- Phantom baseline of this orphan @ ); @ CREATE INDEX orphan_baseline ON orphan(baseline); @ @ -- Unclustered records. An unclustered record is a record (including @ -- a cluster records themselves) that is not mentioned by some other @ -- cluster. @ -- @ -- Phantoms are usually included in the unclustered table. A new cluster @ -- will never be created that contains a phantom. But another repository |
︙ |
Changes to src/sha1.c.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 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 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | - + - - - - - - - - - - - - - - - - + + + + + - - - + + + + - - + - - - + - - - + - - - - - - - - + + + + - - - - - - - - - + + - - - + + + + + - - - - - - - - + - - - + - - - + - - - - + - - - - + - - - - - - - - + - - - - + + - - - - - - - - - + - - - - - - + - - - + - - - + - + + + + + + + - - - + + - - - - - - + - - - - - - - - + + + + + - - + - - - + + + - - - - + - - + - - + - - - - + + - - - - + + + - - - + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + + - - - - + + + - - - - + + + + - - + + - - + + - - - - - + + + + + + + + + - - - - + + + + - - - + - - - + - - - - - + - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + - - - - - + - - - - - - - - - - - + + + + + + + - - + - - - - - - - + + - - + - - - - - - + - - + - - + + + + - - + - - - + - - - - - - + - - - - - + + - - - - - - - - - + + + + + + - - - - - + + + + - - - - + - - - - - - - - - - + - - - - - - - - + - - - - - + + - - - - - - + + + + + - - - - - - - - + + + - - - - + - - - - - + + - - - - + + + - - + - - - - + + - - - + - - - - - + - | /* |
︙ | |||
439 440 441 442 443 444 445 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | - + - + | static int incrInit = 0; /* ** Add more text to the incremental SHA1 checksum. */ void sha1sum_step_text(const char *zText, int nBytes){ if( !incrInit ){ |
︙ | |||
468 469 470 471 472 473 474 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | - + | ** of computation. The return pointer points to a static buffer that ** is overwritten by subsequent calls to this function. */ char *sha1sum_finish(Blob *pOut){ unsigned char zResult[20]; static char zOut[41]; sha1sum_step_text(0,0); |
︙ | |||
495 496 497 498 499 500 501 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 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 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | - + - + - + - - + + - + - - - + + + | unsigned char zResult[20]; char zBuf[10240]; in = fopen(zFilename,"rb"); if( in==0 ){ return 1; } |
︙ | |||
573 574 575 576 577 578 579 | 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 | - + - - - - - - + + + + + + | */ char *sha1_shared_secret(const char *zPw, const char *zLogin){ static char *zProjectId = 0; SHA1Context ctx; unsigned char zResult[20]; char zDigest[41]; |
︙ |
Changes to src/sync.c.
︙ | |||
163 164 165 166 167 168 169 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | + + + - + | ** is used. ** ** The URL specified normally becomes the new "remote-url" used for ** subsequent <a>push</a>, <a>pull</a>, and <a>sync</a> operations. However, ** the "--once" command-line option makes the URL a one-time-use URL ** that is not saved. ** ** If configured (<a>setting</a> push-hook-..), the push hook command will be ** executed on the server after pushing files. ** |
︙ | |||
194 195 196 197 198 199 200 | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | + + + - + | ** command is used. ** ** The URL specified normally becomes the new "remote-url" used for ** subsequent <a>push</a>, <a>pull</a>, and <a>sync</a> operations. However, ** the "--once" command-line option makes the URL a one-time-use URL ** that is not saved. ** ** If configured (<a>setting</a> push-hook-..), the push hook command will be ** executed on the server after pushing files. ** |
︙ |
Changes to src/tkt.c.
︙ | |||
212 213 214 215 216 217 218 | 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 | - + - - - - - - + + + + + + | /* ** Rebuild an entire entry in the TICKET table */ void ticket_rebuild_entry(const char *zTktUuid){ char *zTag = mprintf("tkt-%s", zTktUuid); int tagid = tag_findid(zTag, 1); Stmt q; |
︙ | |||
751 752 753 754 755 756 757 | 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | - - + | " FROM attachment, blob" " WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)" " AND blob.rid=attachid" " ORDER BY 1 DESC", tagid, tagid ); while( db_step(&q)==SQLITE_ROW ){ |
︙ | |||
775 776 777 778 779 780 781 | 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 | - - + + - + - + - + | @ <p>Add attachment "%h(zFile)" } @ [<a href="%s(g.zTop)/artifact/%T(zChngUuid)">%s(zShort)</a>] @ (rid %d(rid)) by hyperlink_to_user(zUser,zDate," on"); hyperlink_to_date(zDate, ".</p>"); }else{ |
︙ |
Changes to src/update.c.
︙ | |||
277 278 279 280 281 282 283 284 285 286 287 288 289 290 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | + | */ if( nochangeFlag ){ db_end_transaction(1); /* With --nochange, rollback changes */ }else{ if( g.argc<=3 ){ /* All files updated. Shift the current checkout to the target. */ db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid); checkout_set_all_exe(vid); manifest_to_disk(tid); db_lset_int("checkout", tid); }else{ /* A subset of files have been checked out. Keep the current ** checkout unchanged. */ db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid); } |
︙ | |||
300 301 302 303 304 305 306 | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - - - + + + - + - - - - - + + + + + + - + | */ int historical_version_of_file( const char *revision, /* The checkin containing the file */ const char *file, /* Full treename of the file */ Blob *content, /* Put the content here */ int errCode /* Error code if file not found. Panic if 0. */ ){ |
︙ | |||
384 385 386 387 388 389 390 391 392 393 | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | + - + | blob_reset(&fname); } }else{ int vid; vid = db_lget_int("checkout", 0); vfile_check_signature(vid, 0); db_multi_exec( "DELETE FROM vmerge;" "INSERT INTO torevert " "SELECT pathname" " FROM vfile " |
︙ |
Changes to src/vfile.c.
︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - + - - - - - - + - + + - + - + + - + - - - - + - - - - - - - - - - - - + + - - - - - - + + + + + - - - + | fossil_panic("bad object id: %d", rid); } } } } /* |
︙ | |||
367 368 369 370 371 372 373 374 375 376 377 378 379 380 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | + | md5sum_step_text(" 0\n", -1); continue; } fseek(in, 0L, SEEK_END); sprintf(zBuf, " %ld\n", ftell(in)); fseek(in, 0L, SEEK_SET); md5sum_step_text(zBuf, -1); /*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/ for(;;){ int n; n = fread(zBuf, 1, sizeof(zBuf), in); if( n<=0 ) break; md5sum_step_text(zBuf, n); } fclose(in); |
︙ | |||
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | 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 | + - - - + + + + - - + + - - - + + + + - - + + - + | while( db_step(&q)==SQLITE_ROW ){ const char *zName = db_column_text(&q, 0); int rid = db_column_int(&q, 1); md5sum_step_text(zName, -1); content_get(rid, &file); sprintf(zBuf, " %d\n", blob_size(&file)); md5sum_step_text(zBuf, -1); /*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/ md5sum_step_blob(&file); blob_reset(&file); } db_finalize(&q); md5sum_finish(pOut); } /* ** Compute an aggregate MD5 checksum over the repository image of every ** file in manifest vid. The file names are part of the checksum. ** Return the resulting checksum in blob pOut. ** ** If pManOut is not NULL then fill it with the checksum found in the ** "R" card near the end of the manifest. */ void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
︙ |
Changes to src/wiki.c.
︙ | |||
125 126 127 128 129 130 131 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - + | ** URL: /wiki?name=PAGENAME */ void wiki_page(void){ char *zTag; int rid = 0; int isSandbox; Blob wiki; |
︙ | |||
177 178 179 180 181 182 183 | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | - - - - - + - - - - + + + - | zTag = mprintf("wiki-%s", zPageName); rid = db_int(0, "SELECT rid FROM tagxref" " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" " ORDER BY mtime DESC", zTag ); free(zTag); |
︙ | |||
247 248 249 250 251 252 253 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | - - + - - + | @ </li> } if( cnt ){ @ </ul> } db_finalize(&q); |
︙ | |||
300 301 302 303 304 305 306 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | - - - - - + - - - + - | " ORDER BY mtime DESC", zTag ); free(zTag); if( (rid && !g.okWrWiki) || (!rid && !g.okNewWiki) ){ login_needed(); return; } |
︙ | |||
379 380 381 382 383 384 385 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | - - + - | @ <textarea name="w" class="wikiedit" cols="80" @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea> @ <br /> @ <input type="submit" name="preview" value="Preview Your Changes" /> @ <input type="submit" name="submit" value="Apply These Changes" /> @ <input type="submit" name="cancel" value="Cancel" /> @ </div></form> |
︙ | |||
479 480 481 482 483 484 485 | 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 | - - + - + - - - + + + - | return; } if( P("submit")!=0 && P("r")!=0 && P("u")!=0 ){ char *zDate; Blob cksum; int nrid; Blob body; |
︙ | |||
614 615 616 617 618 619 620 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | - - + | ** ** Show the difference between two wiki pages. */ void wdiff_page(void){ char *zTitle; int rid1, rid2; const char *zPageName; |
︙ | |||
637 638 639 640 641 642 643 | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | - + - - - + + - + - - - - + - + + | "SELECT objid FROM event JOIN tagxref ON objid=rid AND tagxref.tagid=" "(SELECT tagid FROM tag WHERE tagname='wiki-%q')" " WHERE event.mtime<(SELECT mtime FROM event WHERE objid=%d)" " ORDER BY event.mtime DESC LIMIT 1", zPageName, rid1 ); } |
︙ | |||
919 920 921 922 923 924 925 | 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 | - - - - + + + + + - - - + - - - + - | if( n==0 ){ goto wiki_cmd_usage; } if( strncmp(g.argv[2],"export",n)==0 ){ char const *zPageName; /* Name of the wiki page to export */ char const *zFile; /* Name of the output file (0=stdout) */ |
︙ | |||
960 961 962 963 964 965 966 | 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | - + + | } if( ! zF ){ fossil_fatal("wiki export could not open output file for writing."); } fprintf(zF,"%.*s\n", i, zBody); if( doClose ) fclose(zF); }else{ |
︙ |
Changes to src/xfer.c.
︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 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 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | int nDeltaSent; /* Number of deltas sent */ int nFileRcvd; /* Number of files received */ int nDeltaRcvd; /* Number of deltas received */ int nDanglingFile; /* Number of dangling deltas received */ int mxSend; /* Stop sending "file" with pOut reaches this size */ }; /* ** COMMAND: callhook ** %fossil callhook PUSHHOOKPATTERN ?--force|-f? ** ** Call the push hook command on a server, which will normally be called ** after a client push (<a>setting</a> push-hook-cmd). ** ** If --force is used, the given pattern is not checked against the ** configuration (<a>setting</a> push-hook-pattern-server). ** ** This command only works on the server side, it does not send a message ** from a client, but executes the hook directly on the server. ** ** See also <a>push</a>, <a>sync</a>, <a>setting</a> */ void callhook_cmd(void){ int forceFlag = find_option("force","f",0)!=0; db_open_config(1); db_find_and_open_repository(0); if( (g.argc!=3) || (!g.argv[2]) || (!g.argv[2][0]) ){ usage("PUSHHOOKPATTERN ?--force?"); } if( !forceFlag ){ const char *zPushHookPattern = db_get("push-hook-pattern-server", ""); int lenPushHookPattern = (zPushHookPattern && zPushHookPattern[0]) ? strlen(zPushHookPattern) : 0; if( (!lenPushHookPattern) || memcmp(g.argv[2], zPushHookPattern, lenPushHookPattern) ){ fossil_fatal("push hook pattern '%s' doesn't match configuration '%s'\n", g.argv[2],zPushHookPattern); } } post_push_hook(g.argv[2],'C'); } /* ** Let a server-side external agent know that a push has completed. /fatman ** The second argument controls, how the command is called: ** P - client request with pushed files ** F - client request without pushed files(FORCE!) ** C - server side command line activation */ void post_push_hook(char const * const zPushHookLine, const char requestType){ /* ** TO DO: get the string cmd from a config file? Or the database local ** settings, as someone suggested? Ditto output and error logs. /fatman */ const char *zCmd = db_get("push-hook-cmd", ""); int allowForced = db_get_boolean("push-hook-force", 0); const char *zHookPriv = db_get("push-hook-privilege",""); int privOk = 0; if( zHookPriv && *zHookPriv ){ switch( *zHookPriv ){ case 's': if( g.okSetup ) privOk = 1; break; case 'a': if( g.okAdmin ) privOk = 1; break; case 'i': if( g.okWrite ) privOk = 1; break; case 'o': if( g.okRead ) privOk = 1; break; default: fossil_print("Push hook wrong privilege type '%s'\n", zHookPriv); } }else{ privOk = 1; } if( !privOk ){ fossil_print("No privilege to activate hook!\n"); }else if( requestType!='P' && requestType!='C' && requestType!='F' ){ fossil_print("Push hook wrong request type '%c'\n", requestType); }else if( requestType=='F' && !allowForced ){ fossil_print("Forced push call from client not allowed," " skipping call for '%s'\n", zPushHookLine); }else if( zCmd && zCmd[0] ){ int rc; char * zCalledCmd; char * zDate; const char *zRnd; zDate = db_text(0, "SELECT strftime('%%Y%%m%%d%%H%%M%%f','now')"); zRnd = db_text(0, "SELECT lower(hex(randomblob(6)))"); zCalledCmd = mprintf("%s %s-%s %s >hook-log-%s-%s 2>&1",zCmd,zDate,zRnd,zPushHookLine,zDate,zRnd); { /* remove newlines from command */ char *zSrc, *zDest; for (zSrc=zDest=zCalledCmd;;zSrc++){ switch( *zSrc ){ case '\0': *zDest=0; break; default: *zDest++ = *zSrc; /* fall through is intended! */ case '\n': continue; } break; } } rc = system(zCalledCmd); if (rc != 0) { fossil_print("The post-push-hook command '%s' failed.", zCalledCmd); } free(zCalledCmd); free(zDate); }else{ fossil_print("No push hook configured, skipping call for '%s'\n", zPushHookLine); } } /* ** The input blob contains a UUID. Convert it into a record ID. ** Create a phantom record if no prior record exists and ** phantomize is true. ** ** Compare to uuid_to_rid(). This routine takes a blob argument |
︙ | |||
70 71 72 73 74 75 76 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | + + - + + + + + | } /* ** Remember that the other side of the connection already has a copy ** of the file rid. */ static void remote_has(int rid){ if( rid ){ static Stmt q; |
︙ | |||
93 94 95 96 97 98 99 | 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 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | - + - + + + + + + + + + + + + + + | ** ** If any error occurs, write a message into pErr which has already ** be initialized to an empty string. ** ** Any artifact successfully received by this routine is considered to ** be public and is therefore removed from the "private" table. */ |
︙ | |||
465 466 467 468 469 470 471 | 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | - + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + | /* ** Check to see if the number of unclustered entries is greater than ** 100 and if it is, form a new cluster. Unclustered phantoms do not ** count toward the 100 total. And phantoms are never added to a new ** cluster. */ |
︙ | |||
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | 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 | + + + - + - - - + + + + + + + + + + + - + | Xfer xfer; int deltaFlag = 0; int isClone = 0; int nGimme = 0; int size; int recvConfig = 0; char *zNow; const char *zPushHookPattern = db_get("push-hook-pattern-server", ""); int lenPushHookPattern = (zPushHookPattern && zPushHookPattern[0]) ? strlen(zPushHookPattern) : 0; if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ fossil_redirect_home(); } memset(&xfer, 0, sizeof(xfer)); blobarray_zero(xfer.aToken, count(xfer.aToken)); cgi_set_content_type(g.zContentType); blob_zero(&xfer.err); xfer.pIn = &g.cgiIn; xfer.pOut = cgi_output_blob(); |
︙ | |||
716 717 718 719 720 721 722 | 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | - + + + + + + + + + + + + + + + + - - - + + + + | } }else{ isPush = 1; } } }else |
︙ | |||
872 873 874 875 876 877 878 879 880 881 882 883 884 885 | 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 | + + + + + + + + | create_cluster(); send_unclustered(&xfer); } if( recvConfig ){ configure_finalize_receive(); } manifest_crosslink_end(); /* Send the server timestamp last, in case prior processing happened ** to use up a significant fraction of our time window. */ zNow = db_text(0, "SELECT strftime('%%Y-%%m-%%dT%%H:%%M:%%S', 'now')"); @ # timestamp %s(zNow) free(zNow); db_end_transaction(0); } /* ** COMMAND: test-xfer ** ** This command is used for debugging the server. There is a single |
︙ | |||
941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 | 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 | + + + + + + + | int size; /* Size of a config value */ int nFileSend = 0; int origConfigRcvMask; /* Original value of configRcvMask */ int nFileRecv; /* Number of files received */ int mxPhantomReq = 200; /* Max number of phantoms to request per comm */ const char *zCookie; /* Server cookie */ int nSent, nRcvd; /* Bytes sent and received (after compression) */ int cloneSeqno = 1; /* Sequence number for clones */ Blob send; /* Text we are sending to the server */ Blob recv; /* Reply we got back from the server */ Xfer xfer; /* Transfer data */ int pctDone; /* Percentage done with a message */ int lastPctDone = -1; /* Last displayed pctDone */ double rArrivalTime; /* Time at which a message arrived */ const char *zSCode = db_get("server-code", "x"); const char *zPCode = db_get("project-code", 0); const char *zPushHookPattern = db_get("push-hook-pattern-client", ""); int allowForced = db_get_boolean("push-hook-force", 0); if( db_get_boolean("dont-push", 0) ) pushFlag = 0; if( pushFlag + pullFlag + cloneFlag == 0 && configRcvMask==0 && configSendMask==0 ) return; transport_stats(0, 0, 1); socket_global_init(); |
︙ | |||
975 976 977 978 979 980 981 | 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 | - + + | blob_zero(&xfer.line); origConfigRcvMask = 0; /* ** Always begin with a clone, pull, or push message */ if( cloneFlag ){ |
︙ | |||
1007 1008 1009 1010 1011 1012 1013 | 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | - + | if( zCookie ){ blob_appendf(&send, "cookie %s\n", zCookie); } /* Generate gimme cards for phantoms and leaf cards ** for all leaves. */ |
︙ | |||
1056 1057 1058 1059 1060 1061 1062 | 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 | - + + + + + + + + + + - - + + + + - - + + + + - + | */ zRandomness = db_text(0, "SELECT hex(randomblob(20))"); blob_appendf(&send, "# %s\n", zRandomness); free(zRandomness); /* Exchange messages with the server */ nFileSend = xfer.nFileSent + xfer.nDeltaSent; |
︙ | |||
1175 1176 1177 1178 1179 1180 1181 | 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 | - + | if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){ fossil_fatal("server loop"); } if( zPCode==0 ){ zPCode = mprintf("%b", &xfer.aToken[2]); db_set("project-code", zPCode, 0); } |
︙ | |||
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 | 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 | + + + + + + + + + + + | ** ** Each cookie received overwrites the prior cookie from the ** same server. */ if( blob_eq(&xfer.aToken[0], "cookie") && xfer.nToken==2 ){ db_set("cookie", blob_str(&xfer.aToken[1]), 0); }else /* clone_seqno N ** ** When doing a clone, the server tries to send all of its artifacts ** in sequence. This card indicates the sequence number of the next ** blob that needs to be sent. If N<=0 that indicates that all blobs ** have been sent. */ if( blob_eq(&xfer.aToken[0], "clone_seqno") && xfer.nToken==2 ){ blob_is_int(&xfer.aToken[1], &cloneSeqno); }else /* message MESSAGE ** ** Print a message. Similar to "error" but does not stop processing. ** ** If the "login failed" message is seen, clear the sync password prior ** to the next cycle. |
︙ | |||
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 | 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 | + + + + + + + + + + + + + + + + + | ** there are still phantoms, then go another round. */ nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile; if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){ go = 1; mxPhantomReq = nFileRecv*2; if( mxPhantomReq<200 ) mxPhantomReq = 200; }else if( cloneFlag && nFileRecv>0 ){ go = 1; } nCardRcvd = 0; xfer.nFileRcvd = 0; xfer.nDeltaRcvd = 0; xfer.nDanglingFile = 0; /* If we have one or more files queued to send, then go ** another round */ if( xfer.nFileSent+xfer.nDeltaSent>0 ){ go = 1; } /* If this is a clone, the go at least two rounds */ if( cloneFlag && nCycle==1 ) go = 1; /* Stop the cycle if the server sends a "clone_seqno 0" card */ if( cloneSeqno<=0 ) go = 0; }; if( pushFlag && ( (nFileSend > 0) || allowForced ) ){ if( zPushHookPattern && zPushHookPattern[0] ){ blob_appendf(&send, "#%s%s\n", ((nFileSend > 0)?"P":"F"), zPushHookPattern); fossil_print("Triggering push hook %s '%s'\n",((nFileSend > 0)?"P":"F"),zPushHookPattern); http_exchange(&send, &recv, cloneFlag==0 || nCycle>0); blob_reset(&send); nCardSent++; } int allowForced = db_get_boolean("push-hook-force", 0); } transport_stats(&nSent, &nRcvd, 1); fossil_print("Total network traffic: %d bytes sent, %d bytes received\n", nSent, nRcvd); transport_close(); transport_global_shutdown(); db_multi_exec("DROP TABLE onremote"); manifest_crosslink_end(); content_enable_dephantomize(1); db_end_transaction(0); } |
Changes to src/zip.c.
︙ | |||
311 312 313 314 315 316 317 | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 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 378 379 | - - - + + + - - + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - + | ** added to as part of the zip file. It may be 0 or an empty string, ** in which case it is ignored. The intention is to create a zip which ** politely expands into a subdir instead of filling your current dir ** with source files. For example, pass a UUID or "ProjectName". ** */ void zip_of_baseline(int rid, Blob *pZip, const char *zDir){ |
︙ |
Changes to win/Makefile.dmc.
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - + + | all: $(APPNAME) $(APPNAME) : translate$E mkindex$E headers fossil.res $(OBJ) $(OBJDIR)\link cd $(OBJDIR) $(DMDIR)\bin\link @link |
︙ |
Changes to www/fileformat.wiki.
︙ | |||
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | + + + + + + + + + | No card may be duplicated. The entire manifest may be PGP clear-signed, but otherwise it may contain no additional text or data beyond what is described here. Allowed cards in the manifest are as follows: <blockquote> <b>B</b> <i>baseline-manifest</i><br> <b>C</b> <i>checkin-comment</i><br> <b>D</b> <i>time-and-date-stamp</i><br> <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br> <b>P</b> <i>SHA1-hash</i>+<br> <b>R</b> <i>repository-checksum</i><br> <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br> <b>U</b> <i>user-login</i><br> <b>Z</b> <i>manifest-checksum</i> </blockquote> A manifest may optionally have a single B-card. The B-card specifies another manifest that serves as the "baseline" for this manifest. A manifest that has a B-card is called a delta-manifest and a manifest that omits the B-card is a baseline-manifest. The other manifest identified by the argument of the B-card must be a baseline-manifest. A baseline-manifest records the complete contents of a checkin. A delta-manifest records only changes from its baseline. A manifest must have exactly one C-card. The sole argument to the C-card is a check-in comment that describes the check-in that the manifest defines. The check-in comment is text. The following escape sequences are applied to the text: A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73). A newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E). A backslash |
︙ | |||
123 124 125 126 127 128 129 | 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 | - + - - + + + + - + - + + | date and time should be in coordinated universal time (UTC). The format is: <blockquote> <i>YYYY</i><b>-</b><i>MM</i><b>-</b><i>DD</i><b>T</b><i>HH</i><b>:</b><i>MM</i><b>:</b><i>SS</i> </blockquote> |
︙ | |||
502 503 504 505 506 507 508 509 510 511 512 513 514 515 | 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | + + + + + + + + + + | <td> </td> <td> </td> <td> </td> <td> </td> <td align=center><b>X</b></td> <td> </td> </tr> <tr> <td><b>B</b> <i>baseline</i></td> <td align=center><b>X</b></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><b>C</b> <i>comment-text</i></td> <td align=center><b>X</b></td> <td> </td> <td> </td> <td> </td> <td> </td> |
︙ |