Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch branch-1.19 Excluding Merge-Ins
This is equivalent to a diff from 6517b5c857 to 285eeba64f
|
2012-11-17
| ||
| 19:22 | Prevent delta loops on sync operations that might otherwise occur if a sequence of file changes ends with a file back to its original state after a sequence of two or more intermediate states. The is a backport/cherrypick of check-in [141b990722ea81e10e5] ... (Closed-Leaf check-in: 285eeba64f user: drh tags: branch-1.19) | |
|
2012-11-14
| ||
| 20:28 | Detect infinite loops in the DELTA table and abort out of content_get() when they are found. Fix an off-by-one error in the version-3 clone protocol. This error might cause an incomplete and corrupt clone if a transfer block fills up just before sending the very last blob. Backport of fixes from [2012-08-23 21:15:36] ... (check-in: 99053ab141 user: drh tags: branch-1.19) | |
|
2012-10-11
| ||
| 19:45 | Cherrypick changes [0c37874941c8972], [9ba8a393fcc569b], and [ae092ec605eed11] in order to backport the --setmtime option of "fossil update" and the --age and -t options of "fossil ls" to version 1.19. ... (check-in: 773c6c5f2c user: drh tags: branch-1.19) | |
|
2011-09-01
| ||
| 20:23 | Stop publishing x64 binaries for linux. x86 binaries are sufficient. ... (check-in: bd04a48925 user: drh tags: trunk) | |
| 18:25 | Version 1.19. ... (check-in: 6517b5c857 user: drh tags: trunk, release, version-1.19) | |
| 17:45 | Merging the unwanted two trunk leaves. ... (check-in: a22c381757 user: viriketo tags: trunk) | |
Changes to src/checkin.c.
| ︙ | |||
151 152 153 154 155 156 157 | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | - + |
int vid;
int useSha1sum = find_option("sha1sum", 0, 0)!=0;
int cwdRelative = 0;
db_must_be_within_tree();
cwdRelative = determine_cwd_relative_option();
blob_zero(&report);
vid = db_lget_int("checkout", 0);
|
| ︙ | |||
189 190 191 192 193 194 195 196 197 198 199 | 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 | + + + + + - + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + - + |
fossil_print("server-code: %s\n", db_get("server-code", ""));
vid = db_lget_int("checkout", 0);
if( vid ){
show_common_info(vid, "checkout:", 1, 1);
}
changes_cmd();
}
/*
** Implementation of the checkin_mtime SQL function
*/
/*
** COMMAND: ls
**
|
| ︙ |
Changes to src/checkout.c.
| ︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + |
** 2: There is no existing checkout
*/
int unsaved_changes(void){
int vid;
db_must_be_within_tree();
vid = db_lget_int("checkout",0);
if( vid==0 ) return 2;
|
| ︙ |
Changes to src/content.c.
| ︙ | |||
267 268 269 270 271 272 273 274 275 276 277 278 279 280 | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | + + + |
a[0] = rid;
a[1] = nextRid;
n = 1;
while( !bag_find(&contentCache.inCache, nextRid)
&& (nextRid = findSrcid(nextRid))>0 ){
n++;
if( n>=nAlloc ){
if( n>db_int(0, "SELECT max(rid) FROM blob") ){
fossil_panic("infinite loop in DELTA table");
}
nAlloc = nAlloc*2 + 10;
a = fossil_realloc(a, nAlloc*sizeof(a[0]));
}
a[n] = nextRid;
}
mx = n;
rc = content_get(a[n], pBlob);
|
| ︙ |
Changes to src/db.c.
| ︙ | |||
625 626 627 628 629 630 631 632 633 634 635 636 637 638 | 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 | + + + + + + + + + + + + + + + + |
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
sqlite3_result_int64(context, time(0));
}
/*
** Function to return the check-in time for a file.
*/
void db_checkin_mtime_function(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
i64 mtime;
int rc = mtime_of_manifest_file(sqlite3_value_int(argv[0]),
sqlite3_value_int(argv[1]), &mtime);
if( rc==0 ){
sqlite3_result_int64(context, mtime);
}
}
/*
** Open a database file. Return a pointer to the new database
** connection. An error results in process abort.
*/
static sqlite3 *openDatabase(const char *zDbName){
int rc;
|
| ︙ | |||
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 | + + - + |
);
if( rc!=SQLITE_OK ){
db_err(sqlite3_errmsg(db));
}
sqlite3_busy_timeout(db, 5000);
sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
sqlite3_create_function(db, "now", 0, SQLITE_ANY, 0, db_now_function, 0, 0);
sqlite3_create_function(db, "checkin_mtime", 2, SQLITE_ANY, 0,
db_checkin_mtime_function, 0, 0);
return db;
}
/*
** zDbName is the name of a database file. If no other database
** file is open, then open this one. If another database file is
** already open, then attach zDbName using the name zLabel.
*/
|
| ︙ |
Changes to src/descendants.c.
| ︙ | |||
154 155 156 157 158 159 160 | 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 | - + - + + | } } /* ** Load the record ID rid and up to N-1 closest ancestors into ** the "ok" table. */ |
| ︙ | |||
200 201 202 203 204 205 206 | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | + - + + |
** direct ancestor as the largest generation number.
*/
void compute_direct_ancestors(int rid, int N){
Stmt ins;
Stmt q;
int gen = 0;
db_multi_exec(
"CREATE TEMP TABLE IF NOT EXISTS ancestor(rid INTEGER,"
|
| ︙ | |||
222 223 224 225 226 227 228 229 230 231 232 233 234 235 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
db_bind_int(&ins, ":gen", gen);
db_step(&ins);
db_reset(&ins);
}
db_finalize(&ins);
db_finalize(&q);
}
/*
** Compute the "mtime" of the file given whose blob.rid is "fid" that
** is part of check-in "vid". The mtime will be the mtime on vid or
** some ancestor of vid where fid first appears.
*/
int mtime_of_manifest_file(
int vid, /* The check-in that contains fid */
int fid, /* The id of the file whose check-in time is sought */
i64 *pMTime /* Write result here */
){
static int prevVid = -1;
static Stmt q;
if( prevVid!=vid ){
prevVid = vid;
db_multi_exec("DROP TABLE IF EXISTS temp.ok;"
"CREATE TEMP TABLE ok(x INTEGER PRIMARY KEY);");
compute_ancestors(vid, 100000000, 1);
}
db_static_prepare(&q,
"SELECT (max(event.mtime)-2440587.5)*86400 FROM mlink, event"
" WHERE mlink.mid=event.objid"
" AND +mlink.mid IN ok"
" AND mlink.fid=:fid");
db_bind_int(&q, ":fid", fid);
if( db_step(&q)!=SQLITE_ROW ){
db_reset(&q);
return 1;
}
*pMTime = db_column_int64(&q, 0);
db_reset(&q);
return 0;
}
/*
** Load the record ID rid and up to N-1 closest descendants into
** the "ok" table.
*/
void compute_descendants(int rid, int N){
Bag seen;
|
| ︙ |
Changes to src/diffcmd.c.
| ︙ | |||
210 211 212 213 214 215 216 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - + |
Stmt q;
int ignoreEolWs; /* Ignore end-of-line whitespace */
int asNewFile; /* Treat non-existant files as empty files */
ignoreEolWs = (diffFlags & DIFF_NOEOLWS)!=0;
asNewFile = (diffFlags & DIFF_NEWFILE)!=0;
vid = db_lget_int("checkout", 0);
|
| ︙ |
Changes to src/file.c.
| ︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | + + + + + + | #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <string.h> #include <errno.h> #include "file.h" #ifdef _WIN32 # include <sys/utime.h> #else # include <sys/time.h> #endif /* ** The file status information from the most recent stat() call. ** ** Use _stati64 rather than stat on windows, in order to handle files ** larger than 2GB. */ #if defined(_WIN32) && defined(__MSVCRT__) |
| ︙ | |||
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
chmod(zFilename, buf.st_mode & ~0111);
rc = 1;
}
}
#endif /* _WIN32 */
return rc;
}
/*
** Set the mtime for a file.
*/
void file_set_mtime(const char *zFilename, i64 newMTime){
#if !defined(_WIN32)
struct timeval tv[2];
memset(tv, 0, sizeof(tv[0])*2);
tv[0].tv_sec = newMTime;
tv[1].tv_sec = newMTime;
utimes(zFilename, tv);
#else
struct utimbuf tb;
char *zMbcs = fossil_utf8_to_mbcs(zFilename);
tb.actime = newMTime;
tb.modtime = newMTime;
_utime(zMbcs, &tb);
fossil_mbcs_free(zMbcs);
#endif
}
/*
** COMMAND: test-set-mtime
**
** Usage: %fossil test-set-mtime FILENAME DATE/TIME
**
** Sets the mtime of the named file to the date/time shown.
*/
void test_set_mtime(void){
const char *zFile;
char *zDate;
i64 iMTime;
if( g.argc!=4 ){
usage("test-set-mtime FILENAME DATE/TIME");
}
db_open_or_attach(":memory:", "mem");
iMTime = db_int64(0, "SELECT strftime('%%s',%Q)", g.argv[3]);
zFile = g.argv[2];
file_set_mtime(zFile, iMTime);
iMTime = file_mtime(zFile);
zDate = db_text(0, "SELECT datetime(%lld, 'unixepoch')", iMTime);
fossil_print("Set mtime of \"%s\" to %s (%lld)\n", zFile, zDate, iMTime);
}
/*
** Delete a file.
*/
void file_delete(const char *zFilename){
char *z = fossil_utf8_to_mbcs(zFilename);
unlink(z);
|
| ︙ |
Changes to src/finfo.c.
| ︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + |
int vid;
if( g.argc!=3 ) usage("-s|--status FILENAME");
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_panic("no checkout to finfo files in");
}
|
| ︙ |
Changes to src/merge.c.
| ︙ | |||
141 142 143 144 145 146 147 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - + |
int t = pid;
pid = mid;
mid = t;
}
if( !is_a_version(pid) ){
fossil_fatal("not a version: record #%d", pid);
}
|
| ︙ |
Changes to src/stash.c.
| ︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | - + |
int vid; /* Current checkout */
zComment = find_option("comment", "m", 1);
verify_all_options();
stashid = db_lget_int("stash-next", 1);
db_lset_int("stash-next", stashid+1);
vid = db_lget_int("checkout", 0);
|
| ︙ |
Changes to src/timeline.c.
| ︙ | |||
984 985 986 987 988 989 990 | 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 | - + |
db_multi_exec("%s", blob_str(&sql));
blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s");
}
if( useDividers ) timeline_add_dividers(0, d_rid);
db_multi_exec("DELETE FROM ok");
}
if( p_rid ){
|
| ︙ | |||
1505 1506 1507 1508 1509 1510 1511 | 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 | - + |
);
if( mode==3 || mode==4 ){
db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
if( mode==3 ){
compute_descendants(objid, n);
}else{
|
| ︙ |
Changes to src/update.c.
| ︙ | |||
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 | 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 | + + |
int vid; /* Current version */
int tid=0; /* Target version - version we are changing to */
Stmt q;
int latestFlag; /* --latest. Pick the latest version if true */
int nochangeFlag; /* -n or --nochange. Do a dry run */
int verboseFlag; /* -v or --verbose. Output extra information */
int debugFlag; /* --debug option */
int setmtimeFlag; /* --setmtime. Set mtimes on files */
int nChng; /* Number of file renames */
int *aChng; /* Array of file renames */
int i; /* Loop counter */
int nConflict = 0; /* Number of merge conflicts */
Stmt mtimeXfer; /* Statment to transfer mtimes */
if( !internalUpdate ){
undo_capture_command_line();
url_proxy_options();
}
latestFlag = find_option("latest",0, 0)!=0;
nochangeFlag = find_option("nochange","n",0)!=0;
verboseFlag = find_option("verbose","v",0)!=0;
debugFlag = find_option("debug",0,0)!=0;
setmtimeFlag = find_option("setmtime",0,0)!=0;
db_must_be_within_tree();
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_fatal("cannot find current version");
}
if( !nochangeFlag && db_exists("SELECT 1 FROM vmerge") ){
fossil_fatal("cannot update an uncommitted merge");
|
| ︙ | |||
184 185 186 187 188 189 190 | 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 | - + + - - + + |
}
if( tid==0 ){
fossil_panic("Internal Error: unable to find a version to update to.");
}
db_begin_transaction();
|
| ︙ | |||
307 308 309 310 311 312 313 | 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 | - + + + + + + - + + + + - + + - + + | } /* ** Alter the content of the checkout so that it conforms with the ** target */ db_prepare(&q, |
| ︙ | |||
454 455 456 457 458 459 460 461 462 463 464 465 466 467 | 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | + |
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);
}
if( !internalUpdate ) undo_finish();
if( setmtimeFlag ) vfile_check_signature(tid, CKSIG_SETMTIME);
db_end_transaction(0);
}
}
/*
** Make sure empty directories are created
*/
|
| ︙ | |||
608 609 610 611 612 613 614 | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | - + |
file_tree_name(zFile, &fname, 1);
db_multi_exec("REPLACE INTO torevert VALUES(%B)", &fname);
blob_reset(&fname);
}
}else{
int vid;
vid = db_lget_int("checkout", 0);
|
| ︙ |
Changes to src/vfile.c.
| ︙ | |||
120 121 122 123 124 125 126 127 | 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 | + + - - - - - + + + + + + + + + + + + + + - - + + + + + - - - - - + + + + + + + + + + + + - + + - + + + - + + + + - + + - - + + - - - - + - + - - - - + + + + + + + + - - + + + + + + + + + + + - - - + + + + + + + + + - - + + + | } db_finalize(&ridq); db_finalize(&ins); manifest_destroy(p); db_end_transaction(0); } #if INTERFACE /* ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| ︙ |
Changes to src/xfer.c.
| ︙ | |||
266 267 268 269 270 271 272 | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | - + - - - - + + - - |
int isPrivate, /* True if rid is a private artifact */
Blob *pContent, /* The content of the file to send */
Blob *pUuid /* The UUID of the file to send */
){
static const char *azQuery[] = {
"SELECT pid FROM plink x"
" WHERE cid=%d"
|
| ︙ | |||
992 993 994 995 996 997 998 | 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 | - + |
if( iVers>=3 ){
send_compressed_file(&xfer, seqno);
}else{
send_file(&xfer, seqno, 0, 1);
}
seqno++;
}
|
| ︙ |
Added test/update-test-1.sh.
|
Added test/update-test-2.sh.
|