Fossil SCM
Add support for the "l" flag to the "manifest" setting to enable creation of a file "manifest.symlinks" which lists the names of all symlinks
Commit
8d6bdd1e00cf2cf8bc7fd101fcff023a915428e13e7f64bb8dde201a416f7aae
Parent
00ced6df65596f4…
7 files changed
+5
-4
+10
+35
-4
+11
-9
+15
+16
+2
+5
-4
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -78,15 +78,16 @@ | ||
| 78 | 78 | */ |
| 79 | 79 | static const struct { |
| 80 | 80 | const char *fname; |
| 81 | 81 | int flg; |
| 82 | 82 | }aManifestflags[] = { |
| 83 | - { "manifest", MFESTFLG_RAW }, | |
| 84 | - { "manifest.uuid", MFESTFLG_UUID }, | |
| 85 | - { "manifest.tags", MFESTFLG_TAGS } | |
| 83 | + { "manifest", MFESTFLG_RAW }, | |
| 84 | + { "manifest.uuid", MFESTFLG_UUID }, | |
| 85 | + { "manifest.tags", MFESTFLG_TAGS }, | |
| 86 | + { "manifest.symlinks", MFESTFLG_SYMLINKS } | |
| 86 | 87 | }; |
| 87 | - static const char *azManifests[3]; | |
| 88 | + static const char *azManifests[4]; | |
| 88 | 89 | |
| 89 | 90 | /* |
| 90 | 91 | ** Names of repository files, if they exist in the checkout. |
| 91 | 92 | */ |
| 92 | 93 | static const char *azRepo[4] = { 0, 0, 0, 0 }; |
| 93 | 94 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -78,15 +78,16 @@ | |
| 78 | */ |
| 79 | static const struct { |
| 80 | const char *fname; |
| 81 | int flg; |
| 82 | }aManifestflags[] = { |
| 83 | { "manifest", MFESTFLG_RAW }, |
| 84 | { "manifest.uuid", MFESTFLG_UUID }, |
| 85 | { "manifest.tags", MFESTFLG_TAGS } |
| 86 | }; |
| 87 | static const char *azManifests[3]; |
| 88 | |
| 89 | /* |
| 90 | ** Names of repository files, if they exist in the checkout. |
| 91 | */ |
| 92 | static const char *azRepo[4] = { 0, 0, 0, 0 }; |
| 93 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -78,15 +78,16 @@ | |
| 78 | */ |
| 79 | static const struct { |
| 80 | const char *fname; |
| 81 | int flg; |
| 82 | }aManifestflags[] = { |
| 83 | { "manifest", MFESTFLG_RAW }, |
| 84 | { "manifest.uuid", MFESTFLG_UUID }, |
| 85 | { "manifest.tags", MFESTFLG_TAGS }, |
| 86 | { "manifest.symlinks", MFESTFLG_SYMLINKS } |
| 87 | }; |
| 88 | static const char *azManifests[4]; |
| 89 | |
| 90 | /* |
| 91 | ** Names of repository files, if they exist in the checkout. |
| 92 | */ |
| 93 | static const char *azRepo[4] = { 0, 0, 0, 0 }; |
| 94 |
+10
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2613,10 +2613,20 @@ | ||
| 2613 | 2613 | get_checkin_taglist(nvid, &tagslist); |
| 2614 | 2614 | blob_write_to_file(&tagslist, zManifestFile); |
| 2615 | 2615 | blob_reset(&tagslist); |
| 2616 | 2616 | free(zManifestFile); |
| 2617 | 2617 | } |
| 2618 | + | |
| 2619 | + if( outputManifest & MFESTFLG_SYMLINKS ){ | |
| 2620 | + Blob symlinkslist; | |
| 2621 | + zManifestFile = mprintf("%smanifest.symlinks", g.zLocalRoot); | |
| 2622 | + blob_zero(&symlinkslist); | |
| 2623 | + get_checkin_symlinklist(nvid, &symlinkslist); | |
| 2624 | + blob_write_to_file(&symlinkslist, zManifestFile); | |
| 2625 | + blob_reset(&symlinkslist); | |
| 2626 | + free(zManifestFile); | |
| 2627 | + } | |
| 2618 | 2628 | |
| 2619 | 2629 | if( !g.markPrivate ){ |
| 2620 | 2630 | autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0); |
| 2621 | 2631 | } |
| 2622 | 2632 | if( count_nonbranch_children(vid)>1 ){ |
| 2623 | 2633 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2613,10 +2613,20 @@ | |
| 2613 | get_checkin_taglist(nvid, &tagslist); |
| 2614 | blob_write_to_file(&tagslist, zManifestFile); |
| 2615 | blob_reset(&tagslist); |
| 2616 | free(zManifestFile); |
| 2617 | } |
| 2618 | |
| 2619 | if( !g.markPrivate ){ |
| 2620 | autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0); |
| 2621 | } |
| 2622 | if( count_nonbranch_children(vid)>1 ){ |
| 2623 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2613,10 +2613,20 @@ | |
| 2613 | get_checkin_taglist(nvid, &tagslist); |
| 2614 | blob_write_to_file(&tagslist, zManifestFile); |
| 2615 | blob_reset(&tagslist); |
| 2616 | free(zManifestFile); |
| 2617 | } |
| 2618 | |
| 2619 | if( outputManifest & MFESTFLG_SYMLINKS ){ |
| 2620 | Blob symlinkslist; |
| 2621 | zManifestFile = mprintf("%smanifest.symlinks", g.zLocalRoot); |
| 2622 | blob_zero(&symlinkslist); |
| 2623 | get_checkin_symlinklist(nvid, &symlinkslist); |
| 2624 | blob_write_to_file(&symlinkslist, zManifestFile); |
| 2625 | blob_reset(&symlinkslist); |
| 2626 | free(zManifestFile); |
| 2627 | } |
| 2628 | |
| 2629 | if( !g.markPrivate ){ |
| 2630 | autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0); |
| 2631 | } |
| 2632 | if( count_nonbranch_children(vid)>1 ){ |
| 2633 |
+35
-4
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -93,12 +93,11 @@ | ||
| 93 | 93 | db_reset(&s); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /* |
| 97 | 97 | ** Set or clear the execute permission bit (as appropriate) for all |
| 98 | -** files in the current check-out, and replace files that have | |
| 99 | -** symlink bit with actual symlinks. | |
| 98 | +** files in the current check-out. | |
| 100 | 99 | */ |
| 101 | 100 | void checkout_set_all_exe(int vid){ |
| 102 | 101 | Blob filename; |
| 103 | 102 | int baseLen; |
| 104 | 103 | Manifest *pManifest; |
| @@ -128,17 +127,18 @@ | ||
| 128 | 127 | /* |
| 129 | 128 | ** If the "manifest" setting is true, then automatically generate |
| 130 | 129 | ** files named "manifest" and "manifest.uuid" containing, respectively, |
| 131 | 130 | ** the text of the manifest and the artifact ID of the manifest. |
| 132 | 131 | ** If the manifest setting is set, but is not a boolean value, then treat |
| 133 | -** each character as a flag to enable writing "manifest", "manifest.uuid" or | |
| 134 | -** "manifest.tags". | |
| 132 | +** each character as a flag to enable writing "manifest", "manifest.uuid", | |
| 133 | +** "manifest.tags", or "manifest.symlinks". | |
| 135 | 134 | */ |
| 136 | 135 | void manifest_to_disk(int vid){ |
| 137 | 136 | char *zManFile; |
| 138 | 137 | Blob manifest; |
| 139 | 138 | Blob taglist; |
| 139 | + Blob symlinklist; | |
| 140 | 140 | int flg; |
| 141 | 141 | |
| 142 | 142 | flg = db_get_manifest_setting(); |
| 143 | 143 | |
| 144 | 144 | if( flg & MFESTFLG_RAW ){ |
| @@ -182,10 +182,24 @@ | ||
| 182 | 182 | zManFile = mprintf("%smanifest.tags", g.zLocalRoot); |
| 183 | 183 | file_delete(zManFile); |
| 184 | 184 | free(zManFile); |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | + if( flg & MFESTFLG_SYMLINKS ){ | |
| 188 | + blob_zero(&symlinklist); | |
| 189 | + zManFile = mprintf("%smanifest.symlinks", g.zLocalRoot); | |
| 190 | + get_checkin_symlinklist(vid, &symlinklist); | |
| 191 | + blob_write_to_file(&symlinklist, zManFile); | |
| 192 | + free(zManFile); | |
| 193 | + blob_reset(&symlinklist); | |
| 194 | + }else{ | |
| 195 | + if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.symlinks'") ){ | |
| 196 | + zManFile = mprintf("%smanifest.symlinks", g.zLocalRoot); | |
| 197 | + file_delete(zManFile); | |
| 198 | + free(zManFile); | |
| 199 | + } | |
| 200 | + } | |
| 187 | 201 | } |
| 188 | 202 | |
| 189 | 203 | /* |
| 190 | 204 | ** Find the branch name and all symbolic tags for a particular check-in |
| 191 | 205 | ** identified by "rid". |
| @@ -216,10 +230,27 @@ | ||
| 216 | 230 | } |
| 217 | 231 | db_reset(&stmt); |
| 218 | 232 | db_finalize(&stmt); |
| 219 | 233 | } |
| 220 | 234 | |
| 235 | +/* | |
| 236 | +** Store into "pOut" a sorted list of all symlinks in a checkin "rid". Each | |
| 237 | +** entry in the list is the full name of the symlink (not the name of its | |
| 238 | +** target) followed by a newline. | |
| 239 | +*/ | |
| 240 | +void get_checkin_symlinklist(int rid, Blob *pOut){ | |
| 241 | + Manifest *pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 242 | + ManifestFile *pFile; | |
| 243 | + blob_reset(pOut); | |
| 244 | + manifest_file_rewind(pManifest); | |
| 245 | + while( (pFile = manifest_file_next(pManifest, 0)) ){ | |
| 246 | + if( pFile->zPerm && strstr(pFile->zPerm, "l") ){ | |
| 247 | + blob_appendf(pOut, "%s\n", pFile->zName); | |
| 248 | + } | |
| 249 | + } | |
| 250 | + manifest_destroy(pManifest); | |
| 251 | +} | |
| 221 | 252 | |
| 222 | 253 | /* |
| 223 | 254 | ** COMMAND: checkout* |
| 224 | 255 | ** COMMAND: co* |
| 225 | 256 | ** |
| 226 | 257 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -93,12 +93,11 @@ | |
| 93 | db_reset(&s); |
| 94 | } |
| 95 | |
| 96 | /* |
| 97 | ** Set or clear the execute permission bit (as appropriate) for all |
| 98 | ** files in the current check-out, and replace files that have |
| 99 | ** symlink bit with actual symlinks. |
| 100 | */ |
| 101 | void checkout_set_all_exe(int vid){ |
| 102 | Blob filename; |
| 103 | int baseLen; |
| 104 | Manifest *pManifest; |
| @@ -128,17 +127,18 @@ | |
| 128 | /* |
| 129 | ** If the "manifest" setting is true, then automatically generate |
| 130 | ** files named "manifest" and "manifest.uuid" containing, respectively, |
| 131 | ** the text of the manifest and the artifact ID of the manifest. |
| 132 | ** If the manifest setting is set, but is not a boolean value, then treat |
| 133 | ** each character as a flag to enable writing "manifest", "manifest.uuid" or |
| 134 | ** "manifest.tags". |
| 135 | */ |
| 136 | void manifest_to_disk(int vid){ |
| 137 | char *zManFile; |
| 138 | Blob manifest; |
| 139 | Blob taglist; |
| 140 | int flg; |
| 141 | |
| 142 | flg = db_get_manifest_setting(); |
| 143 | |
| 144 | if( flg & MFESTFLG_RAW ){ |
| @@ -182,10 +182,24 @@ | |
| 182 | zManFile = mprintf("%smanifest.tags", g.zLocalRoot); |
| 183 | file_delete(zManFile); |
| 184 | free(zManFile); |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /* |
| 190 | ** Find the branch name and all symbolic tags for a particular check-in |
| 191 | ** identified by "rid". |
| @@ -216,10 +230,27 @@ | |
| 216 | } |
| 217 | db_reset(&stmt); |
| 218 | db_finalize(&stmt); |
| 219 | } |
| 220 | |
| 221 | |
| 222 | /* |
| 223 | ** COMMAND: checkout* |
| 224 | ** COMMAND: co* |
| 225 | ** |
| 226 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -93,12 +93,11 @@ | |
| 93 | db_reset(&s); |
| 94 | } |
| 95 | |
| 96 | /* |
| 97 | ** Set or clear the execute permission bit (as appropriate) for all |
| 98 | ** files in the current check-out. |
| 99 | */ |
| 100 | void checkout_set_all_exe(int vid){ |
| 101 | Blob filename; |
| 102 | int baseLen; |
| 103 | Manifest *pManifest; |
| @@ -128,17 +127,18 @@ | |
| 127 | /* |
| 128 | ** If the "manifest" setting is true, then automatically generate |
| 129 | ** files named "manifest" and "manifest.uuid" containing, respectively, |
| 130 | ** the text of the manifest and the artifact ID of the manifest. |
| 131 | ** If the manifest setting is set, but is not a boolean value, then treat |
| 132 | ** each character as a flag to enable writing "manifest", "manifest.uuid", |
| 133 | ** "manifest.tags", or "manifest.symlinks". |
| 134 | */ |
| 135 | void manifest_to_disk(int vid){ |
| 136 | char *zManFile; |
| 137 | Blob manifest; |
| 138 | Blob taglist; |
| 139 | Blob symlinklist; |
| 140 | int flg; |
| 141 | |
| 142 | flg = db_get_manifest_setting(); |
| 143 | |
| 144 | if( flg & MFESTFLG_RAW ){ |
| @@ -182,10 +182,24 @@ | |
| 182 | zManFile = mprintf("%smanifest.tags", g.zLocalRoot); |
| 183 | file_delete(zManFile); |
| 184 | free(zManFile); |
| 185 | } |
| 186 | } |
| 187 | if( flg & MFESTFLG_SYMLINKS ){ |
| 188 | blob_zero(&symlinklist); |
| 189 | zManFile = mprintf("%smanifest.symlinks", g.zLocalRoot); |
| 190 | get_checkin_symlinklist(vid, &symlinklist); |
| 191 | blob_write_to_file(&symlinklist, zManFile); |
| 192 | free(zManFile); |
| 193 | blob_reset(&symlinklist); |
| 194 | }else{ |
| 195 | if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.symlinks'") ){ |
| 196 | zManFile = mprintf("%smanifest.symlinks", g.zLocalRoot); |
| 197 | file_delete(zManFile); |
| 198 | free(zManFile); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | /* |
| 204 | ** Find the branch name and all symbolic tags for a particular check-in |
| 205 | ** identified by "rid". |
| @@ -216,10 +230,27 @@ | |
| 230 | } |
| 231 | db_reset(&stmt); |
| 232 | db_finalize(&stmt); |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 | ** Store into "pOut" a sorted list of all symlinks in a checkin "rid". Each |
| 237 | ** entry in the list is the full name of the symlink (not the name of its |
| 238 | ** target) followed by a newline. |
| 239 | */ |
| 240 | void get_checkin_symlinklist(int rid, Blob *pOut){ |
| 241 | Manifest *pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 242 | ManifestFile *pFile; |
| 243 | blob_reset(pOut); |
| 244 | manifest_file_rewind(pManifest); |
| 245 | while( (pFile = manifest_file_next(pManifest, 0)) ){ |
| 246 | if( pFile->zPerm && strstr(pFile->zPerm, "l") ){ |
| 247 | blob_appendf(pOut, "%s\n", pFile->zName); |
| 248 | } |
| 249 | } |
| 250 | manifest_destroy(pManifest); |
| 251 | } |
| 252 | |
| 253 | /* |
| 254 | ** COMMAND: checkout* |
| 255 | ** COMMAND: co* |
| 256 | ** |
| 257 |
M
src/db.c
+11
-9
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2475,13 +2475,14 @@ | ||
| 2475 | 2475 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 2476 | 2476 | } |
| 2477 | 2477 | |
| 2478 | 2478 | #if INTERFACE |
| 2479 | 2479 | /* Manifest generation flags */ |
| 2480 | -#define MFESTFLG_RAW 0x01 | |
| 2481 | -#define MFESTFLG_UUID 0x02 | |
| 2482 | -#define MFESTFLG_TAGS 0x04 | |
| 2480 | +#define MFESTFLG_RAW 0x01 | |
| 2481 | +#define MFESTFLG_UUID 0x02 | |
| 2482 | +#define MFESTFLG_TAGS 0x04 | |
| 2483 | +#define MFESTFLG_SYMLINKS 0x08 | |
| 2483 | 2484 | #endif /* INTERFACE */ |
| 2484 | 2485 | |
| 2485 | 2486 | /* |
| 2486 | 2487 | ** Get the manifest setting. For backwards compatibility first check if the |
| 2487 | 2488 | ** value is a boolean. If it's not a boolean, treat each character as a flag |
| @@ -2498,13 +2499,14 @@ | ||
| 2498 | 2499 | return MFESTFLG_RAW|MFESTFLG_UUID; |
| 2499 | 2500 | } |
| 2500 | 2501 | flg = 0; |
| 2501 | 2502 | while( *zVal ){ |
| 2502 | 2503 | switch( *zVal ){ |
| 2503 | - case 'r': flg |= MFESTFLG_RAW; break; | |
| 2504 | - case 'u': flg |= MFESTFLG_UUID; break; | |
| 2505 | - case 't': flg |= MFESTFLG_TAGS; break; | |
| 2504 | + case 'r': flg |= MFESTFLG_RAW; break; | |
| 2505 | + case 'u': flg |= MFESTFLG_UUID; break; | |
| 2506 | + case 't': flg |= MFESTFLG_TAGS; break; | |
| 2507 | + case 'l': flg |= MFESTFLG_SYMLINKS; break; | |
| 2506 | 2508 | } |
| 2507 | 2509 | zVal++; |
| 2508 | 2510 | } |
| 2509 | 2511 | return flg; |
| 2510 | 2512 | } |
| @@ -2982,13 +2984,13 @@ | ||
| 2982 | 2984 | /* |
| 2983 | 2985 | ** SETTING: manifest width=5 versionable |
| 2984 | 2986 | ** If enabled, automatically create files "manifest" and "manifest.uuid" |
| 2985 | 2987 | ** in every checkout. |
| 2986 | 2988 | ** |
| 2987 | -** Optionally use combinations of characters 'r' for "manifest", | |
| 2988 | -** 'u' for "manifest.uuid" and 't' for "manifest.tags". The SQLite | |
| 2989 | -** and Fossil repositories both require manifests. | |
| 2989 | +** Optionally use combinations of characters 'r' for "manifest", 'u' for | |
| 2990 | +** "manifest.uuid", 't' for "manifest.tags", and 'l' for "manifest.symlinks". | |
| 2991 | +** The SQLite and Fossil repositories both require manifests. | |
| 2990 | 2992 | */ |
| 2991 | 2993 | /* |
| 2992 | 2994 | ** SETTING: max-loadavg width=25 default=0.0 |
| 2993 | 2995 | ** Some CPU-intensive web pages (ex: /zip, /tarball, /blame) |
| 2994 | 2996 | ** are disallowed if the system load average goes above this |
| 2995 | 2997 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2475,13 +2475,14 @@ | |
| 2475 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 2476 | } |
| 2477 | |
| 2478 | #if INTERFACE |
| 2479 | /* Manifest generation flags */ |
| 2480 | #define MFESTFLG_RAW 0x01 |
| 2481 | #define MFESTFLG_UUID 0x02 |
| 2482 | #define MFESTFLG_TAGS 0x04 |
| 2483 | #endif /* INTERFACE */ |
| 2484 | |
| 2485 | /* |
| 2486 | ** Get the manifest setting. For backwards compatibility first check if the |
| 2487 | ** value is a boolean. If it's not a boolean, treat each character as a flag |
| @@ -2498,13 +2499,14 @@ | |
| 2498 | return MFESTFLG_RAW|MFESTFLG_UUID; |
| 2499 | } |
| 2500 | flg = 0; |
| 2501 | while( *zVal ){ |
| 2502 | switch( *zVal ){ |
| 2503 | case 'r': flg |= MFESTFLG_RAW; break; |
| 2504 | case 'u': flg |= MFESTFLG_UUID; break; |
| 2505 | case 't': flg |= MFESTFLG_TAGS; break; |
| 2506 | } |
| 2507 | zVal++; |
| 2508 | } |
| 2509 | return flg; |
| 2510 | } |
| @@ -2982,13 +2984,13 @@ | |
| 2982 | /* |
| 2983 | ** SETTING: manifest width=5 versionable |
| 2984 | ** If enabled, automatically create files "manifest" and "manifest.uuid" |
| 2985 | ** in every checkout. |
| 2986 | ** |
| 2987 | ** Optionally use combinations of characters 'r' for "manifest", |
| 2988 | ** 'u' for "manifest.uuid" and 't' for "manifest.tags". The SQLite |
| 2989 | ** and Fossil repositories both require manifests. |
| 2990 | */ |
| 2991 | /* |
| 2992 | ** SETTING: max-loadavg width=25 default=0.0 |
| 2993 | ** Some CPU-intensive web pages (ex: /zip, /tarball, /blame) |
| 2994 | ** are disallowed if the system load average goes above this |
| 2995 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2475,13 +2475,14 @@ | |
| 2475 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 2476 | } |
| 2477 | |
| 2478 | #if INTERFACE |
| 2479 | /* Manifest generation flags */ |
| 2480 | #define MFESTFLG_RAW 0x01 |
| 2481 | #define MFESTFLG_UUID 0x02 |
| 2482 | #define MFESTFLG_TAGS 0x04 |
| 2483 | #define MFESTFLG_SYMLINKS 0x08 |
| 2484 | #endif /* INTERFACE */ |
| 2485 | |
| 2486 | /* |
| 2487 | ** Get the manifest setting. For backwards compatibility first check if the |
| 2488 | ** value is a boolean. If it's not a boolean, treat each character as a flag |
| @@ -2498,13 +2499,14 @@ | |
| 2499 | return MFESTFLG_RAW|MFESTFLG_UUID; |
| 2500 | } |
| 2501 | flg = 0; |
| 2502 | while( *zVal ){ |
| 2503 | switch( *zVal ){ |
| 2504 | case 'r': flg |= MFESTFLG_RAW; break; |
| 2505 | case 'u': flg |= MFESTFLG_UUID; break; |
| 2506 | case 't': flg |= MFESTFLG_TAGS; break; |
| 2507 | case 'l': flg |= MFESTFLG_SYMLINKS; break; |
| 2508 | } |
| 2509 | zVal++; |
| 2510 | } |
| 2511 | return flg; |
| 2512 | } |
| @@ -2982,13 +2984,13 @@ | |
| 2984 | /* |
| 2985 | ** SETTING: manifest width=5 versionable |
| 2986 | ** If enabled, automatically create files "manifest" and "manifest.uuid" |
| 2987 | ** in every checkout. |
| 2988 | ** |
| 2989 | ** Optionally use combinations of characters 'r' for "manifest", 'u' for |
| 2990 | ** "manifest.uuid", 't' for "manifest.tags", and 'l' for "manifest.symlinks". |
| 2991 | ** The SQLite and Fossil repositories both require manifests. |
| 2992 | */ |
| 2993 | /* |
| 2994 | ** SETTING: max-loadavg width=25 default=0.0 |
| 2995 | ** Some CPU-intensive web pages (ex: /zip, /tarball, /blame) |
| 2996 | ** are disallowed if the system load average goes above this |
| 2997 |
+15
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -514,10 +514,15 @@ | ||
| 514 | 514 | if( (pInclude==0 || glob_match(pInclude, "manifest.tags")) |
| 515 | 515 | && !glob_match(pExclude, "manifest.tags") |
| 516 | 516 | && (flg & MFESTFLG_TAGS) ){ |
| 517 | 517 | eflg |= MFESTFLG_TAGS; |
| 518 | 518 | } |
| 519 | + if( (pInclude==0 || glob_match(pInclude, "manifest.symlinks")) | |
| 520 | + && !glob_match(pExclude, "manifest.symlinks") | |
| 521 | + && (flg & MFESTFLG_SYMLINKS) ){ | |
| 522 | + eflg |= MFESTFLG_SYMLINKS; | |
| 523 | + } | |
| 519 | 524 | |
| 520 | 525 | if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){ |
| 521 | 526 | if( eflg & MFESTFLG_RAW ){ |
| 522 | 527 | blob_append(&filename, "manifest", -1); |
| 523 | 528 | zName = blob_str(&filename); |
| @@ -542,10 +547,20 @@ | ||
| 542 | 547 | blob_resize(&filename, nPrefix); |
| 543 | 548 | blob_append(&filename, "manifest.tags", -1); |
| 544 | 549 | zName = blob_str(&filename); |
| 545 | 550 | tar_add_file(zName, &tagslist, 0, mTime); |
| 546 | 551 | blob_reset(&tagslist); |
| 552 | + } | |
| 553 | + if( eflg & MFESTFLG_SYMLINKS ){ | |
| 554 | + Blob symlinklist; | |
| 555 | + blob_zero(&symlinklist); | |
| 556 | + get_checkin_symlinklist(rid, &symlinklist); | |
| 557 | + blob_resize(&filename, nPrefix); | |
| 558 | + blob_append(&filename, "manifest.symlinks", -1); | |
| 559 | + zName = blob_str(&filename); | |
| 560 | + tar_add_file(zName, &symlinklist, 0, mTime); | |
| 561 | + blob_reset(&symlinklist); | |
| 547 | 562 | } |
| 548 | 563 | } |
| 549 | 564 | manifest_file_rewind(pManifest); |
| 550 | 565 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 551 | 566 | int fid; |
| 552 | 567 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -514,10 +514,15 @@ | |
| 514 | if( (pInclude==0 || glob_match(pInclude, "manifest.tags")) |
| 515 | && !glob_match(pExclude, "manifest.tags") |
| 516 | && (flg & MFESTFLG_TAGS) ){ |
| 517 | eflg |= MFESTFLG_TAGS; |
| 518 | } |
| 519 | |
| 520 | if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){ |
| 521 | if( eflg & MFESTFLG_RAW ){ |
| 522 | blob_append(&filename, "manifest", -1); |
| 523 | zName = blob_str(&filename); |
| @@ -542,10 +547,20 @@ | |
| 542 | blob_resize(&filename, nPrefix); |
| 543 | blob_append(&filename, "manifest.tags", -1); |
| 544 | zName = blob_str(&filename); |
| 545 | tar_add_file(zName, &tagslist, 0, mTime); |
| 546 | blob_reset(&tagslist); |
| 547 | } |
| 548 | } |
| 549 | manifest_file_rewind(pManifest); |
| 550 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 551 | int fid; |
| 552 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -514,10 +514,15 @@ | |
| 514 | if( (pInclude==0 || glob_match(pInclude, "manifest.tags")) |
| 515 | && !glob_match(pExclude, "manifest.tags") |
| 516 | && (flg & MFESTFLG_TAGS) ){ |
| 517 | eflg |= MFESTFLG_TAGS; |
| 518 | } |
| 519 | if( (pInclude==0 || glob_match(pInclude, "manifest.symlinks")) |
| 520 | && !glob_match(pExclude, "manifest.symlinks") |
| 521 | && (flg & MFESTFLG_SYMLINKS) ){ |
| 522 | eflg |= MFESTFLG_SYMLINKS; |
| 523 | } |
| 524 | |
| 525 | if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){ |
| 526 | if( eflg & MFESTFLG_RAW ){ |
| 527 | blob_append(&filename, "manifest", -1); |
| 528 | zName = blob_str(&filename); |
| @@ -542,10 +547,20 @@ | |
| 547 | blob_resize(&filename, nPrefix); |
| 548 | blob_append(&filename, "manifest.tags", -1); |
| 549 | zName = blob_str(&filename); |
| 550 | tar_add_file(zName, &tagslist, 0, mTime); |
| 551 | blob_reset(&tagslist); |
| 552 | } |
| 553 | if( eflg & MFESTFLG_SYMLINKS ){ |
| 554 | Blob symlinklist; |
| 555 | blob_zero(&symlinklist); |
| 556 | get_checkin_symlinklist(rid, &symlinklist); |
| 557 | blob_resize(&filename, nPrefix); |
| 558 | blob_append(&filename, "manifest.symlinks", -1); |
| 559 | zName = blob_str(&filename); |
| 560 | tar_add_file(zName, &symlinklist, 0, mTime); |
| 561 | blob_reset(&symlinklist); |
| 562 | } |
| 563 | } |
| 564 | manifest_file_rewind(pManifest); |
| 565 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 566 | int fid; |
| 567 |
+16
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -371,10 +371,15 @@ | ||
| 371 | 371 | if( (pInclude==0 || glob_match(pInclude, "manifest.tags")) |
| 372 | 372 | && !glob_match(pExclude, "manifest.tags") |
| 373 | 373 | && (flg & MFESTFLG_TAGS) ){ |
| 374 | 374 | eflg |= MFESTFLG_TAGS; |
| 375 | 375 | } |
| 376 | + if( (pInclude==0 || glob_match(pInclude, "manifest.symlinks")) | |
| 377 | + && !glob_match(pExclude, "manifest.symlinks") | |
| 378 | + && (flg & MFESTFLG_SYMLINKS) ){ | |
| 379 | + eflg |= MFESTFLG_SYMLINKS; | |
| 380 | + } | |
| 376 | 381 | |
| 377 | 382 | if( eflg & MFESTFLG_RAW ){ |
| 378 | 383 | blob_append(&filename, "manifest", -1); |
| 379 | 384 | zName = blob_str(&filename); |
| 380 | 385 | zip_add_folders(zName); |
| @@ -397,10 +402,21 @@ | ||
| 397 | 402 | blob_append(&filename, "manifest.tags", -1); |
| 398 | 403 | zName = blob_str(&filename); |
| 399 | 404 | zip_add_folders(zName); |
| 400 | 405 | zip_add_file(zName, &tagslist, 0); |
| 401 | 406 | blob_reset(&tagslist); |
| 407 | + } | |
| 408 | + if( eflg & MFESTFLG_SYMLINKS ){ | |
| 409 | + Blob symlinklist; | |
| 410 | + blob_zero(&symlinklist); | |
| 411 | + get_checkin_symlinklist(rid, &symlinklist); | |
| 412 | + blob_resize(&filename, nPrefix); | |
| 413 | + blob_append(&filename, "manifest.symlinks", -1); | |
| 414 | + zName = blob_str(&filename); | |
| 415 | + zip_add_folders(zName); | |
| 416 | + zip_add_file(zName, &symlinklist, 0); | |
| 417 | + blob_reset(&symlinklist); | |
| 402 | 418 | } |
| 403 | 419 | } |
| 404 | 420 | manifest_file_rewind(pManifest); |
| 405 | 421 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 406 | 422 | int fid; |
| 407 | 423 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -371,10 +371,15 @@ | |
| 371 | if( (pInclude==0 || glob_match(pInclude, "manifest.tags")) |
| 372 | && !glob_match(pExclude, "manifest.tags") |
| 373 | && (flg & MFESTFLG_TAGS) ){ |
| 374 | eflg |= MFESTFLG_TAGS; |
| 375 | } |
| 376 | |
| 377 | if( eflg & MFESTFLG_RAW ){ |
| 378 | blob_append(&filename, "manifest", -1); |
| 379 | zName = blob_str(&filename); |
| 380 | zip_add_folders(zName); |
| @@ -397,10 +402,21 @@ | |
| 397 | blob_append(&filename, "manifest.tags", -1); |
| 398 | zName = blob_str(&filename); |
| 399 | zip_add_folders(zName); |
| 400 | zip_add_file(zName, &tagslist, 0); |
| 401 | blob_reset(&tagslist); |
| 402 | } |
| 403 | } |
| 404 | manifest_file_rewind(pManifest); |
| 405 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 406 | int fid; |
| 407 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -371,10 +371,15 @@ | |
| 371 | if( (pInclude==0 || glob_match(pInclude, "manifest.tags")) |
| 372 | && !glob_match(pExclude, "manifest.tags") |
| 373 | && (flg & MFESTFLG_TAGS) ){ |
| 374 | eflg |= MFESTFLG_TAGS; |
| 375 | } |
| 376 | if( (pInclude==0 || glob_match(pInclude, "manifest.symlinks")) |
| 377 | && !glob_match(pExclude, "manifest.symlinks") |
| 378 | && (flg & MFESTFLG_SYMLINKS) ){ |
| 379 | eflg |= MFESTFLG_SYMLINKS; |
| 380 | } |
| 381 | |
| 382 | if( eflg & MFESTFLG_RAW ){ |
| 383 | blob_append(&filename, "manifest", -1); |
| 384 | zName = blob_str(&filename); |
| 385 | zip_add_folders(zName); |
| @@ -397,10 +402,21 @@ | |
| 402 | blob_append(&filename, "manifest.tags", -1); |
| 403 | zName = blob_str(&filename); |
| 404 | zip_add_folders(zName); |
| 405 | zip_add_file(zName, &tagslist, 0); |
| 406 | blob_reset(&tagslist); |
| 407 | } |
| 408 | if( eflg & MFESTFLG_SYMLINKS ){ |
| 409 | Blob symlinklist; |
| 410 | blob_zero(&symlinklist); |
| 411 | get_checkin_symlinklist(rid, &symlinklist); |
| 412 | blob_resize(&filename, nPrefix); |
| 413 | blob_append(&filename, "manifest.symlinks", -1); |
| 414 | zName = blob_str(&filename); |
| 415 | zip_add_folders(zName); |
| 416 | zip_add_file(zName, &symlinklist, 0); |
| 417 | blob_reset(&symlinklist); |
| 418 | } |
| 419 | } |
| 420 | manifest_file_rewind(pManifest); |
| 421 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 422 | int fid; |
| 423 |
+2
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -30,10 +30,12 @@ | ||
| 30 | 30 | [/help?cmd=zip|zip], and [/help?cmd=tarball|tarball] pages and commands to |
| 31 | 31 | honor the versioned manifest setting when outside of an open checkout |
| 32 | 32 | directory. |
| 33 | 33 | * The admin-log and access-log settings are now on by default for |
| 34 | 34 | new repositories. |
| 35 | + * Add support for the "l" flag to the "manifest" setting to enable creation | |
| 36 | + of a file "manifest.symlinks" which lists the names of all symlinks. | |
| 35 | 37 | * Update the built-in SQLite to version 3.20.1. |
| 36 | 38 | |
| 37 | 39 | <a name='v2_3'></a> |
| 38 | 40 | <h2>Changes for Version 2.3 (2017-07-21)</h2> |
| 39 | 41 | |
| 40 | 42 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -30,10 +30,12 @@ | |
| 30 | [/help?cmd=zip|zip], and [/help?cmd=tarball|tarball] pages and commands to |
| 31 | honor the versioned manifest setting when outside of an open checkout |
| 32 | directory. |
| 33 | * The admin-log and access-log settings are now on by default for |
| 34 | new repositories. |
| 35 | * Update the built-in SQLite to version 3.20.1. |
| 36 | |
| 37 | <a name='v2_3'></a> |
| 38 | <h2>Changes for Version 2.3 (2017-07-21)</h2> |
| 39 | |
| 40 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -30,10 +30,12 @@ | |
| 30 | [/help?cmd=zip|zip], and [/help?cmd=tarball|tarball] pages and commands to |
| 31 | honor the versioned manifest setting when outside of an open checkout |
| 32 | directory. |
| 33 | * The admin-log and access-log settings are now on by default for |
| 34 | new repositories. |
| 35 | * Add support for the "l" flag to the "manifest" setting to enable creation |
| 36 | of a file "manifest.symlinks" which lists the names of all symlinks. |
| 37 | * Update the built-in SQLite to version 3.20.1. |
| 38 | |
| 39 | <a name='v2_3'></a> |
| 40 | <h2>Changes for Version 2.3 (2017-07-21)</h2> |
| 41 | |
| 42 |