Fossil SCM
merged in trunk [3e141b792c].
Commit
033e2eb1dfabdf20d0eff6a84c011eb6a65ba2e4
Parent
b9ef0fe59b1262b…
10 files changed
+2
-2
+1
-1
+5
-4
+1
+1
+11
+23
+5
-4
+2
-2
+2
-2
+2
-2
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -228,11 +228,11 @@ | ||
| 228 | 228 | int isDir; |
| 229 | 229 | Blob fullName; |
| 230 | 230 | |
| 231 | 231 | file_canonical_name(g.argv[i], &fullName); |
| 232 | 232 | zName = blob_str(&fullName); |
| 233 | - isDir = file_isdir(zName); | |
| 233 | + isDir = file_wd_isdir(zName); | |
| 234 | 234 | if( isDir==1 ){ |
| 235 | 235 | vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore); |
| 236 | 236 | }else if( isDir==0 ){ |
| 237 | 237 | fossil_fatal("not found: %s", zName); |
| 238 | 238 | }else if( file_access(zName, R_OK) ){ |
| @@ -506,11 +506,11 @@ | ||
| 506 | 506 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 507 | 507 | ); |
| 508 | 508 | db_multi_exec( |
| 509 | 509 | "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);" |
| 510 | 510 | ); |
| 511 | - if( file_isdir(zDest)!=1 ){ | |
| 511 | + if( file_wd_isdir(zDest)!=1 ){ | |
| 512 | 512 | Blob orig; |
| 513 | 513 | if( g.argc!=4 ){ |
| 514 | 514 | usage("OLDNAME NEWNAME"); |
| 515 | 515 | } |
| 516 | 516 | file_tree_name(g.argv[2], &orig, 1); |
| 517 | 517 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | int isDir; |
| 229 | Blob fullName; |
| 230 | |
| 231 | file_canonical_name(g.argv[i], &fullName); |
| 232 | zName = blob_str(&fullName); |
| 233 | isDir = file_isdir(zName); |
| 234 | if( isDir==1 ){ |
| 235 | vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore); |
| 236 | }else if( isDir==0 ){ |
| 237 | fossil_fatal("not found: %s", zName); |
| 238 | }else if( file_access(zName, R_OK) ){ |
| @@ -506,11 +506,11 @@ | |
| 506 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 507 | ); |
| 508 | db_multi_exec( |
| 509 | "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);" |
| 510 | ); |
| 511 | if( file_isdir(zDest)!=1 ){ |
| 512 | Blob orig; |
| 513 | if( g.argc!=4 ){ |
| 514 | usage("OLDNAME NEWNAME"); |
| 515 | } |
| 516 | file_tree_name(g.argv[2], &orig, 1); |
| 517 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | int isDir; |
| 229 | Blob fullName; |
| 230 | |
| 231 | file_canonical_name(g.argv[i], &fullName); |
| 232 | zName = blob_str(&fullName); |
| 233 | isDir = file_wd_isdir(zName); |
| 234 | if( isDir==1 ){ |
| 235 | vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore); |
| 236 | }else if( isDir==0 ){ |
| 237 | fossil_fatal("not found: %s", zName); |
| 238 | }else if( file_access(zName, R_OK) ){ |
| @@ -506,11 +506,11 @@ | |
| 506 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 507 | ); |
| 508 | db_multi_exec( |
| 509 | "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);" |
| 510 | ); |
| 511 | if( file_wd_isdir(zDest)!=1 ){ |
| 512 | Blob orig; |
| 513 | if( g.argc!=4 ){ |
| 514 | usage("OLDNAME NEWNAME"); |
| 515 | } |
| 516 | file_tree_name(g.argv[2], &orig, 1); |
| 517 |
+1
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -394,11 +394,11 @@ | ||
| 394 | 394 | ** with the same name. |
| 395 | 395 | ** |
| 396 | 396 | ** Return the number of errors. |
| 397 | 397 | */ |
| 398 | 398 | int file_mkdir(const char *zName, int forceFlag){ |
| 399 | - int rc = file_isdir(zName); | |
| 399 | + int rc = file_wd_isdir(zName); | |
| 400 | 400 | if( rc==2 ){ |
| 401 | 401 | if( !forceFlag ) return 1; |
| 402 | 402 | file_delete(zName); |
| 403 | 403 | } |
| 404 | 404 | if( rc!=1 ){ |
| 405 | 405 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -394,11 +394,11 @@ | |
| 394 | ** with the same name. |
| 395 | ** |
| 396 | ** Return the number of errors. |
| 397 | */ |
| 398 | int file_mkdir(const char *zName, int forceFlag){ |
| 399 | int rc = file_isdir(zName); |
| 400 | if( rc==2 ){ |
| 401 | if( !forceFlag ) return 1; |
| 402 | file_delete(zName); |
| 403 | } |
| 404 | if( rc!=1 ){ |
| 405 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -394,11 +394,11 @@ | |
| 394 | ** with the same name. |
| 395 | ** |
| 396 | ** Return the number of errors. |
| 397 | */ |
| 398 | int file_mkdir(const char *zName, int forceFlag){ |
| 399 | int rc = file_wd_isdir(zName); |
| 400 | if( rc==2 ){ |
| 401 | if( !forceFlag ) return 1; |
| 402 | file_delete(zName); |
| 403 | } |
| 404 | if( rc!=1 ){ |
| 405 |
+5
-4
| --- src/gzip.c | ||
| +++ src/gzip.c | ||
| @@ -47,20 +47,21 @@ | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /* |
| 50 | 50 | ** Begin constructing a gzip file. |
| 51 | 51 | */ |
| 52 | -void gzip_begin(void){ | |
| 52 | +void gzip_begin(sqlite3_int64 now){ | |
| 53 | 53 | char aHdr[10]; |
| 54 | - sqlite3_int64 now; | |
| 55 | 54 | assert( gzip.eState==0 ); |
| 56 | 55 | blob_zero(&gzip.out); |
| 57 | 56 | aHdr[0] = 0x1f; |
| 58 | 57 | aHdr[1] = 0x8b; |
| 59 | 58 | aHdr[2] = 8; |
| 60 | 59 | aHdr[3] = 0; |
| 61 | - now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0"); | |
| 60 | + if( now==0 ){ | |
| 61 | + now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0"); | |
| 62 | + } | |
| 62 | 63 | put32(&aHdr[4], now&0xffffffff); |
| 63 | 64 | aHdr[8] = 2; |
| 64 | 65 | aHdr[9] = 255; |
| 65 | 66 | blob_append(&gzip.out, aHdr, 10); |
| 66 | 67 | gzip.iCRC = 0; |
| @@ -125,15 +126,15 @@ | ||
| 125 | 126 | void test_gzip_cmd(void){ |
| 126 | 127 | Blob b; |
| 127 | 128 | char *zOut; |
| 128 | 129 | if( g.argc!=3 ) usage("FILENAME"); |
| 129 | 130 | sqlite3_open(":memory:", &g.db); |
| 130 | - gzip_begin(); | |
| 131 | + gzip_begin(0); | |
| 131 | 132 | blob_read_from_file(&b, g.argv[2]); |
| 132 | 133 | zOut = mprintf("%s.gz", g.argv[2]); |
| 133 | 134 | gzip_step(blob_buffer(&b), blob_size(&b)); |
| 134 | 135 | blob_reset(&b); |
| 135 | 136 | gzip_finish(&b); |
| 136 | 137 | blob_write_to_file(&b, zOut); |
| 137 | 138 | blob_reset(&b); |
| 138 | 139 | fossil_free(zOut); |
| 139 | 140 | } |
| 140 | 141 |
| --- src/gzip.c | |
| +++ src/gzip.c | |
| @@ -47,20 +47,21 @@ | |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | ** Begin constructing a gzip file. |
| 51 | */ |
| 52 | void gzip_begin(void){ |
| 53 | char aHdr[10]; |
| 54 | sqlite3_int64 now; |
| 55 | assert( gzip.eState==0 ); |
| 56 | blob_zero(&gzip.out); |
| 57 | aHdr[0] = 0x1f; |
| 58 | aHdr[1] = 0x8b; |
| 59 | aHdr[2] = 8; |
| 60 | aHdr[3] = 0; |
| 61 | now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0"); |
| 62 | put32(&aHdr[4], now&0xffffffff); |
| 63 | aHdr[8] = 2; |
| 64 | aHdr[9] = 255; |
| 65 | blob_append(&gzip.out, aHdr, 10); |
| 66 | gzip.iCRC = 0; |
| @@ -125,15 +126,15 @@ | |
| 125 | void test_gzip_cmd(void){ |
| 126 | Blob b; |
| 127 | char *zOut; |
| 128 | if( g.argc!=3 ) usage("FILENAME"); |
| 129 | sqlite3_open(":memory:", &g.db); |
| 130 | gzip_begin(); |
| 131 | blob_read_from_file(&b, g.argv[2]); |
| 132 | zOut = mprintf("%s.gz", g.argv[2]); |
| 133 | gzip_step(blob_buffer(&b), blob_size(&b)); |
| 134 | blob_reset(&b); |
| 135 | gzip_finish(&b); |
| 136 | blob_write_to_file(&b, zOut); |
| 137 | blob_reset(&b); |
| 138 | fossil_free(zOut); |
| 139 | } |
| 140 |
| --- src/gzip.c | |
| +++ src/gzip.c | |
| @@ -47,20 +47,21 @@ | |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | ** Begin constructing a gzip file. |
| 51 | */ |
| 52 | void gzip_begin(sqlite3_int64 now){ |
| 53 | char aHdr[10]; |
| 54 | assert( gzip.eState==0 ); |
| 55 | blob_zero(&gzip.out); |
| 56 | aHdr[0] = 0x1f; |
| 57 | aHdr[1] = 0x8b; |
| 58 | aHdr[2] = 8; |
| 59 | aHdr[3] = 0; |
| 60 | if( now==0 ){ |
| 61 | now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0"); |
| 62 | } |
| 63 | put32(&aHdr[4], now&0xffffffff); |
| 64 | aHdr[8] = 2; |
| 65 | aHdr[9] = 255; |
| 66 | blob_append(&gzip.out, aHdr, 10); |
| 67 | gzip.iCRC = 0; |
| @@ -125,15 +126,15 @@ | |
| 126 | void test_gzip_cmd(void){ |
| 127 | Blob b; |
| 128 | char *zOut; |
| 129 | if( g.argc!=3 ) usage("FILENAME"); |
| 130 | sqlite3_open(":memory:", &g.db); |
| 131 | gzip_begin(0); |
| 132 | blob_read_from_file(&b, g.argv[2]); |
| 133 | zOut = mprintf("%s.gz", g.argv[2]); |
| 134 | gzip_step(blob_buffer(&b), blob_size(&b)); |
| 135 | blob_reset(&b); |
| 136 | gzip_finish(&b); |
| 137 | blob_write_to_file(&b, zOut); |
| 138 | blob_reset(&b); |
| 139 | fossil_free(zOut); |
| 140 | } |
| 141 |
+1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -153,10 +153,11 @@ | ||
| 153 | 153 | |
| 154 | 154 | /* For defense against Cross-site Request Forgery attacks */ |
| 155 | 155 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 156 | 156 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 157 | 157 | |
| 158 | + int parseCnt[10]; /* Counts of artifacts parsed */ | |
| 158 | 159 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 159 | 160 | int thTrace; /* True to enable TH1 debugging output */ |
| 160 | 161 | Blob thLog; /* Text of the TH1 debugging output */ |
| 161 | 162 | |
| 162 | 163 | int isHome; /* True if rendering the "home" page */ |
| 163 | 164 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -153,10 +153,11 @@ | |
| 153 | |
| 154 | /* For defense against Cross-site Request Forgery attacks */ |
| 155 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 156 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 157 | |
| 158 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 159 | int thTrace; /* True to enable TH1 debugging output */ |
| 160 | Blob thLog; /* Text of the TH1 debugging output */ |
| 161 | |
| 162 | int isHome; /* True if rendering the "home" page */ |
| 163 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -153,10 +153,11 @@ | |
| 153 | |
| 154 | /* For defense against Cross-site Request Forgery attacks */ |
| 155 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 156 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 157 | |
| 158 | int parseCnt[10]; /* Counts of artifacts parsed */ |
| 159 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 160 | int thTrace; /* True to enable TH1 debugging output */ |
| 161 | Blob thLog; /* Text of the TH1 debugging output */ |
| 162 | |
| 163 | int isHome; /* True if rendering the "home" page */ |
| 164 |
+1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -153,10 +153,11 @@ | ||
| 153 | 153 | |
| 154 | 154 | /* For defense against Cross-site Request Forgery attacks */ |
| 155 | 155 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 156 | 156 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 157 | 157 | |
| 158 | + int parseCnt[10]; /* Counts of artifacts parsed */ | |
| 158 | 159 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 159 | 160 | int thTrace; /* True to enable TH1 debugging output */ |
| 160 | 161 | Blob thLog; /* Text of the TH1 debugging output */ |
| 161 | 162 | |
| 162 | 163 | int isHome; /* True if rendering the "home" page */ |
| 163 | 164 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -153,10 +153,11 @@ | |
| 153 | |
| 154 | /* For defense against Cross-site Request Forgery attacks */ |
| 155 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 156 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 157 | |
| 158 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 159 | int thTrace; /* True to enable TH1 debugging output */ |
| 160 | Blob thLog; /* Text of the TH1 debugging output */ |
| 161 | |
| 162 | int isHome; /* True if rendering the "home" page */ |
| 163 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -153,10 +153,11 @@ | |
| 153 | |
| 154 | /* For defense against Cross-site Request Forgery attacks */ |
| 155 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 156 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 157 | |
| 158 | int parseCnt[10]; /* Counts of artifacts parsed */ |
| 159 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 160 | int thTrace; /* True to enable TH1 debugging output */ |
| 161 | Blob thLog; /* Text of the TH1 debugging output */ |
| 162 | |
| 163 | int isHome; /* True if rendering the "home" page */ |
| 164 |
+11
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -345,14 +345,24 @@ | ||
| 345 | 345 | char cType; |
| 346 | 346 | char *z; |
| 347 | 347 | int n; |
| 348 | 348 | char *zUuid; |
| 349 | 349 | int sz = 0; |
| 350 | + int isRepeat; | |
| 351 | + static Bag seen; | |
| 352 | + | |
| 353 | + if( bag_find(&seen, rid) ){ | |
| 354 | + isRepeat = 1; | |
| 355 | + }else{ | |
| 356 | + isRepeat = 0; | |
| 357 | + bag_insert(&seen, rid); | |
| 358 | + } | |
| 350 | 359 | |
| 351 | 360 | /* Every control artifact ends with a '\n' character. Exit early |
| 352 | 361 | ** if that is not the case for this artifact. |
| 353 | 362 | */ |
| 363 | + if( !isRepeat ) g.parseCnt[0]++; | |
| 354 | 364 | z = blob_materialize(pContent); |
| 355 | 365 | n = blob_size(pContent); |
| 356 | 366 | if( n<=0 || z[n-1]!='\n' ){ |
| 357 | 367 | blob_reset(pContent); |
| 358 | 368 | return 0; |
| @@ -885,10 +895,11 @@ | ||
| 885 | 895 | if( p->zWikiTitle ) goto manifest_syntax_error; |
| 886 | 896 | if( p->zTicketUuid ) goto manifest_syntax_error; |
| 887 | 897 | p->type = CFTYPE_MANIFEST; |
| 888 | 898 | } |
| 889 | 899 | md5sum_init(); |
| 900 | + if( !isRepeat ) g.parseCnt[p->type]++; | |
| 890 | 901 | return p; |
| 891 | 902 | |
| 892 | 903 | manifest_syntax_error: |
| 893 | 904 | /*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/ |
| 894 | 905 | md5sum_init(); |
| 895 | 906 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -345,14 +345,24 @@ | |
| 345 | char cType; |
| 346 | char *z; |
| 347 | int n; |
| 348 | char *zUuid; |
| 349 | int sz = 0; |
| 350 | |
| 351 | /* Every control artifact ends with a '\n' character. Exit early |
| 352 | ** if that is not the case for this artifact. |
| 353 | */ |
| 354 | z = blob_materialize(pContent); |
| 355 | n = blob_size(pContent); |
| 356 | if( n<=0 || z[n-1]!='\n' ){ |
| 357 | blob_reset(pContent); |
| 358 | return 0; |
| @@ -885,10 +895,11 @@ | |
| 885 | if( p->zWikiTitle ) goto manifest_syntax_error; |
| 886 | if( p->zTicketUuid ) goto manifest_syntax_error; |
| 887 | p->type = CFTYPE_MANIFEST; |
| 888 | } |
| 889 | md5sum_init(); |
| 890 | return p; |
| 891 | |
| 892 | manifest_syntax_error: |
| 893 | /*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/ |
| 894 | md5sum_init(); |
| 895 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -345,14 +345,24 @@ | |
| 345 | char cType; |
| 346 | char *z; |
| 347 | int n; |
| 348 | char *zUuid; |
| 349 | int sz = 0; |
| 350 | int isRepeat; |
| 351 | static Bag seen; |
| 352 | |
| 353 | if( bag_find(&seen, rid) ){ |
| 354 | isRepeat = 1; |
| 355 | }else{ |
| 356 | isRepeat = 0; |
| 357 | bag_insert(&seen, rid); |
| 358 | } |
| 359 | |
| 360 | /* Every control artifact ends with a '\n' character. Exit early |
| 361 | ** if that is not the case for this artifact. |
| 362 | */ |
| 363 | if( !isRepeat ) g.parseCnt[0]++; |
| 364 | z = blob_materialize(pContent); |
| 365 | n = blob_size(pContent); |
| 366 | if( n<=0 || z[n-1]!='\n' ){ |
| 367 | blob_reset(pContent); |
| 368 | return 0; |
| @@ -885,10 +895,11 @@ | |
| 895 | if( p->zWikiTitle ) goto manifest_syntax_error; |
| 896 | if( p->zTicketUuid ) goto manifest_syntax_error; |
| 897 | p->type = CFTYPE_MANIFEST; |
| 898 | } |
| 899 | md5sum_init(); |
| 900 | if( !isRepeat ) g.parseCnt[p->type]++; |
| 901 | return p; |
| 902 | |
| 903 | manifest_syntax_error: |
| 904 | /*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/ |
| 905 | md5sum_init(); |
| 906 |
+23
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -500,10 +500,11 @@ | ||
| 500 | 500 | ** --noverify Skip the verification of changes to the BLOB table |
| 501 | 501 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 502 | 502 | ** --randomize Scan artifacts in a random order |
| 503 | 503 | ** --vacuum Run VACUUM on the database after rebuilding |
| 504 | 504 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 505 | +** --stats Show artifact statistics after rebuilding | |
| 505 | 506 | ** |
| 506 | 507 | ** See also: deconstruct, reconstruct |
| 507 | 508 | */ |
| 508 | 509 | void rebuild_database(void){ |
| 509 | 510 | int forceFlag; |
| @@ -514,18 +515,20 @@ | ||
| 514 | 515 | const char *zPagesize; |
| 515 | 516 | int newPagesize = 0; |
| 516 | 517 | int activateWal; |
| 517 | 518 | int runVacuum; |
| 518 | 519 | int runCompress; |
| 520 | + int showStats; | |
| 519 | 521 | |
| 520 | 522 | omitVerify = find_option("noverify",0,0)!=0; |
| 521 | 523 | forceFlag = find_option("force","f",0)!=0; |
| 522 | 524 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 523 | 525 | doClustering = find_option("cluster", 0, 0)!=0; |
| 524 | 526 | runVacuum = find_option("vacuum",0,0)!=0; |
| 525 | 527 | runCompress = find_option("compress",0,0)!=0; |
| 526 | 528 | zPagesize = find_option("pagesize",0,1); |
| 529 | + showStats = find_option("stats",0,0)!=0; | |
| 527 | 530 | if( zPagesize ){ |
| 528 | 531 | newPagesize = atoi(zPagesize); |
| 529 | 532 | if( newPagesize<512 || newPagesize>65536 |
| 530 | 533 | || (newPagesize&(newPagesize-1))!=0 |
| 531 | 534 | ){ |
| @@ -579,10 +582,30 @@ | ||
| 579 | 582 | } |
| 580 | 583 | if( activateWal ){ |
| 581 | 584 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 582 | 585 | } |
| 583 | 586 | } |
| 587 | + if( showStats ){ | |
| 588 | + static struct { int idx; const char *zLabel; } aStat[] = { | |
| 589 | + { CFTYPE_ANY, "Artifacts:" }, | |
| 590 | + { CFTYPE_MANIFEST, "Manifests:" }, | |
| 591 | + { CFTYPE_CLUSTER, "Clusters:" }, | |
| 592 | + { CFTYPE_CONTROL, "Tags:" }, | |
| 593 | + { CFTYPE_WIKI, "Wikis:" }, | |
| 594 | + { CFTYPE_TICKET, "Tickets:" }, | |
| 595 | + { CFTYPE_ATTACHMENT,"Attachments:" }, | |
| 596 | + { CFTYPE_EVENT, "Events:" }, | |
| 597 | + }; | |
| 598 | + int i; | |
| 599 | + int subtotal = 0; | |
| 600 | + for(i=0; i<count(aStat); i++){ | |
| 601 | + int k = aStat[i].idx; | |
| 602 | + fossil_print("%-15s %6d\n", aStat[i].zLabel, g.parseCnt[k]); | |
| 603 | + if( k>0 ) subtotal += g.parseCnt[k]; | |
| 604 | + } | |
| 605 | + fossil_print("%-15s %6d\n", "Other:", g.parseCnt[CFTYPE_ANY] - subtotal); | |
| 606 | + } | |
| 584 | 607 | } |
| 585 | 608 | |
| 586 | 609 | /* |
| 587 | 610 | ** COMMAND: test-detach ?REPOSITORY? |
| 588 | 611 | ** |
| 589 | 612 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -500,10 +500,11 @@ | |
| 500 | ** --noverify Skip the verification of changes to the BLOB table |
| 501 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 502 | ** --randomize Scan artifacts in a random order |
| 503 | ** --vacuum Run VACUUM on the database after rebuilding |
| 504 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 505 | ** |
| 506 | ** See also: deconstruct, reconstruct |
| 507 | */ |
| 508 | void rebuild_database(void){ |
| 509 | int forceFlag; |
| @@ -514,18 +515,20 @@ | |
| 514 | const char *zPagesize; |
| 515 | int newPagesize = 0; |
| 516 | int activateWal; |
| 517 | int runVacuum; |
| 518 | int runCompress; |
| 519 | |
| 520 | omitVerify = find_option("noverify",0,0)!=0; |
| 521 | forceFlag = find_option("force","f",0)!=0; |
| 522 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 523 | doClustering = find_option("cluster", 0, 0)!=0; |
| 524 | runVacuum = find_option("vacuum",0,0)!=0; |
| 525 | runCompress = find_option("compress",0,0)!=0; |
| 526 | zPagesize = find_option("pagesize",0,1); |
| 527 | if( zPagesize ){ |
| 528 | newPagesize = atoi(zPagesize); |
| 529 | if( newPagesize<512 || newPagesize>65536 |
| 530 | || (newPagesize&(newPagesize-1))!=0 |
| 531 | ){ |
| @@ -579,10 +582,30 @@ | |
| 579 | } |
| 580 | if( activateWal ){ |
| 581 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | /* |
| 587 | ** COMMAND: test-detach ?REPOSITORY? |
| 588 | ** |
| 589 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -500,10 +500,11 @@ | |
| 500 | ** --noverify Skip the verification of changes to the BLOB table |
| 501 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 502 | ** --randomize Scan artifacts in a random order |
| 503 | ** --vacuum Run VACUUM on the database after rebuilding |
| 504 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 505 | ** --stats Show artifact statistics after rebuilding |
| 506 | ** |
| 507 | ** See also: deconstruct, reconstruct |
| 508 | */ |
| 509 | void rebuild_database(void){ |
| 510 | int forceFlag; |
| @@ -514,18 +515,20 @@ | |
| 515 | const char *zPagesize; |
| 516 | int newPagesize = 0; |
| 517 | int activateWal; |
| 518 | int runVacuum; |
| 519 | int runCompress; |
| 520 | int showStats; |
| 521 | |
| 522 | omitVerify = find_option("noverify",0,0)!=0; |
| 523 | forceFlag = find_option("force","f",0)!=0; |
| 524 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 525 | doClustering = find_option("cluster", 0, 0)!=0; |
| 526 | runVacuum = find_option("vacuum",0,0)!=0; |
| 527 | runCompress = find_option("compress",0,0)!=0; |
| 528 | zPagesize = find_option("pagesize",0,1); |
| 529 | showStats = find_option("stats",0,0)!=0; |
| 530 | if( zPagesize ){ |
| 531 | newPagesize = atoi(zPagesize); |
| 532 | if( newPagesize<512 || newPagesize>65536 |
| 533 | || (newPagesize&(newPagesize-1))!=0 |
| 534 | ){ |
| @@ -579,10 +582,30 @@ | |
| 582 | } |
| 583 | if( activateWal ){ |
| 584 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 585 | } |
| 586 | } |
| 587 | if( showStats ){ |
| 588 | static struct { int idx; const char *zLabel; } aStat[] = { |
| 589 | { CFTYPE_ANY, "Artifacts:" }, |
| 590 | { CFTYPE_MANIFEST, "Manifests:" }, |
| 591 | { CFTYPE_CLUSTER, "Clusters:" }, |
| 592 | { CFTYPE_CONTROL, "Tags:" }, |
| 593 | { CFTYPE_WIKI, "Wikis:" }, |
| 594 | { CFTYPE_TICKET, "Tickets:" }, |
| 595 | { CFTYPE_ATTACHMENT,"Attachments:" }, |
| 596 | { CFTYPE_EVENT, "Events:" }, |
| 597 | }; |
| 598 | int i; |
| 599 | int subtotal = 0; |
| 600 | for(i=0; i<count(aStat); i++){ |
| 601 | int k = aStat[i].idx; |
| 602 | fossil_print("%-15s %6d\n", aStat[i].zLabel, g.parseCnt[k]); |
| 603 | if( k>0 ) subtotal += g.parseCnt[k]; |
| 604 | } |
| 605 | fossil_print("%-15s %6d\n", "Other:", g.parseCnt[CFTYPE_ANY] - subtotal); |
| 606 | } |
| 607 | } |
| 608 | |
| 609 | /* |
| 610 | ** COMMAND: test-detach ?REPOSITORY? |
| 611 | ** |
| 612 |
+5
-4
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -44,11 +44,11 @@ | ||
| 44 | 44 | /* |
| 45 | 45 | ** Begin the process of generating a tarball. |
| 46 | 46 | ** |
| 47 | 47 | ** Initialize the GZIP compressor and the table of directory names. |
| 48 | 48 | */ |
| 49 | -static void tar_begin(void){ | |
| 49 | +static void tar_begin(sqlite3_int64 mTime){ | |
| 50 | 50 | assert( tball.aHdr==0 ); |
| 51 | 51 | tball.aHdr = fossil_malloc(512+512); |
| 52 | 52 | memset(tball.aHdr, 0, 512+512); |
| 53 | 53 | tball.zSpaces = (char*)&tball.aHdr[512]; |
| 54 | 54 | /* zPrevDir init */ |
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | memcpy(&tball.aHdr[108], "0000000", 8); /* Owner ID */ |
| 61 | 61 | memcpy(&tball.aHdr[116], "0000000", 8); /* Group ID */ |
| 62 | 62 | memcpy(&tball.aHdr[257], "ustar\00000", 8); /* POSIX.1 format */ |
| 63 | 63 | memcpy(&tball.aHdr[265], "nobody", 7); /* Owner name */ |
| 64 | 64 | memcpy(&tball.aHdr[297], "nobody", 7); /* Group name */ |
| 65 | - gzip_begin(); | |
| 65 | + gzip_begin(mTime); | |
| 66 | 66 | db_multi_exec( |
| 67 | 67 | "CREATE TEMP TABLE dir(name UNIQUE);" |
| 68 | 68 | ); |
| 69 | 69 | } |
| 70 | 70 | |
| @@ -427,11 +427,11 @@ | ||
| 427 | 427 | Blob file; |
| 428 | 428 | if( g.argc<3 ){ |
| 429 | 429 | usage("ARCHIVE FILE...."); |
| 430 | 430 | } |
| 431 | 431 | sqlite3_open(":memory:", &g.db); |
| 432 | - tar_begin(); | |
| 432 | + tar_begin(0); | |
| 433 | 433 | for(i=3; i<g.argc; i++){ |
| 434 | 434 | blob_zero(&file); |
| 435 | 435 | blob_read_from_file(&file, g.argv[i]); |
| 436 | 436 | tar_add_file(g.argv[i], &file, |
| 437 | 437 | file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i])); |
| @@ -473,20 +473,20 @@ | ||
| 473 | 473 | blob_zero(pTar); |
| 474 | 474 | return; |
| 475 | 475 | } |
| 476 | 476 | blob_zero(&hash); |
| 477 | 477 | blob_zero(&filename); |
| 478 | - tar_begin(); | |
| 479 | 478 | |
| 480 | 479 | if( zDir && zDir[0] ){ |
| 481 | 480 | blob_appendf(&filename, "%s/", zDir); |
| 482 | 481 | } |
| 483 | 482 | nPrefix = blob_size(&filename); |
| 484 | 483 | |
| 485 | 484 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 486 | 485 | if( pManifest ){ |
| 487 | 486 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 487 | + tar_begin(mTime); | |
| 488 | 488 | if( db_get_boolean("manifest", 0) ){ |
| 489 | 489 | blob_append(&filename, "manifest", -1); |
| 490 | 490 | zName = blob_str(&filename); |
| 491 | 491 | tar_add_file(zName, &mfile, 0, mTime); |
| 492 | 492 | sha1sum_blob(&mfile, &hash); |
| @@ -513,10 +513,11 @@ | ||
| 513 | 513 | }else{ |
| 514 | 514 | sha1sum_blob(&mfile, &hash); |
| 515 | 515 | blob_append(&filename, blob_str(&hash), 16); |
| 516 | 516 | zName = blob_str(&filename); |
| 517 | 517 | mTime = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0;"); |
| 518 | + tar_begin(mTime); | |
| 518 | 519 | tar_add_file(zName, &mfile, 0, mTime); |
| 519 | 520 | } |
| 520 | 521 | manifest_destroy(pManifest); |
| 521 | 522 | blob_reset(&mfile); |
| 522 | 523 | blob_reset(&filename); |
| 523 | 524 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -44,11 +44,11 @@ | |
| 44 | /* |
| 45 | ** Begin the process of generating a tarball. |
| 46 | ** |
| 47 | ** Initialize the GZIP compressor and the table of directory names. |
| 48 | */ |
| 49 | static void tar_begin(void){ |
| 50 | assert( tball.aHdr==0 ); |
| 51 | tball.aHdr = fossil_malloc(512+512); |
| 52 | memset(tball.aHdr, 0, 512+512); |
| 53 | tball.zSpaces = (char*)&tball.aHdr[512]; |
| 54 | /* zPrevDir init */ |
| @@ -60,11 +60,11 @@ | |
| 60 | memcpy(&tball.aHdr[108], "0000000", 8); /* Owner ID */ |
| 61 | memcpy(&tball.aHdr[116], "0000000", 8); /* Group ID */ |
| 62 | memcpy(&tball.aHdr[257], "ustar\00000", 8); /* POSIX.1 format */ |
| 63 | memcpy(&tball.aHdr[265], "nobody", 7); /* Owner name */ |
| 64 | memcpy(&tball.aHdr[297], "nobody", 7); /* Group name */ |
| 65 | gzip_begin(); |
| 66 | db_multi_exec( |
| 67 | "CREATE TEMP TABLE dir(name UNIQUE);" |
| 68 | ); |
| 69 | } |
| 70 | |
| @@ -427,11 +427,11 @@ | |
| 427 | Blob file; |
| 428 | if( g.argc<3 ){ |
| 429 | usage("ARCHIVE FILE...."); |
| 430 | } |
| 431 | sqlite3_open(":memory:", &g.db); |
| 432 | tar_begin(); |
| 433 | for(i=3; i<g.argc; i++){ |
| 434 | blob_zero(&file); |
| 435 | blob_read_from_file(&file, g.argv[i]); |
| 436 | tar_add_file(g.argv[i], &file, |
| 437 | file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i])); |
| @@ -473,20 +473,20 @@ | |
| 473 | blob_zero(pTar); |
| 474 | return; |
| 475 | } |
| 476 | blob_zero(&hash); |
| 477 | blob_zero(&filename); |
| 478 | tar_begin(); |
| 479 | |
| 480 | if( zDir && zDir[0] ){ |
| 481 | blob_appendf(&filename, "%s/", zDir); |
| 482 | } |
| 483 | nPrefix = blob_size(&filename); |
| 484 | |
| 485 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 486 | if( pManifest ){ |
| 487 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 488 | if( db_get_boolean("manifest", 0) ){ |
| 489 | blob_append(&filename, "manifest", -1); |
| 490 | zName = blob_str(&filename); |
| 491 | tar_add_file(zName, &mfile, 0, mTime); |
| 492 | sha1sum_blob(&mfile, &hash); |
| @@ -513,10 +513,11 @@ | |
| 513 | }else{ |
| 514 | sha1sum_blob(&mfile, &hash); |
| 515 | blob_append(&filename, blob_str(&hash), 16); |
| 516 | zName = blob_str(&filename); |
| 517 | mTime = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0;"); |
| 518 | tar_add_file(zName, &mfile, 0, mTime); |
| 519 | } |
| 520 | manifest_destroy(pManifest); |
| 521 | blob_reset(&mfile); |
| 522 | blob_reset(&filename); |
| 523 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -44,11 +44,11 @@ | |
| 44 | /* |
| 45 | ** Begin the process of generating a tarball. |
| 46 | ** |
| 47 | ** Initialize the GZIP compressor and the table of directory names. |
| 48 | */ |
| 49 | static void tar_begin(sqlite3_int64 mTime){ |
| 50 | assert( tball.aHdr==0 ); |
| 51 | tball.aHdr = fossil_malloc(512+512); |
| 52 | memset(tball.aHdr, 0, 512+512); |
| 53 | tball.zSpaces = (char*)&tball.aHdr[512]; |
| 54 | /* zPrevDir init */ |
| @@ -60,11 +60,11 @@ | |
| 60 | memcpy(&tball.aHdr[108], "0000000", 8); /* Owner ID */ |
| 61 | memcpy(&tball.aHdr[116], "0000000", 8); /* Group ID */ |
| 62 | memcpy(&tball.aHdr[257], "ustar\00000", 8); /* POSIX.1 format */ |
| 63 | memcpy(&tball.aHdr[265], "nobody", 7); /* Owner name */ |
| 64 | memcpy(&tball.aHdr[297], "nobody", 7); /* Group name */ |
| 65 | gzip_begin(mTime); |
| 66 | db_multi_exec( |
| 67 | "CREATE TEMP TABLE dir(name UNIQUE);" |
| 68 | ); |
| 69 | } |
| 70 | |
| @@ -427,11 +427,11 @@ | |
| 427 | Blob file; |
| 428 | if( g.argc<3 ){ |
| 429 | usage("ARCHIVE FILE...."); |
| 430 | } |
| 431 | sqlite3_open(":memory:", &g.db); |
| 432 | tar_begin(0); |
| 433 | for(i=3; i<g.argc; i++){ |
| 434 | blob_zero(&file); |
| 435 | blob_read_from_file(&file, g.argv[i]); |
| 436 | tar_add_file(g.argv[i], &file, |
| 437 | file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i])); |
| @@ -473,20 +473,20 @@ | |
| 473 | blob_zero(pTar); |
| 474 | return; |
| 475 | } |
| 476 | blob_zero(&hash); |
| 477 | blob_zero(&filename); |
| 478 | |
| 479 | if( zDir && zDir[0] ){ |
| 480 | blob_appendf(&filename, "%s/", zDir); |
| 481 | } |
| 482 | nPrefix = blob_size(&filename); |
| 483 | |
| 484 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 485 | if( pManifest ){ |
| 486 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 487 | tar_begin(mTime); |
| 488 | if( db_get_boolean("manifest", 0) ){ |
| 489 | blob_append(&filename, "manifest", -1); |
| 490 | zName = blob_str(&filename); |
| 491 | tar_add_file(zName, &mfile, 0, mTime); |
| 492 | sha1sum_blob(&mfile, &hash); |
| @@ -513,10 +513,11 @@ | |
| 513 | }else{ |
| 514 | sha1sum_blob(&mfile, &hash); |
| 515 | blob_append(&filename, blob_str(&hash), 16); |
| 516 | zName = blob_str(&filename); |
| 517 | mTime = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0;"); |
| 518 | tar_begin(mTime); |
| 519 | tar_add_file(zName, &mfile, 0, mTime); |
| 520 | } |
| 521 | manifest_destroy(pManifest); |
| 522 | blob_reset(&mfile); |
| 523 | blob_reset(&filename); |
| 524 |
+2
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -302,11 +302,11 @@ | ||
| 302 | 302 | blob_zero(&sql); |
| 303 | 303 | blob_append(&sql, "DELETE FROM fv WHERE ", -1); |
| 304 | 304 | zSep = ""; |
| 305 | 305 | for(i=3; i<g.argc; i++){ |
| 306 | 306 | file_tree_name(g.argv[i], &treename, 1); |
| 307 | - if( file_isdir(g.argv[i])==1 ){ | |
| 307 | + if( file_wd_isdir(g.argv[i])==1 ){ | |
| 308 | 308 | if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){ |
| 309 | 309 | blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename); |
| 310 | 310 | }else{ |
| 311 | 311 | blob_reset(&sql); |
| 312 | 312 | break; |
| @@ -513,11 +513,11 @@ | ||
| 513 | 513 | |
| 514 | 514 | blob_zero(&path); |
| 515 | 515 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 516 | 516 | zPath = blob_str(&path); |
| 517 | 517 | /* Handle various cases of existence of the directory */ |
| 518 | - switch( file_isdir(zPath) ){ | |
| 518 | + switch( file_wd_isdir(zPath) ){ | |
| 519 | 519 | case 0: { /* doesn't exist */ |
| 520 | 520 | if( file_mkdir(zPath, 0)!=0 ) { |
| 521 | 521 | fossil_warning("couldn't create directory %s as " |
| 522 | 522 | "required by empty-dirs setting", zDir); |
| 523 | 523 | } |
| 524 | 524 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -302,11 +302,11 @@ | |
| 302 | blob_zero(&sql); |
| 303 | blob_append(&sql, "DELETE FROM fv WHERE ", -1); |
| 304 | zSep = ""; |
| 305 | for(i=3; i<g.argc; i++){ |
| 306 | file_tree_name(g.argv[i], &treename, 1); |
| 307 | if( file_isdir(g.argv[i])==1 ){ |
| 308 | if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){ |
| 309 | blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename); |
| 310 | }else{ |
| 311 | blob_reset(&sql); |
| 312 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | |
| 514 | blob_zero(&path); |
| 515 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 516 | zPath = blob_str(&path); |
| 517 | /* Handle various cases of existence of the directory */ |
| 518 | switch( file_isdir(zPath) ){ |
| 519 | case 0: { /* doesn't exist */ |
| 520 | if( file_mkdir(zPath, 0)!=0 ) { |
| 521 | fossil_warning("couldn't create directory %s as " |
| 522 | "required by empty-dirs setting", zDir); |
| 523 | } |
| 524 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -302,11 +302,11 @@ | |
| 302 | blob_zero(&sql); |
| 303 | blob_append(&sql, "DELETE FROM fv WHERE ", -1); |
| 304 | zSep = ""; |
| 305 | for(i=3; i<g.argc; i++){ |
| 306 | file_tree_name(g.argv[i], &treename, 1); |
| 307 | if( file_wd_isdir(g.argv[i])==1 ){ |
| 308 | if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){ |
| 309 | blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename); |
| 310 | }else{ |
| 311 | blob_reset(&sql); |
| 312 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | |
| 514 | blob_zero(&path); |
| 515 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 516 | zPath = blob_str(&path); |
| 517 | /* Handle various cases of existence of the directory */ |
| 518 | switch( file_wd_isdir(zPath) ){ |
| 519 | case 0: { /* doesn't exist */ |
| 520 | if( file_mkdir(zPath, 0)!=0 ) { |
| 521 | fossil_warning("couldn't create directory %s as " |
| 522 | "required by empty-dirs setting", zDir); |
| 523 | } |
| 524 |
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -272,11 +272,11 @@ | ||
| 272 | 272 | blob_reset(&content); |
| 273 | 273 | continue; |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | - if( file_isdir(zName) == 1 ){ | |
| 277 | + if( file_wd_isdir(zName) == 1 ){ | |
| 278 | 278 | /*TODO(dchest): remove directories? */ |
| 279 | 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | 280 | } |
| 281 | 281 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 282 | 282 | file_delete(zName); |
| @@ -389,11 +389,11 @@ | ||
| 389 | 389 | blob_appendf(pPath, "/%s", zUtf8); |
| 390 | 390 | fossil_mbcs_free(zUtf8); |
| 391 | 391 | zPath = blob_str(pPath); |
| 392 | 392 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 393 | 393 | /* do nothing */ |
| 394 | - }else if( file_isdir(zPath)==1 ){ | |
| 394 | + }else if( file_wd_isdir(zPath)==1 ){ | |
| 395 | 395 | if( !vfile_top_of_checkout(zPath) ){ |
| 396 | 396 | vfile_scan(pPath, nPrefix, allFlag, pIgnore); |
| 397 | 397 | } |
| 398 | 398 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 399 | 399 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 400 | 400 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -272,11 +272,11 @@ | |
| 272 | blob_reset(&content); |
| 273 | continue; |
| 274 | } |
| 275 | } |
| 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | if( file_isdir(zName) == 1 ){ |
| 278 | /*TODO(dchest): remove directories? */ |
| 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | } |
| 281 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 282 | file_delete(zName); |
| @@ -389,11 +389,11 @@ | |
| 389 | blob_appendf(pPath, "/%s", zUtf8); |
| 390 | fossil_mbcs_free(zUtf8); |
| 391 | zPath = blob_str(pPath); |
| 392 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 393 | /* do nothing */ |
| 394 | }else if( file_isdir(zPath)==1 ){ |
| 395 | if( !vfile_top_of_checkout(zPath) ){ |
| 396 | vfile_scan(pPath, nPrefix, allFlag, pIgnore); |
| 397 | } |
| 398 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 399 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 400 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -272,11 +272,11 @@ | |
| 272 | blob_reset(&content); |
| 273 | continue; |
| 274 | } |
| 275 | } |
| 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | if( file_wd_isdir(zName) == 1 ){ |
| 278 | /*TODO(dchest): remove directories? */ |
| 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | } |
| 281 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 282 | file_delete(zName); |
| @@ -389,11 +389,11 @@ | |
| 389 | blob_appendf(pPath, "/%s", zUtf8); |
| 390 | fossil_mbcs_free(zUtf8); |
| 391 | zPath = blob_str(pPath); |
| 392 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 393 | /* do nothing */ |
| 394 | }else if( file_wd_isdir(zPath)==1 ){ |
| 395 | if( !vfile_top_of_checkout(zPath) ){ |
| 396 | vfile_scan(pPath, nPrefix, allFlag, pIgnore); |
| 397 | } |
| 398 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 399 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 400 |