Fossil SCM
Merge updates from trunk.
Commit
488dcfada1ff1d8f830c605d795f0171a958c53c
Parent
1982a8ce0720b19…
8 files changed
+2
-1
+2
-2
+3
+9
-17
+7
-8
+10
-10
+1
-1
+2
-2
+2
-1
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -153,14 +153,15 @@ | ||
| 153 | 153 | " WHERE pathname=%Q %s", zPath, filename_collation()) ){ |
| 154 | 154 | db_multi_exec("UPDATE vfile SET deleted=0" |
| 155 | 155 | " WHERE pathname=%Q %s", zPath, filename_collation()); |
| 156 | 156 | }else{ |
| 157 | 157 | char *zFullname = mprintf("%s%s", g.zLocalRoot, zPath); |
| 158 | + int isExe = file_wd_isexe(zFullname); | |
| 158 | 159 | db_multi_exec( |
| 159 | 160 | "INSERT INTO vfile(vid,deleted,rid,mrid,pathname,isexe,islink)" |
| 160 | 161 | "VALUES(%d,0,0,0,%Q,%d,%d)", |
| 161 | - vid, zPath, file_wd_isexe(zFullname), file_wd_islink(zFullname)); | |
| 162 | + vid, zPath, isExe, file_wd_islink(0)); | |
| 162 | 163 | fossil_free(zFullname); |
| 163 | 164 | } |
| 164 | 165 | if( db_changes() ){ |
| 165 | 166 | fossil_print("ADDED %s\n", zPath); |
| 166 | 167 | return 1; |
| 167 | 168 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -153,14 +153,15 @@ | |
| 153 | " WHERE pathname=%Q %s", zPath, filename_collation()) ){ |
| 154 | db_multi_exec("UPDATE vfile SET deleted=0" |
| 155 | " WHERE pathname=%Q %s", zPath, filename_collation()); |
| 156 | }else{ |
| 157 | char *zFullname = mprintf("%s%s", g.zLocalRoot, zPath); |
| 158 | db_multi_exec( |
| 159 | "INSERT INTO vfile(vid,deleted,rid,mrid,pathname,isexe,islink)" |
| 160 | "VALUES(%d,0,0,0,%Q,%d,%d)", |
| 161 | vid, zPath, file_wd_isexe(zFullname), file_wd_islink(zFullname)); |
| 162 | fossil_free(zFullname); |
| 163 | } |
| 164 | if( db_changes() ){ |
| 165 | fossil_print("ADDED %s\n", zPath); |
| 166 | return 1; |
| 167 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -153,14 +153,15 @@ | |
| 153 | " WHERE pathname=%Q %s", zPath, filename_collation()) ){ |
| 154 | db_multi_exec("UPDATE vfile SET deleted=0" |
| 155 | " WHERE pathname=%Q %s", zPath, filename_collation()); |
| 156 | }else{ |
| 157 | char *zFullname = mprintf("%s%s", g.zLocalRoot, zPath); |
| 158 | int isExe = file_wd_isexe(zFullname); |
| 159 | db_multi_exec( |
| 160 | "INSERT INTO vfile(vid,deleted,rid,mrid,pathname,isexe,islink)" |
| 161 | "VALUES(%d,0,0,0,%Q,%d,%d)", |
| 162 | vid, zPath, isExe, file_wd_islink(0)); |
| 163 | fossil_free(zFullname); |
| 164 | } |
| 165 | if( db_changes() ){ |
| 166 | fossil_print("ADDED %s\n", zPath); |
| 167 | return 1; |
| 168 |
+2
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -109,11 +109,11 @@ | ||
| 109 | 109 | /* Read content of zFile2 into memory */ |
| 110 | 110 | blob_zero(&file2); |
| 111 | 111 | if( file_wd_size(zFile2)<0 ){ |
| 112 | 112 | zName2 = NULL_DEVICE; |
| 113 | 113 | }else{ |
| 114 | - if( file_wd_islink(zFile2) ){ | |
| 114 | + if( file_wd_islink(0) ){ | |
| 115 | 115 | blob_read_link(&file2, zFile2); |
| 116 | 116 | }else{ |
| 117 | 117 | blob_read_from_file(&file2, zFile2); |
| 118 | 118 | } |
| 119 | 119 | zName2 = zName; |
| @@ -156,11 +156,11 @@ | ||
| 156 | 156 | } |
| 157 | 157 | glob_free(pBinary); |
| 158 | 158 | } |
| 159 | 159 | blob_zero(&file2); |
| 160 | 160 | if( file_wd_size(zFile2)>=0 ){ |
| 161 | - if( file_wd_islink(zFile2) ){ | |
| 161 | + if( file_wd_islink(0) ){ | |
| 162 | 162 | blob_read_link(&file2, zFile2); |
| 163 | 163 | }else{ |
| 164 | 164 | blob_read_from_file(&file2, zFile2); |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -109,11 +109,11 @@ | |
| 109 | /* Read content of zFile2 into memory */ |
| 110 | blob_zero(&file2); |
| 111 | if( file_wd_size(zFile2)<0 ){ |
| 112 | zName2 = NULL_DEVICE; |
| 113 | }else{ |
| 114 | if( file_wd_islink(zFile2) ){ |
| 115 | blob_read_link(&file2, zFile2); |
| 116 | }else{ |
| 117 | blob_read_from_file(&file2, zFile2); |
| 118 | } |
| 119 | zName2 = zName; |
| @@ -156,11 +156,11 @@ | |
| 156 | } |
| 157 | glob_free(pBinary); |
| 158 | } |
| 159 | blob_zero(&file2); |
| 160 | if( file_wd_size(zFile2)>=0 ){ |
| 161 | if( file_wd_islink(zFile2) ){ |
| 162 | blob_read_link(&file2, zFile2); |
| 163 | }else{ |
| 164 | blob_read_from_file(&file2, zFile2); |
| 165 | } |
| 166 | } |
| 167 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -109,11 +109,11 @@ | |
| 109 | /* Read content of zFile2 into memory */ |
| 110 | blob_zero(&file2); |
| 111 | if( file_wd_size(zFile2)<0 ){ |
| 112 | zName2 = NULL_DEVICE; |
| 113 | }else{ |
| 114 | if( file_wd_islink(0) ){ |
| 115 | blob_read_link(&file2, zFile2); |
| 116 | }else{ |
| 117 | blob_read_from_file(&file2, zFile2); |
| 118 | } |
| 119 | zName2 = zName; |
| @@ -156,11 +156,11 @@ | |
| 156 | } |
| 157 | glob_free(pBinary); |
| 158 | } |
| 159 | blob_zero(&file2); |
| 160 | if( file_wd_size(zFile2)>=0 ){ |
| 161 | if( file_wd_islink(0) ){ |
| 162 | blob_read_link(&file2, zFile2); |
| 163 | }else{ |
| 164 | blob_read_from_file(&file2, zFile2); |
| 165 | } |
| 166 | } |
| 167 |
+3
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -182,10 +182,13 @@ | ||
| 182 | 182 | { "mpga", 4, "audio/mpeg" }, |
| 183 | 183 | { "ms", 2, "application/x-troff-ms" }, |
| 184 | 184 | { "msh", 3, "model/mesh" }, |
| 185 | 185 | { "nc", 2, "application/x-netcdf" }, |
| 186 | 186 | { "oda", 3, "application/oda" }, |
| 187 | + { "odp", 3, "application/vnd.oasis.opendocument.presentation" }, | |
| 188 | + { "ods", 3, "application/vnd.oasis.opendocument.spreadsheet" }, | |
| 189 | + { "odt", 3, "application/vnd.oasis.opendocument.text" }, | |
| 187 | 190 | { "ogg", 3, "application/ogg" }, |
| 188 | 191 | { "ogm", 3, "application/ogg" }, |
| 189 | 192 | { "pbm", 3, "image/x-portable-bitmap" }, |
| 190 | 193 | { "pdb", 3, "chemical/x-pdb" }, |
| 191 | 194 | { "pdf", 3, "application/pdf" }, |
| 192 | 195 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -182,10 +182,13 @@ | |
| 182 | { "mpga", 4, "audio/mpeg" }, |
| 183 | { "ms", 2, "application/x-troff-ms" }, |
| 184 | { "msh", 3, "model/mesh" }, |
| 185 | { "nc", 2, "application/x-netcdf" }, |
| 186 | { "oda", 3, "application/oda" }, |
| 187 | { "ogg", 3, "application/ogg" }, |
| 188 | { "ogm", 3, "application/ogg" }, |
| 189 | { "pbm", 3, "image/x-portable-bitmap" }, |
| 190 | { "pdb", 3, "chemical/x-pdb" }, |
| 191 | { "pdf", 3, "application/pdf" }, |
| 192 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -182,10 +182,13 @@ | |
| 182 | { "mpga", 4, "audio/mpeg" }, |
| 183 | { "ms", 2, "application/x-troff-ms" }, |
| 184 | { "msh", 3, "model/mesh" }, |
| 185 | { "nc", 2, "application/x-netcdf" }, |
| 186 | { "oda", 3, "application/oda" }, |
| 187 | { "odp", 3, "application/vnd.oasis.opendocument.presentation" }, |
| 188 | { "ods", 3, "application/vnd.oasis.opendocument.spreadsheet" }, |
| 189 | { "odt", 3, "application/vnd.oasis.opendocument.text" }, |
| 190 | { "ogg", 3, "application/ogg" }, |
| 191 | { "ogm", 3, "application/ogg" }, |
| 192 | { "pbm", 3, "image/x-portable-bitmap" }, |
| 193 | { "pdb", 3, "chemical/x-pdb" }, |
| 194 | { "pdf", 3, "application/pdf" }, |
| 195 |
+9
-17
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -232,32 +232,24 @@ | ||
| 232 | 232 | blob_reset(&content); |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /* |
| 236 | 236 | ** Return file permissions (normal, executable, or symlink): |
| 237 | -** - PERM_EXE if file is executable; | |
| 237 | +** - PERM_EXE on Unix if file is executable; | |
| 238 | 238 | ** - PERM_LNK on Unix if file is symlink and allow-symlinks option is on; |
| 239 | 239 | ** - PERM_REG for all other cases (regular file, directory, fifo, etc). |
| 240 | 240 | */ |
| 241 | 241 | int file_wd_perm(const char *zFilename){ |
| 242 | - if( getStat(zFilename, 1) ) return PERM_REG; | |
| 243 | -#if defined(_WIN32) | |
| 244 | -# ifndef S_IXUSR | |
| 245 | -# define S_IXUSR _S_IEXEC | |
| 246 | -# endif | |
| 247 | - if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) | |
| 248 | - return PERM_EXE; | |
| 249 | - else | |
| 250 | - return PERM_REG; | |
| 251 | -#else | |
| 252 | - if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) | |
| 253 | - return PERM_EXE; | |
| 254 | - else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) ) | |
| 255 | - return PERM_LNK; | |
| 256 | - else | |
| 257 | - return PERM_REG; | |
| 242 | +#if !defined(_WIN32) | |
| 243 | + if( !getStat(zFilename, 1) ){ | |
| 244 | + if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) | |
| 245 | + return PERM_EXE; | |
| 246 | + else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) ) | |
| 247 | + return PERM_LNK; | |
| 248 | + } | |
| 258 | 249 | #endif |
| 250 | + return PERM_REG; | |
| 259 | 251 | } |
| 260 | 252 | |
| 261 | 253 | /* |
| 262 | 254 | ** Return TRUE if the named file is an executable. Return false |
| 263 | 255 | ** for directories, devices, fifos, symlinks, etc. |
| 264 | 256 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -232,32 +232,24 @@ | |
| 232 | blob_reset(&content); |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 | ** Return file permissions (normal, executable, or symlink): |
| 237 | ** - PERM_EXE if file is executable; |
| 238 | ** - PERM_LNK on Unix if file is symlink and allow-symlinks option is on; |
| 239 | ** - PERM_REG for all other cases (regular file, directory, fifo, etc). |
| 240 | */ |
| 241 | int file_wd_perm(const char *zFilename){ |
| 242 | if( getStat(zFilename, 1) ) return PERM_REG; |
| 243 | #if defined(_WIN32) |
| 244 | # ifndef S_IXUSR |
| 245 | # define S_IXUSR _S_IEXEC |
| 246 | # endif |
| 247 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 248 | return PERM_EXE; |
| 249 | else |
| 250 | return PERM_REG; |
| 251 | #else |
| 252 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 253 | return PERM_EXE; |
| 254 | else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) ) |
| 255 | return PERM_LNK; |
| 256 | else |
| 257 | return PERM_REG; |
| 258 | #endif |
| 259 | } |
| 260 | |
| 261 | /* |
| 262 | ** Return TRUE if the named file is an executable. Return false |
| 263 | ** for directories, devices, fifos, symlinks, etc. |
| 264 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -232,32 +232,24 @@ | |
| 232 | blob_reset(&content); |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 | ** Return file permissions (normal, executable, or symlink): |
| 237 | ** - PERM_EXE on Unix if file is executable; |
| 238 | ** - PERM_LNK on Unix if file is symlink and allow-symlinks option is on; |
| 239 | ** - PERM_REG for all other cases (regular file, directory, fifo, etc). |
| 240 | */ |
| 241 | int file_wd_perm(const char *zFilename){ |
| 242 | #if !defined(_WIN32) |
| 243 | if( !getStat(zFilename, 1) ){ |
| 244 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 245 | return PERM_EXE; |
| 246 | else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) ) |
| 247 | return PERM_LNK; |
| 248 | } |
| 249 | #endif |
| 250 | return PERM_REG; |
| 251 | } |
| 252 | |
| 253 | /* |
| 254 | ** Return TRUE if the named file is an executable. Return false |
| 255 | ** for directories, devices, fifos, symlinks, etc. |
| 256 |
+7
-8
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -285,11 +285,11 @@ | ||
| 285 | 285 | const char *zName, /* Name of the object */ |
| 286 | 286 | int nName, /* Number of characters in zName */ |
| 287 | 287 | int iMode, /* Mode. 0644 or 0755 */ |
| 288 | 288 | unsigned int mTime, /* File modification time */ |
| 289 | 289 | int iSize, /* Size of the object in bytes */ |
| 290 | - char cType /* Type of object: | |
| 290 | + char cType /* Type of object: | |
| 291 | 291 | '0'==file. '2'==symlink. '5'==directory */ |
| 292 | 292 | ){ |
| 293 | 293 | /* set mode and modification time */ |
| 294 | 294 | sqlite3_snprintf(8, (char*)&tball.aHdr[100], "%07o", iMode); |
| 295 | 295 | sqlite3_snprintf(12, (char*)&tball.aHdr[136], "%011o", mTime); |
| @@ -341,11 +341,11 @@ | ||
| 341 | 341 | unsigned int mTime /* Modification time */ |
| 342 | 342 | ){ |
| 343 | 343 | int i; |
| 344 | 344 | for(i=nName-1; i>0 && zName[i]!='/'; i--){} |
| 345 | 345 | if( i<=0 ) return; |
| 346 | - if( i<tball.nPrevDirAlloc | |
| 346 | + if( i<tball.nPrevDirAlloc | |
| 347 | 347 | && strncmp(tball.zPrevDir, zName, i)==0 |
| 348 | 348 | && tball.zPrevDir[i]==0 ) return; |
| 349 | 349 | db_multi_exec("INSERT OR IGNORE INTO dir VALUES('%#q')", i, zName); |
| 350 | 350 | if( sqlite3_changes(g.db)==0 ) return; |
| 351 | 351 | tar_add_directory_of(zName, i-1, mTime); |
| @@ -377,11 +377,11 @@ | ||
| 377 | 377 | char cType = '0'; |
| 378 | 378 | |
| 379 | 379 | /* length check moved to tar_split_path */ |
| 380 | 380 | tar_add_directory_of(zName, nName, mTime); |
| 381 | 381 | |
| 382 | - /* | |
| 382 | + /* | |
| 383 | 383 | * If we have a symlink, write its destination path (which is stored in |
| 384 | 384 | * pContent) into header, and set content length to 0 to avoid storing path |
| 385 | 385 | * as file content in the next step. Since 'linkname' header is limited to |
| 386 | 386 | * 100 bytes (-1 byte for terminating zero), if path is greater than that, |
| 387 | 387 | * store symlink as a plain-text file. (Not sure how TAR handles long links.) |
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | sqlite3_snprintf(100, (char*)&tball.aHdr[157], "%s", blob_str(pContent)); |
| 391 | 391 | cType = '2'; |
| 392 | 392 | n = 0; |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, | |
| 395 | + tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, | |
| 396 | 396 | mTime, n, cType); |
| 397 | 397 | if( n ){ |
| 398 | 398 | gzip_step(blob_buffer(pContent), n); |
| 399 | 399 | lastPage = n % 512; |
| 400 | 400 | if( lastPage!=0 ){ |
| @@ -428,21 +428,20 @@ | ||
| 428 | 428 | ** that contains files given in the second and subsequent arguments. |
| 429 | 429 | */ |
| 430 | 430 | void test_tarball_cmd(void){ |
| 431 | 431 | int i; |
| 432 | 432 | Blob zip; |
| 433 | - Blob file; | |
| 434 | 433 | if( g.argc<3 ){ |
| 435 | 434 | usage("ARCHIVE FILE...."); |
| 436 | 435 | } |
| 437 | 436 | sqlite3_open(":memory:", &g.db); |
| 438 | 437 | tar_begin(-1); |
| 439 | 438 | for(i=3; i<g.argc; i++){ |
| 439 | + Blob file; | |
| 440 | 440 | blob_zero(&file); |
| 441 | 441 | blob_read_from_file(&file, g.argv[i]); |
| 442 | - tar_add_file(g.argv[i], &file, | |
| 443 | - file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i])); | |
| 442 | + tar_add_file(g.argv[i], &file, file_wd_perm(0), file_wd_mtime(0)); | |
| 444 | 443 | blob_reset(&file); |
| 445 | 444 | } |
| 446 | 445 | tar_finish(&zip); |
| 447 | 446 | blob_write_to_file(&zip, g.argv[2]); |
| 448 | 447 | } |
| @@ -591,11 +590,11 @@ | ||
| 591 | 590 | ** Optional URL Parameters: |
| 592 | 591 | ** |
| 593 | 592 | ** - name=NAME[.tar.gz] is base name of the output file. Defaults to |
| 594 | 593 | ** something project/version-specific. The prefix of the name, up to |
| 595 | 594 | ** the last '.', are used as the top-most directory name in the tar |
| 596 | -** output. | |
| 595 | +** output. | |
| 597 | 596 | ** |
| 598 | 597 | ** - uuid=the version to tar (may be a tag/branch name). |
| 599 | 598 | ** Defaults to "trunk". |
| 600 | 599 | ** |
| 601 | 600 | */ |
| 602 | 601 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -285,11 +285,11 @@ | |
| 285 | const char *zName, /* Name of the object */ |
| 286 | int nName, /* Number of characters in zName */ |
| 287 | int iMode, /* Mode. 0644 or 0755 */ |
| 288 | unsigned int mTime, /* File modification time */ |
| 289 | int iSize, /* Size of the object in bytes */ |
| 290 | char cType /* Type of object: |
| 291 | '0'==file. '2'==symlink. '5'==directory */ |
| 292 | ){ |
| 293 | /* set mode and modification time */ |
| 294 | sqlite3_snprintf(8, (char*)&tball.aHdr[100], "%07o", iMode); |
| 295 | sqlite3_snprintf(12, (char*)&tball.aHdr[136], "%011o", mTime); |
| @@ -341,11 +341,11 @@ | |
| 341 | unsigned int mTime /* Modification time */ |
| 342 | ){ |
| 343 | int i; |
| 344 | for(i=nName-1; i>0 && zName[i]!='/'; i--){} |
| 345 | if( i<=0 ) return; |
| 346 | if( i<tball.nPrevDirAlloc |
| 347 | && strncmp(tball.zPrevDir, zName, i)==0 |
| 348 | && tball.zPrevDir[i]==0 ) return; |
| 349 | db_multi_exec("INSERT OR IGNORE INTO dir VALUES('%#q')", i, zName); |
| 350 | if( sqlite3_changes(g.db)==0 ) return; |
| 351 | tar_add_directory_of(zName, i-1, mTime); |
| @@ -377,11 +377,11 @@ | |
| 377 | char cType = '0'; |
| 378 | |
| 379 | /* length check moved to tar_split_path */ |
| 380 | tar_add_directory_of(zName, nName, mTime); |
| 381 | |
| 382 | /* |
| 383 | * If we have a symlink, write its destination path (which is stored in |
| 384 | * pContent) into header, and set content length to 0 to avoid storing path |
| 385 | * as file content in the next step. Since 'linkname' header is limited to |
| 386 | * 100 bytes (-1 byte for terminating zero), if path is greater than that, |
| 387 | * store symlink as a plain-text file. (Not sure how TAR handles long links.) |
| @@ -390,11 +390,11 @@ | |
| 390 | sqlite3_snprintf(100, (char*)&tball.aHdr[157], "%s", blob_str(pContent)); |
| 391 | cType = '2'; |
| 392 | n = 0; |
| 393 | } |
| 394 | |
| 395 | tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, |
| 396 | mTime, n, cType); |
| 397 | if( n ){ |
| 398 | gzip_step(blob_buffer(pContent), n); |
| 399 | lastPage = n % 512; |
| 400 | if( lastPage!=0 ){ |
| @@ -428,21 +428,20 @@ | |
| 428 | ** that contains files given in the second and subsequent arguments. |
| 429 | */ |
| 430 | void test_tarball_cmd(void){ |
| 431 | int i; |
| 432 | Blob zip; |
| 433 | Blob file; |
| 434 | if( g.argc<3 ){ |
| 435 | usage("ARCHIVE FILE...."); |
| 436 | } |
| 437 | sqlite3_open(":memory:", &g.db); |
| 438 | tar_begin(-1); |
| 439 | for(i=3; i<g.argc; i++){ |
| 440 | blob_zero(&file); |
| 441 | blob_read_from_file(&file, g.argv[i]); |
| 442 | tar_add_file(g.argv[i], &file, |
| 443 | file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i])); |
| 444 | blob_reset(&file); |
| 445 | } |
| 446 | tar_finish(&zip); |
| 447 | blob_write_to_file(&zip, g.argv[2]); |
| 448 | } |
| @@ -591,11 +590,11 @@ | |
| 591 | ** Optional URL Parameters: |
| 592 | ** |
| 593 | ** - name=NAME[.tar.gz] is base name of the output file. Defaults to |
| 594 | ** something project/version-specific. The prefix of the name, up to |
| 595 | ** the last '.', are used as the top-most directory name in the tar |
| 596 | ** output. |
| 597 | ** |
| 598 | ** - uuid=the version to tar (may be a tag/branch name). |
| 599 | ** Defaults to "trunk". |
| 600 | ** |
| 601 | */ |
| 602 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -285,11 +285,11 @@ | |
| 285 | const char *zName, /* Name of the object */ |
| 286 | int nName, /* Number of characters in zName */ |
| 287 | int iMode, /* Mode. 0644 or 0755 */ |
| 288 | unsigned int mTime, /* File modification time */ |
| 289 | int iSize, /* Size of the object in bytes */ |
| 290 | char cType /* Type of object: |
| 291 | '0'==file. '2'==symlink. '5'==directory */ |
| 292 | ){ |
| 293 | /* set mode and modification time */ |
| 294 | sqlite3_snprintf(8, (char*)&tball.aHdr[100], "%07o", iMode); |
| 295 | sqlite3_snprintf(12, (char*)&tball.aHdr[136], "%011o", mTime); |
| @@ -341,11 +341,11 @@ | |
| 341 | unsigned int mTime /* Modification time */ |
| 342 | ){ |
| 343 | int i; |
| 344 | for(i=nName-1; i>0 && zName[i]!='/'; i--){} |
| 345 | if( i<=0 ) return; |
| 346 | if( i<tball.nPrevDirAlloc |
| 347 | && strncmp(tball.zPrevDir, zName, i)==0 |
| 348 | && tball.zPrevDir[i]==0 ) return; |
| 349 | db_multi_exec("INSERT OR IGNORE INTO dir VALUES('%#q')", i, zName); |
| 350 | if( sqlite3_changes(g.db)==0 ) return; |
| 351 | tar_add_directory_of(zName, i-1, mTime); |
| @@ -377,11 +377,11 @@ | |
| 377 | char cType = '0'; |
| 378 | |
| 379 | /* length check moved to tar_split_path */ |
| 380 | tar_add_directory_of(zName, nName, mTime); |
| 381 | |
| 382 | /* |
| 383 | * If we have a symlink, write its destination path (which is stored in |
| 384 | * pContent) into header, and set content length to 0 to avoid storing path |
| 385 | * as file content in the next step. Since 'linkname' header is limited to |
| 386 | * 100 bytes (-1 byte for terminating zero), if path is greater than that, |
| 387 | * store symlink as a plain-text file. (Not sure how TAR handles long links.) |
| @@ -390,11 +390,11 @@ | |
| 390 | sqlite3_snprintf(100, (char*)&tball.aHdr[157], "%s", blob_str(pContent)); |
| 391 | cType = '2'; |
| 392 | n = 0; |
| 393 | } |
| 394 | |
| 395 | tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, |
| 396 | mTime, n, cType); |
| 397 | if( n ){ |
| 398 | gzip_step(blob_buffer(pContent), n); |
| 399 | lastPage = n % 512; |
| 400 | if( lastPage!=0 ){ |
| @@ -428,21 +428,20 @@ | |
| 428 | ** that contains files given in the second and subsequent arguments. |
| 429 | */ |
| 430 | void test_tarball_cmd(void){ |
| 431 | int i; |
| 432 | Blob zip; |
| 433 | if( g.argc<3 ){ |
| 434 | usage("ARCHIVE FILE...."); |
| 435 | } |
| 436 | sqlite3_open(":memory:", &g.db); |
| 437 | tar_begin(-1); |
| 438 | for(i=3; i<g.argc; i++){ |
| 439 | Blob file; |
| 440 | blob_zero(&file); |
| 441 | blob_read_from_file(&file, g.argv[i]); |
| 442 | tar_add_file(g.argv[i], &file, file_wd_perm(0), file_wd_mtime(0)); |
| 443 | blob_reset(&file); |
| 444 | } |
| 445 | tar_finish(&zip); |
| 446 | blob_write_to_file(&zip, g.argv[2]); |
| 447 | } |
| @@ -591,11 +590,11 @@ | |
| 590 | ** Optional URL Parameters: |
| 591 | ** |
| 592 | ** - name=NAME[.tar.gz] is base name of the output file. Defaults to |
| 593 | ** something project/version-specific. The prefix of the name, up to |
| 594 | ** the last '.', are used as the top-most directory name in the tar |
| 595 | ** output. |
| 596 | ** |
| 597 | ** - uuid=the version to tar (may be a tag/branch name). |
| 598 | ** Defaults to "trunk". |
| 599 | ** |
| 600 | */ |
| 601 |
+10
-10
| --- src/undo.c | ||
| +++ src/undo.c | ||
| @@ -12,11 +12,11 @@ | ||
| 12 | 12 | ** Author contact information: |
| 13 | 13 | ** [email protected] |
| 14 | 14 | ** http://www.hwaci.com/drh/ |
| 15 | 15 | ** |
| 16 | 16 | ******************************************************************************* |
| 17 | -** | |
| 17 | +** | |
| 18 | 18 | ** This file implements the undo/redo functionality. |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "undo.h" |
| 22 | 22 | |
| @@ -45,19 +45,19 @@ | ||
| 45 | 45 | int old_link; |
| 46 | 46 | Blob current; |
| 47 | 47 | Blob new; |
| 48 | 48 | zFullname = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 49 | 49 | old_link = db_column_int(&q, 3); |
| 50 | - new_link = file_wd_islink(zFullname); | |
| 51 | 50 | new_exists = file_wd_size(zFullname)>=0; |
| 51 | + new_link = file_wd_islink(0); | |
| 52 | 52 | if( new_exists ){ |
| 53 | 53 | if( new_link ){ |
| 54 | 54 | blob_read_link(¤t, zFullname); |
| 55 | 55 | }else{ |
| 56 | - blob_read_from_file(¤t, zFullname); | |
| 56 | + blob_read_from_file(¤t, zFullname); | |
| 57 | 57 | } |
| 58 | - new_exe = file_wd_isexe(zFullname); | |
| 58 | + new_exe = file_wd_isexe(0); | |
| 59 | 59 | }else{ |
| 60 | 60 | blob_zero(¤t); |
| 61 | 61 | new_exe = 0; |
| 62 | 62 | } |
| 63 | 63 | blob_zero(&new); |
| @@ -86,11 +86,11 @@ | ||
| 86 | 86 | file_delete(zFullname); |
| 87 | 87 | } |
| 88 | 88 | blob_reset(&new); |
| 89 | 89 | free(zFullname); |
| 90 | 90 | db_finalize(&q); |
| 91 | - db_prepare(&q, | |
| 91 | + db_prepare(&q, | |
| 92 | 92 | "UPDATE undo SET content=:c, existsflag=%d, isExe=%d, isLink=%d," |
| 93 | 93 | " redoflag=NOT redoflag" |
| 94 | 94 | " WHERE pathname=%Q", |
| 95 | 95 | new_exists, new_exe, new_link, zPathname |
| 96 | 96 | ); |
| @@ -217,11 +217,11 @@ | ||
| 217 | 217 | ** Begin capturing a snapshot that can be undone. |
| 218 | 218 | */ |
| 219 | 219 | void undo_begin(void){ |
| 220 | 220 | int cid; |
| 221 | 221 | const char *zDb = db_name("localdb"); |
| 222 | - static const char zSql[] = | |
| 222 | + static const char zSql[] = | |
| 223 | 223 | @ CREATE TABLE "%w".undo( |
| 224 | 224 | @ pathname TEXT UNIQUE, -- Name of the file |
| 225 | 225 | @ redoflag BOOLEAN, -- 0 for undoable. 1 for redoable |
| 226 | 226 | @ existsflag BOOLEAN, -- True if the file exists |
| 227 | 227 | @ isExe BOOLEAN, -- True if the file is executable |
| @@ -240,11 +240,11 @@ | ||
| 240 | 240 | db_lset("undo_cmdline", undoCmd); |
| 241 | 241 | undoActive = 1; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /* |
| 245 | -** Permanently disable undo | |
| 245 | +** Permanently disable undo | |
| 246 | 246 | */ |
| 247 | 247 | void undo_disable(void){ |
| 248 | 248 | undoDisable = 1; |
| 249 | 249 | } |
| 250 | 250 | |
| @@ -279,11 +279,11 @@ | ||
| 279 | 279 | " VALUES(%Q,0,%d,%d,%d,:c)", |
| 280 | 280 | zPathname, existsFlag, file_wd_isexe(zFullname), isLink |
| 281 | 281 | ); |
| 282 | 282 | if( existsFlag ){ |
| 283 | 283 | if( isLink ){ |
| 284 | - blob_read_link(&content, zFullname); | |
| 284 | + blob_read_link(&content, zFullname); | |
| 285 | 285 | }else{ |
| 286 | 286 | blob_read_from_file(&content, zFullname); |
| 287 | 287 | } |
| 288 | 288 | db_bind_blob(&q, ":c", &content); |
| 289 | 289 | } |
| @@ -363,11 +363,11 @@ | ||
| 363 | 363 | ** (2) fossil merge (6) fossil stash drop |
| 364 | 364 | ** (3) fossil revert (7) fossil stash goto |
| 365 | 365 | ** (4) fossil stash pop |
| 366 | 366 | ** |
| 367 | 367 | ** If FILENAME is specified then restore the content of the named |
| 368 | -** file(s) but otherwise leave the update or merge or revert in effect. | |
| 368 | +** file(s) but otherwise leave the update or merge or revert in effect. | |
| 369 | 369 | ** The redo command undoes the effect of the most recent undo. |
| 370 | 370 | ** |
| 371 | 371 | ** If the -n|--dry-run option is present, no changes are made and instead |
| 372 | 372 | ** the undo or redo command explains what actions the undo or redo would |
| 373 | 373 | ** have done had the -n|--dry-run been omitted. |
| @@ -410,11 +410,11 @@ | ||
| 410 | 410 | if( nChng==0 ){ |
| 411 | 411 | fossil_print("The following file changes would occur if the " |
| 412 | 412 | "command above is %sne:\n\n", zCmd); |
| 413 | 413 | } |
| 414 | 414 | nChng++; |
| 415 | - fossil_print("%s %s\n", | |
| 415 | + fossil_print("%s %s\n", | |
| 416 | 416 | db_column_int(&q,0) ? "UPDATE" : "DELETE", |
| 417 | 417 | db_column_text(&q, 1) |
| 418 | 418 | ); |
| 419 | 419 | } |
| 420 | 420 | db_finalize(&q); |
| 421 | 421 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -12,11 +12,11 @@ | |
| 12 | ** Author contact information: |
| 13 | ** [email protected] |
| 14 | ** http://www.hwaci.com/drh/ |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** This file implements the undo/redo functionality. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "undo.h" |
| 22 | |
| @@ -45,19 +45,19 @@ | |
| 45 | int old_link; |
| 46 | Blob current; |
| 47 | Blob new; |
| 48 | zFullname = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 49 | old_link = db_column_int(&q, 3); |
| 50 | new_link = file_wd_islink(zFullname); |
| 51 | new_exists = file_wd_size(zFullname)>=0; |
| 52 | if( new_exists ){ |
| 53 | if( new_link ){ |
| 54 | blob_read_link(¤t, zFullname); |
| 55 | }else{ |
| 56 | blob_read_from_file(¤t, zFullname); |
| 57 | } |
| 58 | new_exe = file_wd_isexe(zFullname); |
| 59 | }else{ |
| 60 | blob_zero(¤t); |
| 61 | new_exe = 0; |
| 62 | } |
| 63 | blob_zero(&new); |
| @@ -86,11 +86,11 @@ | |
| 86 | file_delete(zFullname); |
| 87 | } |
| 88 | blob_reset(&new); |
| 89 | free(zFullname); |
| 90 | db_finalize(&q); |
| 91 | db_prepare(&q, |
| 92 | "UPDATE undo SET content=:c, existsflag=%d, isExe=%d, isLink=%d," |
| 93 | " redoflag=NOT redoflag" |
| 94 | " WHERE pathname=%Q", |
| 95 | new_exists, new_exe, new_link, zPathname |
| 96 | ); |
| @@ -217,11 +217,11 @@ | |
| 217 | ** Begin capturing a snapshot that can be undone. |
| 218 | */ |
| 219 | void undo_begin(void){ |
| 220 | int cid; |
| 221 | const char *zDb = db_name("localdb"); |
| 222 | static const char zSql[] = |
| 223 | @ CREATE TABLE "%w".undo( |
| 224 | @ pathname TEXT UNIQUE, -- Name of the file |
| 225 | @ redoflag BOOLEAN, -- 0 for undoable. 1 for redoable |
| 226 | @ existsflag BOOLEAN, -- True if the file exists |
| 227 | @ isExe BOOLEAN, -- True if the file is executable |
| @@ -240,11 +240,11 @@ | |
| 240 | db_lset("undo_cmdline", undoCmd); |
| 241 | undoActive = 1; |
| 242 | } |
| 243 | |
| 244 | /* |
| 245 | ** Permanently disable undo |
| 246 | */ |
| 247 | void undo_disable(void){ |
| 248 | undoDisable = 1; |
| 249 | } |
| 250 | |
| @@ -279,11 +279,11 @@ | |
| 279 | " VALUES(%Q,0,%d,%d,%d,:c)", |
| 280 | zPathname, existsFlag, file_wd_isexe(zFullname), isLink |
| 281 | ); |
| 282 | if( existsFlag ){ |
| 283 | if( isLink ){ |
| 284 | blob_read_link(&content, zFullname); |
| 285 | }else{ |
| 286 | blob_read_from_file(&content, zFullname); |
| 287 | } |
| 288 | db_bind_blob(&q, ":c", &content); |
| 289 | } |
| @@ -363,11 +363,11 @@ | |
| 363 | ** (2) fossil merge (6) fossil stash drop |
| 364 | ** (3) fossil revert (7) fossil stash goto |
| 365 | ** (4) fossil stash pop |
| 366 | ** |
| 367 | ** If FILENAME is specified then restore the content of the named |
| 368 | ** file(s) but otherwise leave the update or merge or revert in effect. |
| 369 | ** The redo command undoes the effect of the most recent undo. |
| 370 | ** |
| 371 | ** If the -n|--dry-run option is present, no changes are made and instead |
| 372 | ** the undo or redo command explains what actions the undo or redo would |
| 373 | ** have done had the -n|--dry-run been omitted. |
| @@ -410,11 +410,11 @@ | |
| 410 | if( nChng==0 ){ |
| 411 | fossil_print("The following file changes would occur if the " |
| 412 | "command above is %sne:\n\n", zCmd); |
| 413 | } |
| 414 | nChng++; |
| 415 | fossil_print("%s %s\n", |
| 416 | db_column_int(&q,0) ? "UPDATE" : "DELETE", |
| 417 | db_column_text(&q, 1) |
| 418 | ); |
| 419 | } |
| 420 | db_finalize(&q); |
| 421 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -12,11 +12,11 @@ | |
| 12 | ** Author contact information: |
| 13 | ** [email protected] |
| 14 | ** http://www.hwaci.com/drh/ |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** This file implements the undo/redo functionality. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "undo.h" |
| 22 | |
| @@ -45,19 +45,19 @@ | |
| 45 | int old_link; |
| 46 | Blob current; |
| 47 | Blob new; |
| 48 | zFullname = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 49 | old_link = db_column_int(&q, 3); |
| 50 | new_exists = file_wd_size(zFullname)>=0; |
| 51 | new_link = file_wd_islink(0); |
| 52 | if( new_exists ){ |
| 53 | if( new_link ){ |
| 54 | blob_read_link(¤t, zFullname); |
| 55 | }else{ |
| 56 | blob_read_from_file(¤t, zFullname); |
| 57 | } |
| 58 | new_exe = file_wd_isexe(0); |
| 59 | }else{ |
| 60 | blob_zero(¤t); |
| 61 | new_exe = 0; |
| 62 | } |
| 63 | blob_zero(&new); |
| @@ -86,11 +86,11 @@ | |
| 86 | file_delete(zFullname); |
| 87 | } |
| 88 | blob_reset(&new); |
| 89 | free(zFullname); |
| 90 | db_finalize(&q); |
| 91 | db_prepare(&q, |
| 92 | "UPDATE undo SET content=:c, existsflag=%d, isExe=%d, isLink=%d," |
| 93 | " redoflag=NOT redoflag" |
| 94 | " WHERE pathname=%Q", |
| 95 | new_exists, new_exe, new_link, zPathname |
| 96 | ); |
| @@ -217,11 +217,11 @@ | |
| 217 | ** Begin capturing a snapshot that can be undone. |
| 218 | */ |
| 219 | void undo_begin(void){ |
| 220 | int cid; |
| 221 | const char *zDb = db_name("localdb"); |
| 222 | static const char zSql[] = |
| 223 | @ CREATE TABLE "%w".undo( |
| 224 | @ pathname TEXT UNIQUE, -- Name of the file |
| 225 | @ redoflag BOOLEAN, -- 0 for undoable. 1 for redoable |
| 226 | @ existsflag BOOLEAN, -- True if the file exists |
| 227 | @ isExe BOOLEAN, -- True if the file is executable |
| @@ -240,11 +240,11 @@ | |
| 240 | db_lset("undo_cmdline", undoCmd); |
| 241 | undoActive = 1; |
| 242 | } |
| 243 | |
| 244 | /* |
| 245 | ** Permanently disable undo |
| 246 | */ |
| 247 | void undo_disable(void){ |
| 248 | undoDisable = 1; |
| 249 | } |
| 250 | |
| @@ -279,11 +279,11 @@ | |
| 279 | " VALUES(%Q,0,%d,%d,%d,:c)", |
| 280 | zPathname, existsFlag, file_wd_isexe(zFullname), isLink |
| 281 | ); |
| 282 | if( existsFlag ){ |
| 283 | if( isLink ){ |
| 284 | blob_read_link(&content, zFullname); |
| 285 | }else{ |
| 286 | blob_read_from_file(&content, zFullname); |
| 287 | } |
| 288 | db_bind_blob(&q, ":c", &content); |
| 289 | } |
| @@ -363,11 +363,11 @@ | |
| 363 | ** (2) fossil merge (6) fossil stash drop |
| 364 | ** (3) fossil revert (7) fossil stash goto |
| 365 | ** (4) fossil stash pop |
| 366 | ** |
| 367 | ** If FILENAME is specified then restore the content of the named |
| 368 | ** file(s) but otherwise leave the update or merge or revert in effect. |
| 369 | ** The redo command undoes the effect of the most recent undo. |
| 370 | ** |
| 371 | ** If the -n|--dry-run option is present, no changes are made and instead |
| 372 | ** the undo or redo command explains what actions the undo or redo would |
| 373 | ** have done had the -n|--dry-run been omitted. |
| @@ -410,11 +410,11 @@ | |
| 410 | if( nChng==0 ){ |
| 411 | fossil_print("The following file changes would occur if the " |
| 412 | "command above is %sne:\n\n", zCmd); |
| 413 | } |
| 414 | nChng++; |
| 415 | fossil_print("%s %s\n", |
| 416 | db_column_int(&q,0) ? "UPDATE" : "DELETE", |
| 417 | db_column_text(&q, 1) |
| 418 | ); |
| 419 | } |
| 420 | db_finalize(&q); |
| 421 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -809,11 +809,11 @@ | ||
| 809 | 809 | zFile, zFile |
| 810 | 810 | ); |
| 811 | 811 | }else{ |
| 812 | 812 | sqlite3_int64 mtime; |
| 813 | 813 | undo_save(zFile); |
| 814 | - if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){ | |
| 814 | + if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(0)) ){ | |
| 815 | 815 | file_delete(zFull); |
| 816 | 816 | } |
| 817 | 817 | if( isLink ){ |
| 818 | 818 | symlink_create(blob_str(&record), zFull); |
| 819 | 819 | }else{ |
| 820 | 820 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -809,11 +809,11 @@ | |
| 809 | zFile, zFile |
| 810 | ); |
| 811 | }else{ |
| 812 | sqlite3_int64 mtime; |
| 813 | undo_save(zFile); |
| 814 | if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){ |
| 815 | file_delete(zFull); |
| 816 | } |
| 817 | if( isLink ){ |
| 818 | symlink_create(blob_str(&record), zFull); |
| 819 | }else{ |
| 820 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -809,11 +809,11 @@ | |
| 809 | zFile, zFile |
| 810 | ); |
| 811 | }else{ |
| 812 | sqlite3_int64 mtime; |
| 813 | undo_save(zFile); |
| 814 | if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(0)) ){ |
| 815 | file_delete(zFull); |
| 816 | } |
| 817 | if( isLink ){ |
| 818 | symlink_create(blob_str(&record), zFull); |
| 819 | }else{ |
| 820 |
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -189,12 +189,12 @@ | ||
| 189 | 189 | zName = db_column_text(&q, 1); |
| 190 | 190 | rid = db_column_int(&q, 2); |
| 191 | 191 | isDeleted = db_column_int(&q, 3); |
| 192 | 192 | oldChnged = chnged = db_column_int(&q, 4); |
| 193 | 193 | oldMtime = db_column_int64(&q, 7); |
| 194 | - currentSize = file_wd_size(zName); | |
| 195 | 194 | origSize = db_column_int64(&q, 6); |
| 195 | + currentSize = file_wd_size(zName); | |
| 196 | 196 | currentMtime = file_wd_mtime(0); |
| 197 | 197 | if( chnged==0 && (isDeleted || rid==0) ){ |
| 198 | 198 | /* "fossil rm" or "fossil add" always change the file */ |
| 199 | 199 | chnged = 1; |
| 200 | 200 | }else if( !file_wd_isfile_or_link(0) && currentSize>=0 ){ |
| @@ -320,11 +320,11 @@ | ||
| 320 | 320 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 321 | 321 | if( file_wd_isdir(zName) == 1 ){ |
| 322 | 322 | /*TODO(dchest): remove directories? */ |
| 323 | 323 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 324 | 324 | } |
| 325 | - if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ | |
| 325 | + if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(0)) ){ | |
| 326 | 326 | file_delete(zName); |
| 327 | 327 | } |
| 328 | 328 | if( isLink ){ |
| 329 | 329 | symlink_create(blob_str(&content), zName); |
| 330 | 330 | }else{ |
| 331 | 331 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -189,12 +189,12 @@ | |
| 189 | zName = db_column_text(&q, 1); |
| 190 | rid = db_column_int(&q, 2); |
| 191 | isDeleted = db_column_int(&q, 3); |
| 192 | oldChnged = chnged = db_column_int(&q, 4); |
| 193 | oldMtime = db_column_int64(&q, 7); |
| 194 | currentSize = file_wd_size(zName); |
| 195 | origSize = db_column_int64(&q, 6); |
| 196 | currentMtime = file_wd_mtime(0); |
| 197 | if( chnged==0 && (isDeleted || rid==0) ){ |
| 198 | /* "fossil rm" or "fossil add" always change the file */ |
| 199 | chnged = 1; |
| 200 | }else if( !file_wd_isfile_or_link(0) && currentSize>=0 ){ |
| @@ -320,11 +320,11 @@ | |
| 320 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 321 | if( file_wd_isdir(zName) == 1 ){ |
| 322 | /*TODO(dchest): remove directories? */ |
| 323 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 324 | } |
| 325 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 326 | file_delete(zName); |
| 327 | } |
| 328 | if( isLink ){ |
| 329 | symlink_create(blob_str(&content), zName); |
| 330 | }else{ |
| 331 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -189,12 +189,12 @@ | |
| 189 | zName = db_column_text(&q, 1); |
| 190 | rid = db_column_int(&q, 2); |
| 191 | isDeleted = db_column_int(&q, 3); |
| 192 | oldChnged = chnged = db_column_int(&q, 4); |
| 193 | oldMtime = db_column_int64(&q, 7); |
| 194 | origSize = db_column_int64(&q, 6); |
| 195 | currentSize = file_wd_size(zName); |
| 196 | currentMtime = file_wd_mtime(0); |
| 197 | if( chnged==0 && (isDeleted || rid==0) ){ |
| 198 | /* "fossil rm" or "fossil add" always change the file */ |
| 199 | chnged = 1; |
| 200 | }else if( !file_wd_isfile_or_link(0) && currentSize>=0 ){ |
| @@ -320,11 +320,11 @@ | |
| 320 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 321 | if( file_wd_isdir(zName) == 1 ){ |
| 322 | /*TODO(dchest): remove directories? */ |
| 323 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 324 | } |
| 325 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(0)) ){ |
| 326 | file_delete(zName); |
| 327 | } |
| 328 | if( isLink ){ |
| 329 | symlink_create(blob_str(&content), zName); |
| 330 | }else{ |
| 331 |