Fossil SCM
For most commands, print an error if unknown command-line options are included on the command-line.
Commit
74ac0c925a98ee60e6ae4d905690856640651edd
Parent
d16018c8e191958…
21 files changed
+20
+45
-17
+8
+4
+8
+8
+4
+14
+4
+16
-1
+4
+4
+12
-1
+3
+4
+16
+4
+4
+4
+4
+20
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -123,10 +123,14 @@ | ||
| 123 | 123 | */ |
| 124 | 124 | void test_reserved_names(void){ |
| 125 | 125 | int i; |
| 126 | 126 | const char *z; |
| 127 | 127 | int omitRepo = find_option("omitrepo",0,0)!=0; |
| 128 | + | |
| 129 | + /* We should be done with options.. */ | |
| 130 | + verify_all_options(); | |
| 131 | + | |
| 128 | 132 | db_must_be_within_tree(); |
| 129 | 133 | for(i=0; (z = fossil_reserved_name(i, omitRepo))!=0; i++){ |
| 130 | 134 | fossil_print("%3d: %s\n", i, z); |
| 131 | 135 | } |
| 132 | 136 | fossil_print("ALL: (%s)\n", fossil_all_reserved_names(omitRepo)); |
| @@ -257,10 +261,14 @@ | ||
| 257 | 261 | zCleanFlag = find_option("clean",0,1); |
| 258 | 262 | zIgnoreFlag = find_option("ignore",0,1); |
| 259 | 263 | forceFlag = find_option("force","f",0)!=0; |
| 260 | 264 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 261 | 265 | capture_case_sensitive_option(); |
| 266 | + | |
| 267 | + /* We should be done with options.. */ | |
| 268 | + verify_all_options(); | |
| 269 | + | |
| 262 | 270 | db_must_be_within_tree(); |
| 263 | 271 | if( zCleanFlag==0 ){ |
| 264 | 272 | zCleanFlag = db_get("clean-glob", 0); |
| 265 | 273 | } |
| 266 | 274 | if( zIgnoreFlag==0 ){ |
| @@ -346,10 +354,14 @@ | ||
| 346 | 354 | void delete_cmd(void){ |
| 347 | 355 | int i; |
| 348 | 356 | Stmt loop; |
| 349 | 357 | |
| 350 | 358 | capture_case_sensitive_option(); |
| 359 | + | |
| 360 | + /* We should be done with options.. */ | |
| 361 | + verify_all_options(); | |
| 362 | + | |
| 351 | 363 | db_must_be_within_tree(); |
| 352 | 364 | db_begin_transaction(); |
| 353 | 365 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 354 | 366 | filename_collation()); |
| 355 | 367 | for(i=2; i<g.argc; i++){ |
| @@ -511,10 +523,14 @@ | ||
| 511 | 523 | |
| 512 | 524 | if( !dryRunFlag ){ |
| 513 | 525 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 514 | 526 | } |
| 515 | 527 | capture_case_sensitive_option(); |
| 528 | + | |
| 529 | + /* We should be done with options.. */ | |
| 530 | + verify_all_options(); | |
| 531 | + | |
| 516 | 532 | db_must_be_within_tree(); |
| 517 | 533 | if( zCleanFlag==0 ){ |
| 518 | 534 | zCleanFlag = db_get("clean-glob", 0); |
| 519 | 535 | } |
| 520 | 536 | if( zIgnoreFlag==0 ){ |
| @@ -620,10 +636,14 @@ | ||
| 620 | 636 | Blob dest; |
| 621 | 637 | Stmt q; |
| 622 | 638 | |
| 623 | 639 | capture_case_sensitive_option(); |
| 624 | 640 | db_must_be_within_tree(); |
| 641 | + | |
| 642 | + /* We should be done with options.. */ | |
| 643 | + verify_all_options(); | |
| 644 | + | |
| 625 | 645 | vid = db_lget_int("checkout", 0); |
| 626 | 646 | if( vid==0 ){ |
| 627 | 647 | fossil_fatal("no checkout rename files in"); |
| 628 | 648 | } |
| 629 | 649 | if( g.argc<4 ){ |
| 630 | 650 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -123,10 +123,14 @@ | |
| 123 | */ |
| 124 | void test_reserved_names(void){ |
| 125 | int i; |
| 126 | const char *z; |
| 127 | int omitRepo = find_option("omitrepo",0,0)!=0; |
| 128 | db_must_be_within_tree(); |
| 129 | for(i=0; (z = fossil_reserved_name(i, omitRepo))!=0; i++){ |
| 130 | fossil_print("%3d: %s\n", i, z); |
| 131 | } |
| 132 | fossil_print("ALL: (%s)\n", fossil_all_reserved_names(omitRepo)); |
| @@ -257,10 +261,14 @@ | |
| 257 | zCleanFlag = find_option("clean",0,1); |
| 258 | zIgnoreFlag = find_option("ignore",0,1); |
| 259 | forceFlag = find_option("force","f",0)!=0; |
| 260 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 261 | capture_case_sensitive_option(); |
| 262 | db_must_be_within_tree(); |
| 263 | if( zCleanFlag==0 ){ |
| 264 | zCleanFlag = db_get("clean-glob", 0); |
| 265 | } |
| 266 | if( zIgnoreFlag==0 ){ |
| @@ -346,10 +354,14 @@ | |
| 346 | void delete_cmd(void){ |
| 347 | int i; |
| 348 | Stmt loop; |
| 349 | |
| 350 | capture_case_sensitive_option(); |
| 351 | db_must_be_within_tree(); |
| 352 | db_begin_transaction(); |
| 353 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 354 | filename_collation()); |
| 355 | for(i=2; i<g.argc; i++){ |
| @@ -511,10 +523,14 @@ | |
| 511 | |
| 512 | if( !dryRunFlag ){ |
| 513 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 514 | } |
| 515 | capture_case_sensitive_option(); |
| 516 | db_must_be_within_tree(); |
| 517 | if( zCleanFlag==0 ){ |
| 518 | zCleanFlag = db_get("clean-glob", 0); |
| 519 | } |
| 520 | if( zIgnoreFlag==0 ){ |
| @@ -620,10 +636,14 @@ | |
| 620 | Blob dest; |
| 621 | Stmt q; |
| 622 | |
| 623 | capture_case_sensitive_option(); |
| 624 | db_must_be_within_tree(); |
| 625 | vid = db_lget_int("checkout", 0); |
| 626 | if( vid==0 ){ |
| 627 | fossil_fatal("no checkout rename files in"); |
| 628 | } |
| 629 | if( g.argc<4 ){ |
| 630 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -123,10 +123,14 @@ | |
| 123 | */ |
| 124 | void test_reserved_names(void){ |
| 125 | int i; |
| 126 | const char *z; |
| 127 | int omitRepo = find_option("omitrepo",0,0)!=0; |
| 128 | |
| 129 | /* We should be done with options.. */ |
| 130 | verify_all_options(); |
| 131 | |
| 132 | db_must_be_within_tree(); |
| 133 | for(i=0; (z = fossil_reserved_name(i, omitRepo))!=0; i++){ |
| 134 | fossil_print("%3d: %s\n", i, z); |
| 135 | } |
| 136 | fossil_print("ALL: (%s)\n", fossil_all_reserved_names(omitRepo)); |
| @@ -257,10 +261,14 @@ | |
| 261 | zCleanFlag = find_option("clean",0,1); |
| 262 | zIgnoreFlag = find_option("ignore",0,1); |
| 263 | forceFlag = find_option("force","f",0)!=0; |
| 264 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 265 | capture_case_sensitive_option(); |
| 266 | |
| 267 | /* We should be done with options.. */ |
| 268 | verify_all_options(); |
| 269 | |
| 270 | db_must_be_within_tree(); |
| 271 | if( zCleanFlag==0 ){ |
| 272 | zCleanFlag = db_get("clean-glob", 0); |
| 273 | } |
| 274 | if( zIgnoreFlag==0 ){ |
| @@ -346,10 +354,14 @@ | |
| 354 | void delete_cmd(void){ |
| 355 | int i; |
| 356 | Stmt loop; |
| 357 | |
| 358 | capture_case_sensitive_option(); |
| 359 | |
| 360 | /* We should be done with options.. */ |
| 361 | verify_all_options(); |
| 362 | |
| 363 | db_must_be_within_tree(); |
| 364 | db_begin_transaction(); |
| 365 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 366 | filename_collation()); |
| 367 | for(i=2; i<g.argc; i++){ |
| @@ -511,10 +523,14 @@ | |
| 523 | |
| 524 | if( !dryRunFlag ){ |
| 525 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 526 | } |
| 527 | capture_case_sensitive_option(); |
| 528 | |
| 529 | /* We should be done with options.. */ |
| 530 | verify_all_options(); |
| 531 | |
| 532 | db_must_be_within_tree(); |
| 533 | if( zCleanFlag==0 ){ |
| 534 | zCleanFlag = db_get("clean-glob", 0); |
| 535 | } |
| 536 | if( zIgnoreFlag==0 ){ |
| @@ -620,10 +636,14 @@ | |
| 636 | Blob dest; |
| 637 | Stmt q; |
| 638 | |
| 639 | capture_case_sensitive_option(); |
| 640 | db_must_be_within_tree(); |
| 641 | |
| 642 | /* We should be done with options.. */ |
| 643 | verify_all_options(); |
| 644 | |
| 645 | vid = db_lget_int("checkout", 0); |
| 646 | if( vid==0 ){ |
| 647 | fossil_fatal("no checkout rename files in"); |
| 648 | } |
| 649 | if( g.argc<4 ){ |
| 650 |
+45
-17
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -159,10 +159,35 @@ | ||
| 159 | 159 | int relPathOption = find_option("rel-paths", 0, 0)!=0; |
| 160 | 160 | if( absPathOption ){ relativePaths = 0; } |
| 161 | 161 | if( relPathOption ){ relativePaths = 1; } |
| 162 | 162 | return relativePaths; |
| 163 | 163 | } |
| 164 | + | |
| 165 | +void print_changes( | |
| 166 | + int useSha1sum, /* Verify file status using SHA1 hashing rather | |
| 167 | + than relying on file mtimes. */ | |
| 168 | + int showHdr, /* Identify the repository if there are changes */ | |
| 169 | + int verboseFlag, /* Say "(none)" if there are no changes */ | |
| 170 | + int cwdRelative /* Report relative to the current working dir */ | |
| 171 | +){ | |
| 172 | + Blob report; | |
| 173 | + int vid; | |
| 174 | + blob_zero(&report); | |
| 175 | + | |
| 176 | + vid = db_lget_int("checkout", 0); | |
| 177 | + vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0); | |
| 178 | + status_report(&report, "", 0, cwdRelative); | |
| 179 | + if( verboseFlag && blob_size(&report)==0 ){ | |
| 180 | + blob_append(&report, " (none)\n", -1); | |
| 181 | + } | |
| 182 | + if( showHdr && blob_size(&report)>0 ){ | |
| 183 | + fossil_print("Changes for %s at %s:\n", db_get("project-name","???"), | |
| 184 | + g.zLocalRoot); | |
| 185 | + } | |
| 186 | + blob_write_to_file(&report, "-"); | |
| 187 | + blob_reset(&report); | |
| 188 | +} | |
| 164 | 189 | |
| 165 | 190 | /* |
| 166 | 191 | ** COMMAND: changes |
| 167 | 192 | ** |
| 168 | 193 | ** Usage: %fossil changes ?OPTIONS? |
| @@ -182,31 +207,21 @@ | ||
| 182 | 207 | ** -v|--verbose Say "(none)" if there are no changes |
| 183 | 208 | ** |
| 184 | 209 | ** See also: extras, ls, status |
| 185 | 210 | */ |
| 186 | 211 | void changes_cmd(void){ |
| 187 | - Blob report; | |
| 188 | - int vid; | |
| 189 | 212 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 190 | 213 | int showHdr = find_option("header",0,0)!=0; |
| 191 | 214 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 192 | 215 | int cwdRelative = 0; |
| 193 | 216 | db_must_be_within_tree(); |
| 194 | 217 | cwdRelative = determine_cwd_relative_option(); |
| 195 | - blob_zero(&report); | |
| 196 | - vid = db_lget_int("checkout", 0); | |
| 197 | - vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0); | |
| 198 | - status_report(&report, "", 0, cwdRelative); | |
| 199 | - if( verboseFlag && blob_size(&report)==0 ){ | |
| 200 | - blob_append(&report, " (none)\n", -1); | |
| 201 | - } | |
| 202 | - if( showHdr && blob_size(&report)>0 ){ | |
| 203 | - fossil_print("Changes for %s at %s:\n", db_get("project-name","???"), | |
| 204 | - g.zLocalRoot); | |
| 205 | - } | |
| 206 | - blob_write_to_file(&report, "-"); | |
| 207 | - blob_reset(&report); | |
| 218 | + | |
| 219 | + /* We should be done with options.. */ | |
| 220 | + verify_all_options(); | |
| 221 | + | |
| 222 | + print_changes(useSha1sum, showHdr, verboseFlag, cwdRelative); | |
| 208 | 223 | } |
| 209 | 224 | |
| 210 | 225 | /* |
| 211 | 226 | ** COMMAND: status |
| 212 | 227 | ** |
| @@ -227,23 +242,32 @@ | ||
| 227 | 242 | ** |
| 228 | 243 | ** See also: changes, extras, ls |
| 229 | 244 | */ |
| 230 | 245 | void status_cmd(void){ |
| 231 | 246 | int vid; |
| 247 | + int useSha1sum = find_option("sha1sum", 0, 0)!=0; | |
| 248 | + int showHdr = find_option("header",0,0)!=0; | |
| 249 | + int verboseFlag = find_option("verbose","v",0)!=0; | |
| 250 | + int cwdRelative = 0; | |
| 232 | 251 | db_must_be_within_tree(); |
| 233 | 252 | /* 012345678901234 */ |
| 253 | + cwdRelative = determine_cwd_relative_option(); | |
| 254 | + | |
| 255 | + /* We should be done with options.. */ | |
| 256 | + verify_all_options(); | |
| 257 | + | |
| 234 | 258 | fossil_print("repository: %s\n", db_repository_filename()); |
| 235 | 259 | fossil_print("local-root: %s\n", g.zLocalRoot); |
| 236 | 260 | if( g.zConfigDbName ){ |
| 237 | 261 | fossil_print("config-db: %s\n", g.zConfigDbName); |
| 238 | 262 | } |
| 239 | 263 | vid = db_lget_int("checkout", 0); |
| 240 | 264 | if( vid ){ |
| 241 | 265 | show_common_info(vid, "checkout:", 1, 1); |
| 242 | 266 | } |
| 243 | - db_record_repository_filename(0); | |
| 244 | - changes_cmd(); | |
| 267 | + db_record_repository_filename(0); | |
| 268 | + print_changes(useSha1sum, showHdr, verboseFlag, cwdRelative); | |
| 245 | 269 | } |
| 246 | 270 | |
| 247 | 271 | /* |
| 248 | 272 | ** COMMAND: ls |
| 249 | 273 | ** |
| @@ -454,10 +478,14 @@ | ||
| 454 | 478 | |
| 455 | 479 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 456 | 480 | capture_case_sensitive_option(); |
| 457 | 481 | db_must_be_within_tree(); |
| 458 | 482 | cwdRelative = determine_cwd_relative_option(); |
| 483 | + | |
| 484 | + /* We should be done with options.. */ | |
| 485 | + verify_all_options(); | |
| 486 | + | |
| 459 | 487 | if( zIgnoreFlag==0 ){ |
| 460 | 488 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 461 | 489 | } |
| 462 | 490 | pIgnore = glob_create(zIgnoreFlag); |
| 463 | 491 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); |
| 464 | 492 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -159,10 +159,35 @@ | |
| 159 | int relPathOption = find_option("rel-paths", 0, 0)!=0; |
| 160 | if( absPathOption ){ relativePaths = 0; } |
| 161 | if( relPathOption ){ relativePaths = 1; } |
| 162 | return relativePaths; |
| 163 | } |
| 164 | |
| 165 | /* |
| 166 | ** COMMAND: changes |
| 167 | ** |
| 168 | ** Usage: %fossil changes ?OPTIONS? |
| @@ -182,31 +207,21 @@ | |
| 182 | ** -v|--verbose Say "(none)" if there are no changes |
| 183 | ** |
| 184 | ** See also: extras, ls, status |
| 185 | */ |
| 186 | void changes_cmd(void){ |
| 187 | Blob report; |
| 188 | int vid; |
| 189 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 190 | int showHdr = find_option("header",0,0)!=0; |
| 191 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 192 | int cwdRelative = 0; |
| 193 | db_must_be_within_tree(); |
| 194 | cwdRelative = determine_cwd_relative_option(); |
| 195 | blob_zero(&report); |
| 196 | vid = db_lget_int("checkout", 0); |
| 197 | vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0); |
| 198 | status_report(&report, "", 0, cwdRelative); |
| 199 | if( verboseFlag && blob_size(&report)==0 ){ |
| 200 | blob_append(&report, " (none)\n", -1); |
| 201 | } |
| 202 | if( showHdr && blob_size(&report)>0 ){ |
| 203 | fossil_print("Changes for %s at %s:\n", db_get("project-name","???"), |
| 204 | g.zLocalRoot); |
| 205 | } |
| 206 | blob_write_to_file(&report, "-"); |
| 207 | blob_reset(&report); |
| 208 | } |
| 209 | |
| 210 | /* |
| 211 | ** COMMAND: status |
| 212 | ** |
| @@ -227,23 +242,32 @@ | |
| 227 | ** |
| 228 | ** See also: changes, extras, ls |
| 229 | */ |
| 230 | void status_cmd(void){ |
| 231 | int vid; |
| 232 | db_must_be_within_tree(); |
| 233 | /* 012345678901234 */ |
| 234 | fossil_print("repository: %s\n", db_repository_filename()); |
| 235 | fossil_print("local-root: %s\n", g.zLocalRoot); |
| 236 | if( g.zConfigDbName ){ |
| 237 | fossil_print("config-db: %s\n", g.zConfigDbName); |
| 238 | } |
| 239 | vid = db_lget_int("checkout", 0); |
| 240 | if( vid ){ |
| 241 | show_common_info(vid, "checkout:", 1, 1); |
| 242 | } |
| 243 | db_record_repository_filename(0); |
| 244 | changes_cmd(); |
| 245 | } |
| 246 | |
| 247 | /* |
| 248 | ** COMMAND: ls |
| 249 | ** |
| @@ -454,10 +478,14 @@ | |
| 454 | |
| 455 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 456 | capture_case_sensitive_option(); |
| 457 | db_must_be_within_tree(); |
| 458 | cwdRelative = determine_cwd_relative_option(); |
| 459 | if( zIgnoreFlag==0 ){ |
| 460 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 461 | } |
| 462 | pIgnore = glob_create(zIgnoreFlag); |
| 463 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); |
| 464 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -159,10 +159,35 @@ | |
| 159 | int relPathOption = find_option("rel-paths", 0, 0)!=0; |
| 160 | if( absPathOption ){ relativePaths = 0; } |
| 161 | if( relPathOption ){ relativePaths = 1; } |
| 162 | return relativePaths; |
| 163 | } |
| 164 | |
| 165 | void print_changes( |
| 166 | int useSha1sum, /* Verify file status using SHA1 hashing rather |
| 167 | than relying on file mtimes. */ |
| 168 | int showHdr, /* Identify the repository if there are changes */ |
| 169 | int verboseFlag, /* Say "(none)" if there are no changes */ |
| 170 | int cwdRelative /* Report relative to the current working dir */ |
| 171 | ){ |
| 172 | Blob report; |
| 173 | int vid; |
| 174 | blob_zero(&report); |
| 175 | |
| 176 | vid = db_lget_int("checkout", 0); |
| 177 | vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0); |
| 178 | status_report(&report, "", 0, cwdRelative); |
| 179 | if( verboseFlag && blob_size(&report)==0 ){ |
| 180 | blob_append(&report, " (none)\n", -1); |
| 181 | } |
| 182 | if( showHdr && blob_size(&report)>0 ){ |
| 183 | fossil_print("Changes for %s at %s:\n", db_get("project-name","???"), |
| 184 | g.zLocalRoot); |
| 185 | } |
| 186 | blob_write_to_file(&report, "-"); |
| 187 | blob_reset(&report); |
| 188 | } |
| 189 | |
| 190 | /* |
| 191 | ** COMMAND: changes |
| 192 | ** |
| 193 | ** Usage: %fossil changes ?OPTIONS? |
| @@ -182,31 +207,21 @@ | |
| 207 | ** -v|--verbose Say "(none)" if there are no changes |
| 208 | ** |
| 209 | ** See also: extras, ls, status |
| 210 | */ |
| 211 | void changes_cmd(void){ |
| 212 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 213 | int showHdr = find_option("header",0,0)!=0; |
| 214 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 215 | int cwdRelative = 0; |
| 216 | db_must_be_within_tree(); |
| 217 | cwdRelative = determine_cwd_relative_option(); |
| 218 | |
| 219 | /* We should be done with options.. */ |
| 220 | verify_all_options(); |
| 221 | |
| 222 | print_changes(useSha1sum, showHdr, verboseFlag, cwdRelative); |
| 223 | } |
| 224 | |
| 225 | /* |
| 226 | ** COMMAND: status |
| 227 | ** |
| @@ -227,23 +242,32 @@ | |
| 242 | ** |
| 243 | ** See also: changes, extras, ls |
| 244 | */ |
| 245 | void status_cmd(void){ |
| 246 | int vid; |
| 247 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 248 | int showHdr = find_option("header",0,0)!=0; |
| 249 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 250 | int cwdRelative = 0; |
| 251 | db_must_be_within_tree(); |
| 252 | /* 012345678901234 */ |
| 253 | cwdRelative = determine_cwd_relative_option(); |
| 254 | |
| 255 | /* We should be done with options.. */ |
| 256 | verify_all_options(); |
| 257 | |
| 258 | fossil_print("repository: %s\n", db_repository_filename()); |
| 259 | fossil_print("local-root: %s\n", g.zLocalRoot); |
| 260 | if( g.zConfigDbName ){ |
| 261 | fossil_print("config-db: %s\n", g.zConfigDbName); |
| 262 | } |
| 263 | vid = db_lget_int("checkout", 0); |
| 264 | if( vid ){ |
| 265 | show_common_info(vid, "checkout:", 1, 1); |
| 266 | } |
| 267 | db_record_repository_filename(0); |
| 268 | print_changes(useSha1sum, showHdr, verboseFlag, cwdRelative); |
| 269 | } |
| 270 | |
| 271 | /* |
| 272 | ** COMMAND: ls |
| 273 | ** |
| @@ -454,10 +478,14 @@ | |
| 478 | |
| 479 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 480 | capture_case_sensitive_option(); |
| 481 | db_must_be_within_tree(); |
| 482 | cwdRelative = determine_cwd_relative_option(); |
| 483 | |
| 484 | /* We should be done with options.. */ |
| 485 | verify_all_options(); |
| 486 | |
| 487 | if( zIgnoreFlag==0 ){ |
| 488 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 489 | } |
| 490 | pIgnore = glob_create(zIgnoreFlag); |
| 491 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); |
| 492 |
+8
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -201,10 +201,14 @@ | ||
| 201 | 201 | forceFlag = find_option("force","f",0)!=0; |
| 202 | 202 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 203 | 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | 205 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 206 | + | |
| 207 | + /* We should be done with options.. */ | |
| 208 | + verify_all_options(); | |
| 209 | + | |
| 206 | 210 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 207 | 211 | usage("VERSION|--latest ?--force? ?--keep?"); |
| 208 | 212 | } |
| 209 | 213 | if( !forceFlag && unsaved_changes(0) ){ |
| 210 | 214 | fossil_fatal("there are unsaved changes in the current checkout"); |
| @@ -292,10 +296,14 @@ | ||
| 292 | 296 | ** See also: open |
| 293 | 297 | */ |
| 294 | 298 | void close_cmd(void){ |
| 295 | 299 | int forceFlag = find_option("force","f",0)!=0; |
| 296 | 300 | db_must_be_within_tree(); |
| 301 | + | |
| 302 | + /* We should be done with options.. */ | |
| 303 | + verify_all_options(); | |
| 304 | + | |
| 297 | 305 | if( !forceFlag && unsaved_changes(0) ){ |
| 298 | 306 | fossil_fatal("there are unsaved changes in the current checkout"); |
| 299 | 307 | } |
| 300 | 308 | if( !forceFlag |
| 301 | 309 | && db_exists("SELECT 1 FROM %s.sqlite_master WHERE name='stash'", |
| 302 | 310 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -201,10 +201,14 @@ | |
| 201 | forceFlag = find_option("force","f",0)!=0; |
| 202 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 206 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 207 | usage("VERSION|--latest ?--force? ?--keep?"); |
| 208 | } |
| 209 | if( !forceFlag && unsaved_changes(0) ){ |
| 210 | fossil_fatal("there are unsaved changes in the current checkout"); |
| @@ -292,10 +296,14 @@ | |
| 292 | ** See also: open |
| 293 | */ |
| 294 | void close_cmd(void){ |
| 295 | int forceFlag = find_option("force","f",0)!=0; |
| 296 | db_must_be_within_tree(); |
| 297 | if( !forceFlag && unsaved_changes(0) ){ |
| 298 | fossil_fatal("there are unsaved changes in the current checkout"); |
| 299 | } |
| 300 | if( !forceFlag |
| 301 | && db_exists("SELECT 1 FROM %s.sqlite_master WHERE name='stash'", |
| 302 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -201,10 +201,14 @@ | |
| 201 | forceFlag = find_option("force","f",0)!=0; |
| 202 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 206 | |
| 207 | /* We should be done with options.. */ |
| 208 | verify_all_options(); |
| 209 | |
| 210 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 211 | usage("VERSION|--latest ?--force? ?--keep?"); |
| 212 | } |
| 213 | if( !forceFlag && unsaved_changes(0) ){ |
| 214 | fossil_fatal("there are unsaved changes in the current checkout"); |
| @@ -292,10 +296,14 @@ | |
| 296 | ** See also: open |
| 297 | */ |
| 298 | void close_cmd(void){ |
| 299 | int forceFlag = find_option("force","f",0)!=0; |
| 300 | db_must_be_within_tree(); |
| 301 | |
| 302 | /* We should be done with options.. */ |
| 303 | verify_all_options(); |
| 304 | |
| 305 | if( !forceFlag && unsaved_changes(0) ){ |
| 306 | fossil_fatal("there are unsaved changes in the current checkout"); |
| 307 | } |
| 308 | if( !forceFlag |
| 309 | && db_exists("SELECT 1 FROM %s.sqlite_master WHERE name='stash'", |
| 310 |
+4
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -127,10 +127,14 @@ | ||
| 127 | 127 | if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER; |
| 128 | 128 | zHttpAuth = find_option("httpauth","B",1); |
| 129 | 129 | zDefaultUser = find_option("admin-user","A",1); |
| 130 | 130 | clone_ssh_find_options(); |
| 131 | 131 | url_proxy_options(); |
| 132 | + | |
| 133 | + /* We should be done with options.. */ | |
| 134 | + verify_all_options(); | |
| 135 | + | |
| 132 | 136 | if( g.argc < 4 ){ |
| 133 | 137 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 134 | 138 | } |
| 135 | 139 | db_open_config(0); |
| 136 | 140 | if( file_size(g.argv[3])>0 ){ |
| 137 | 141 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -127,10 +127,14 @@ | |
| 127 | if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER; |
| 128 | zHttpAuth = find_option("httpauth","B",1); |
| 129 | zDefaultUser = find_option("admin-user","A",1); |
| 130 | clone_ssh_find_options(); |
| 131 | url_proxy_options(); |
| 132 | if( g.argc < 4 ){ |
| 133 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 134 | } |
| 135 | db_open_config(0); |
| 136 | if( file_size(g.argv[3])>0 ){ |
| 137 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -127,10 +127,14 @@ | |
| 127 | if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER; |
| 128 | zHttpAuth = find_option("httpauth","B",1); |
| 129 | zDefaultUser = find_option("admin-user","A",1); |
| 130 | clone_ssh_find_options(); |
| 131 | url_proxy_options(); |
| 132 | |
| 133 | /* We should be done with options.. */ |
| 134 | verify_all_options(); |
| 135 | |
| 136 | if( g.argc < 4 ){ |
| 137 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 138 | } |
| 139 | db_open_config(0); |
| 140 | if( file_size(g.argv[3])>0 ){ |
| 141 |
M
src/db.c
+8
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1479,10 +1479,14 @@ | ||
| 1479 | 1479 | |
| 1480 | 1480 | zTemplate = find_option("template",0,1); |
| 1481 | 1481 | zDate = find_option("date-override",0,1); |
| 1482 | 1482 | zDefaultUser = find_option("admin-user","A",1); |
| 1483 | 1483 | find_option("empty", 0, 0); /* deprecated */ |
| 1484 | + | |
| 1485 | + /* We should be done with options.. */ | |
| 1486 | + verify_all_options(); | |
| 1487 | + | |
| 1484 | 1488 | if( g.argc!=3 ){ |
| 1485 | 1489 | usage("REPOSITORY-NAME"); |
| 1486 | 1490 | } |
| 1487 | 1491 | db_create_repository(g.argv[2]); |
| 1488 | 1492 | db_open_repository(g.argv[2]); |
| @@ -2033,10 +2037,14 @@ | ||
| 2033 | 2037 | url_proxy_options(); |
| 2034 | 2038 | emptyFlag = find_option("empty",0,0)!=0; |
| 2035 | 2039 | keepFlag = find_option("keep",0,0)!=0; |
| 2036 | 2040 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 2037 | 2041 | allowNested = find_option("nested",0,0)!=0; |
| 2042 | + | |
| 2043 | + /* We should be done with options.. */ | |
| 2044 | + verify_all_options(); | |
| 2045 | + | |
| 2038 | 2046 | if( g.argc!=3 && g.argc!=4 ){ |
| 2039 | 2047 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 2040 | 2048 | } |
| 2041 | 2049 | if( !allowNested && db_open_local(0) ){ |
| 2042 | 2050 | fossil_fatal("already within an open tree rooted at %s", g.zLocalRoot); |
| 2043 | 2051 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1479,10 +1479,14 @@ | |
| 1479 | |
| 1480 | zTemplate = find_option("template",0,1); |
| 1481 | zDate = find_option("date-override",0,1); |
| 1482 | zDefaultUser = find_option("admin-user","A",1); |
| 1483 | find_option("empty", 0, 0); /* deprecated */ |
| 1484 | if( g.argc!=3 ){ |
| 1485 | usage("REPOSITORY-NAME"); |
| 1486 | } |
| 1487 | db_create_repository(g.argv[2]); |
| 1488 | db_open_repository(g.argv[2]); |
| @@ -2033,10 +2037,14 @@ | |
| 2033 | url_proxy_options(); |
| 2034 | emptyFlag = find_option("empty",0,0)!=0; |
| 2035 | keepFlag = find_option("keep",0,0)!=0; |
| 2036 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 2037 | allowNested = find_option("nested",0,0)!=0; |
| 2038 | if( g.argc!=3 && g.argc!=4 ){ |
| 2039 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 2040 | } |
| 2041 | if( !allowNested && db_open_local(0) ){ |
| 2042 | fossil_fatal("already within an open tree rooted at %s", g.zLocalRoot); |
| 2043 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1479,10 +1479,14 @@ | |
| 1479 | |
| 1480 | zTemplate = find_option("template",0,1); |
| 1481 | zDate = find_option("date-override",0,1); |
| 1482 | zDefaultUser = find_option("admin-user","A",1); |
| 1483 | find_option("empty", 0, 0); /* deprecated */ |
| 1484 | |
| 1485 | /* We should be done with options.. */ |
| 1486 | verify_all_options(); |
| 1487 | |
| 1488 | if( g.argc!=3 ){ |
| 1489 | usage("REPOSITORY-NAME"); |
| 1490 | } |
| 1491 | db_create_repository(g.argv[2]); |
| 1492 | db_open_repository(g.argv[2]); |
| @@ -2033,10 +2037,14 @@ | |
| 2037 | url_proxy_options(); |
| 2038 | emptyFlag = find_option("empty",0,0)!=0; |
| 2039 | keepFlag = find_option("keep",0,0)!=0; |
| 2040 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 2041 | allowNested = find_option("nested",0,0)!=0; |
| 2042 | |
| 2043 | /* We should be done with options.. */ |
| 2044 | verify_all_options(); |
| 2045 | |
| 2046 | if( g.argc!=3 && g.argc!=4 ){ |
| 2047 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 2048 | } |
| 2049 | if( !allowNested && db_open_local(0) ){ |
| 2050 | fossil_fatal("already within an open tree rooted at %s", g.zLocalRoot); |
| 2051 |
+8
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -317,10 +317,14 @@ | ||
| 317 | 317 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 318 | 318 | } |
| 319 | 319 | }else{ |
| 320 | 320 | width = -1; |
| 321 | 321 | } |
| 322 | + | |
| 323 | + /* We should be done with options.. */ | |
| 324 | + verify_all_options(); | |
| 325 | + | |
| 322 | 326 | if( g.argc==2 ){ |
| 323 | 327 | base = db_lget_int("checkout", 0); |
| 324 | 328 | }else{ |
| 325 | 329 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 326 | 330 | } |
| @@ -378,10 +382,14 @@ | ||
| 378 | 382 | } |
| 379 | 383 | }else{ |
| 380 | 384 | width = -1; |
| 381 | 385 | } |
| 382 | 386 | db_find_and_open_repository(0,0); |
| 387 | + | |
| 388 | + /* We should be done with options.. */ | |
| 389 | + verify_all_options(); | |
| 390 | + | |
| 383 | 391 | if( recomputeFlag ) leaf_rebuild(); |
| 384 | 392 | blob_zero(&sql); |
| 385 | 393 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 386 | 394 | blob_appendf(&sql, " AND blob.rid IN leaf"); |
| 387 | 395 | if( showClosed ){ |
| 388 | 396 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -317,10 +317,14 @@ | |
| 317 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 318 | } |
| 319 | }else{ |
| 320 | width = -1; |
| 321 | } |
| 322 | if( g.argc==2 ){ |
| 323 | base = db_lget_int("checkout", 0); |
| 324 | }else{ |
| 325 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 326 | } |
| @@ -378,10 +382,14 @@ | |
| 378 | } |
| 379 | }else{ |
| 380 | width = -1; |
| 381 | } |
| 382 | db_find_and_open_repository(0,0); |
| 383 | if( recomputeFlag ) leaf_rebuild(); |
| 384 | blob_zero(&sql); |
| 385 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 386 | blob_appendf(&sql, " AND blob.rid IN leaf"); |
| 387 | if( showClosed ){ |
| 388 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -317,10 +317,14 @@ | |
| 317 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 318 | } |
| 319 | }else{ |
| 320 | width = -1; |
| 321 | } |
| 322 | |
| 323 | /* We should be done with options.. */ |
| 324 | verify_all_options(); |
| 325 | |
| 326 | if( g.argc==2 ){ |
| 327 | base = db_lget_int("checkout", 0); |
| 328 | }else{ |
| 329 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 330 | } |
| @@ -378,10 +382,14 @@ | |
| 382 | } |
| 383 | }else{ |
| 384 | width = -1; |
| 385 | } |
| 386 | db_find_and_open_repository(0,0); |
| 387 | |
| 388 | /* We should be done with options.. */ |
| 389 | verify_all_options(); |
| 390 | |
| 391 | if( recomputeFlag ) leaf_rebuild(); |
| 392 | blob_zero(&sql); |
| 393 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 394 | blob_appendf(&sql, " AND blob.rid IN leaf"); |
| 395 | if( showClosed ){ |
| 396 |
+4
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2434,10 +2434,14 @@ | ||
| 2434 | 2434 | if( find_option("ignore-all-space","w",0)!=0 ){ |
| 2435 | 2435 | annFlags = DIFF_IGNORE_ALLWS; /* stronger than DIFF_IGNORE_EOLWS */ |
| 2436 | 2436 | } |
| 2437 | 2437 | fileVers = find_option("filevers",0,0)!=0; |
| 2438 | 2438 | db_must_be_within_tree(); |
| 2439 | + | |
| 2440 | + /* We should be done with options.. */ | |
| 2441 | + verify_all_options(); | |
| 2442 | + | |
| 2439 | 2443 | if( g.argc<3 ) { |
| 2440 | 2444 | usage("FILENAME"); |
| 2441 | 2445 | } |
| 2442 | 2446 | file_tree_name(g.argv[2], &treename, 1); |
| 2443 | 2447 | zFilename = blob_str(&treename); |
| 2444 | 2448 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2434,10 +2434,14 @@ | |
| 2434 | if( find_option("ignore-all-space","w",0)!=0 ){ |
| 2435 | annFlags = DIFF_IGNORE_ALLWS; /* stronger than DIFF_IGNORE_EOLWS */ |
| 2436 | } |
| 2437 | fileVers = find_option("filevers",0,0)!=0; |
| 2438 | db_must_be_within_tree(); |
| 2439 | if( g.argc<3 ) { |
| 2440 | usage("FILENAME"); |
| 2441 | } |
| 2442 | file_tree_name(g.argv[2], &treename, 1); |
| 2443 | zFilename = blob_str(&treename); |
| 2444 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2434,10 +2434,14 @@ | |
| 2434 | if( find_option("ignore-all-space","w",0)!=0 ){ |
| 2435 | annFlags = DIFF_IGNORE_ALLWS; /* stronger than DIFF_IGNORE_EOLWS */ |
| 2436 | } |
| 2437 | fileVers = find_option("filevers",0,0)!=0; |
| 2438 | db_must_be_within_tree(); |
| 2439 | |
| 2440 | /* We should be done with options.. */ |
| 2441 | verify_all_options(); |
| 2442 | |
| 2443 | if( g.argc<3 ) { |
| 2444 | usage("FILENAME"); |
| 2445 | } |
| 2446 | file_tree_name(g.argv[2], &treename, 1); |
| 2447 | zFilename = blob_str(&treename); |
| 2448 |
+14
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -63,10 +63,13 @@ | ||
| 63 | 63 | if( find_option("status","s",0) ){ |
| 64 | 64 | Stmt q; |
| 65 | 65 | Blob line; |
| 66 | 66 | Blob fname; |
| 67 | 67 | int vid; |
| 68 | + | |
| 69 | + /* We should be done with options.. */ | |
| 70 | + verify_all_options(); | |
| 68 | 71 | |
| 69 | 72 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 70 | 73 | vid = db_lget_int("checkout", 0); |
| 71 | 74 | if( vid==0 ){ |
| 72 | 75 | fossil_fatal("no checkout to finfo files in"); |
| @@ -115,10 +118,13 @@ | ||
| 115 | 118 | blob_reset(&line); |
| 116 | 119 | }else if( find_option("print","p",0) ){ |
| 117 | 120 | Blob record; |
| 118 | 121 | Blob fname; |
| 119 | 122 | const char *zRevision = find_option("revision", "r", 1); |
| 123 | + | |
| 124 | + /* We should be done with options.. */ | |
| 125 | + verify_all_options(); | |
| 120 | 126 | |
| 121 | 127 | file_tree_name(g.argv[2], &fname, 1); |
| 122 | 128 | if( zRevision ){ |
| 123 | 129 | historical_version_of_file(zRevision, blob_str(&fname), &record, 0,0,0,0); |
| 124 | 130 | }else{ |
| @@ -158,10 +164,14 @@ | ||
| 158 | 164 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 159 | 165 | } |
| 160 | 166 | }else{ |
| 161 | 167 | iWidth = -1; |
| 162 | 168 | } |
| 169 | + | |
| 170 | + /* We should be done with options.. */ | |
| 171 | + verify_all_options(); | |
| 172 | + | |
| 163 | 173 | if( g.argc!=3 ){ |
| 164 | 174 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 165 | 175 | } |
| 166 | 176 | file_tree_name(g.argv[2], &fname, 1); |
| 167 | 177 | rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B %s", |
| @@ -241,10 +251,14 @@ | ||
| 241 | 251 | int rc; |
| 242 | 252 | Blob content, fname; |
| 243 | 253 | const char *zRev; |
| 244 | 254 | db_find_and_open_repository(0, 0); |
| 245 | 255 | zRev = find_option("r","r",1); |
| 256 | + | |
| 257 | + /* We should be done with options.. */ | |
| 258 | + verify_all_options(); | |
| 259 | + | |
| 246 | 260 | for(i=2; i<g.argc; i++){ |
| 247 | 261 | file_tree_name(g.argv[i], &fname, 1); |
| 248 | 262 | blob_zero(&content); |
| 249 | 263 | rc = historical_version_of_file(zRev, blob_str(&fname), &content, 0,0,0,0); |
| 250 | 264 | if( rc==0 ){ |
| 251 | 265 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -63,10 +63,13 @@ | |
| 63 | if( find_option("status","s",0) ){ |
| 64 | Stmt q; |
| 65 | Blob line; |
| 66 | Blob fname; |
| 67 | int vid; |
| 68 | |
| 69 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 70 | vid = db_lget_int("checkout", 0); |
| 71 | if( vid==0 ){ |
| 72 | fossil_fatal("no checkout to finfo files in"); |
| @@ -115,10 +118,13 @@ | |
| 115 | blob_reset(&line); |
| 116 | }else if( find_option("print","p",0) ){ |
| 117 | Blob record; |
| 118 | Blob fname; |
| 119 | const char *zRevision = find_option("revision", "r", 1); |
| 120 | |
| 121 | file_tree_name(g.argv[2], &fname, 1); |
| 122 | if( zRevision ){ |
| 123 | historical_version_of_file(zRevision, blob_str(&fname), &record, 0,0,0,0); |
| 124 | }else{ |
| @@ -158,10 +164,14 @@ | |
| 158 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 159 | } |
| 160 | }else{ |
| 161 | iWidth = -1; |
| 162 | } |
| 163 | if( g.argc!=3 ){ |
| 164 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 165 | } |
| 166 | file_tree_name(g.argv[2], &fname, 1); |
| 167 | rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B %s", |
| @@ -241,10 +251,14 @@ | |
| 241 | int rc; |
| 242 | Blob content, fname; |
| 243 | const char *zRev; |
| 244 | db_find_and_open_repository(0, 0); |
| 245 | zRev = find_option("r","r",1); |
| 246 | for(i=2; i<g.argc; i++){ |
| 247 | file_tree_name(g.argv[i], &fname, 1); |
| 248 | blob_zero(&content); |
| 249 | rc = historical_version_of_file(zRev, blob_str(&fname), &content, 0,0,0,0); |
| 250 | if( rc==0 ){ |
| 251 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -63,10 +63,13 @@ | |
| 63 | if( find_option("status","s",0) ){ |
| 64 | Stmt q; |
| 65 | Blob line; |
| 66 | Blob fname; |
| 67 | int vid; |
| 68 | |
| 69 | /* We should be done with options.. */ |
| 70 | verify_all_options(); |
| 71 | |
| 72 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 73 | vid = db_lget_int("checkout", 0); |
| 74 | if( vid==0 ){ |
| 75 | fossil_fatal("no checkout to finfo files in"); |
| @@ -115,10 +118,13 @@ | |
| 118 | blob_reset(&line); |
| 119 | }else if( find_option("print","p",0) ){ |
| 120 | Blob record; |
| 121 | Blob fname; |
| 122 | const char *zRevision = find_option("revision", "r", 1); |
| 123 | |
| 124 | /* We should be done with options.. */ |
| 125 | verify_all_options(); |
| 126 | |
| 127 | file_tree_name(g.argv[2], &fname, 1); |
| 128 | if( zRevision ){ |
| 129 | historical_version_of_file(zRevision, blob_str(&fname), &record, 0,0,0,0); |
| 130 | }else{ |
| @@ -158,10 +164,14 @@ | |
| 164 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 165 | } |
| 166 | }else{ |
| 167 | iWidth = -1; |
| 168 | } |
| 169 | |
| 170 | /* We should be done with options.. */ |
| 171 | verify_all_options(); |
| 172 | |
| 173 | if( g.argc!=3 ){ |
| 174 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 175 | } |
| 176 | file_tree_name(g.argv[2], &fname, 1); |
| 177 | rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B %s", |
| @@ -241,10 +251,14 @@ | |
| 251 | int rc; |
| 252 | Blob content, fname; |
| 253 | const char *zRev; |
| 254 | db_find_and_open_repository(0, 0); |
| 255 | zRev = find_option("r","r",1); |
| 256 | |
| 257 | /* We should be done with options.. */ |
| 258 | verify_all_options(); |
| 259 | |
| 260 | for(i=2; i<g.argc; i++){ |
| 261 | file_tree_name(g.argv[i], &fname, 1); |
| 262 | blob_zero(&content); |
| 263 | rc = historical_version_of_file(zRev, blob_str(&fname), &content, 0,0,0,0); |
| 264 | if( rc==0 ){ |
| 265 |
+4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -197,10 +197,14 @@ | ||
| 197 | 197 | i64 fsize; |
| 198 | 198 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 199 | 199 | if( !verboseFlag ){ |
| 200 | 200 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 201 | 201 | } |
| 202 | + | |
| 203 | + /* We should be done with options.. */ | |
| 204 | + verify_all_options(); | |
| 205 | + | |
| 202 | 206 | if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){ |
| 203 | 207 | db_open_config(0); |
| 204 | 208 | db_record_repository_filename(g.argv[2]); |
| 205 | 209 | db_open_repository(g.argv[2]); |
| 206 | 210 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 207 | 211 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -197,10 +197,14 @@ | |
| 197 | i64 fsize; |
| 198 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 199 | if( !verboseFlag ){ |
| 200 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 201 | } |
| 202 | if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){ |
| 203 | db_open_config(0); |
| 204 | db_record_repository_filename(g.argv[2]); |
| 205 | db_open_repository(g.argv[2]); |
| 206 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 207 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -197,10 +197,14 @@ | |
| 197 | i64 fsize; |
| 198 | int verboseFlag = find_option("verbose","v",0)!=0; |
| 199 | if( !verboseFlag ){ |
| 200 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 201 | } |
| 202 | |
| 203 | /* We should be done with options.. */ |
| 204 | verify_all_options(); |
| 205 | |
| 206 | if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){ |
| 207 | db_open_config(0); |
| 208 | db_record_repository_filename(g.argv[2]); |
| 209 | db_open_repository(g.argv[2]); |
| 210 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 211 |
+16
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -936,12 +936,19 @@ | ||
| 936 | 936 | ** If the verbose option is specified, additional details will |
| 937 | 937 | ** be output about what optional features this binary was compiled |
| 938 | 938 | ** with |
| 939 | 939 | */ |
| 940 | 940 | void version_cmd(void){ |
| 941 | + int verboseFlag = 0; | |
| 942 | + | |
| 941 | 943 | fossil_print("This is fossil version %s\n", get_version()); |
| 942 | - if(!find_option("verbose","v",0)){ | |
| 944 | + verboseFlag = find_option("verbose","v",0)!=0; | |
| 945 | + | |
| 946 | + /* We should be done with options.. */ | |
| 947 | + verify_all_options(); | |
| 948 | + | |
| 949 | + if(!verboseFlag){ | |
| 943 | 950 | return; |
| 944 | 951 | }else{ |
| 945 | 952 | #if defined(FOSSIL_ENABLE_TCL) |
| 946 | 953 | int rc; |
| 947 | 954 | const char *zRc; |
| @@ -1928,10 +1935,14 @@ | ||
| 1928 | 1935 | if( zAltBase ) set_base_url(zAltBase); |
| 1929 | 1936 | if( find_option("https",0,0)!=0 ) cgi_replace_parameter("HTTPS","on"); |
| 1930 | 1937 | zHost = find_option("host", 0, 1); |
| 1931 | 1938 | if( zHost ) cgi_replace_parameter("HTTP_HOST",zHost); |
| 1932 | 1939 | g.cgiOutput = 1; |
| 1940 | + | |
| 1941 | + /* We should be done with options.. */ | |
| 1942 | + verify_all_options(); | |
| 1943 | + | |
| 1933 | 1944 | if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){ |
| 1934 | 1945 | fossil_fatal("no repository specified"); |
| 1935 | 1946 | } |
| 1936 | 1947 | g.fullHttpReply = 1; |
| 1937 | 1948 | if( g.argc==6 ){ |
| @@ -2107,10 +2118,14 @@ | ||
| 2107 | 2118 | set_base_url(zAltBase); |
| 2108 | 2119 | } |
| 2109 | 2120 | if ( find_option("localhost", 0, 0)!=0 ){ |
| 2110 | 2121 | flags |= HTTP_SERVER_LOCALHOST; |
| 2111 | 2122 | } |
| 2123 | + | |
| 2124 | + /* We should be done with options.. */ | |
| 2125 | + verify_all_options(); | |
| 2126 | + | |
| 2112 | 2127 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2113 | 2128 | isUiCmd = g.argv[1][0]=='u'; |
| 2114 | 2129 | if( isUiCmd ){ |
| 2115 | 2130 | flags |= HTTP_SERVER_LOCALHOST; |
| 2116 | 2131 | g.useLocalauth = 1; |
| 2117 | 2132 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -936,12 +936,19 @@ | |
| 936 | ** If the verbose option is specified, additional details will |
| 937 | ** be output about what optional features this binary was compiled |
| 938 | ** with |
| 939 | */ |
| 940 | void version_cmd(void){ |
| 941 | fossil_print("This is fossil version %s\n", get_version()); |
| 942 | if(!find_option("verbose","v",0)){ |
| 943 | return; |
| 944 | }else{ |
| 945 | #if defined(FOSSIL_ENABLE_TCL) |
| 946 | int rc; |
| 947 | const char *zRc; |
| @@ -1928,10 +1935,14 @@ | |
| 1928 | if( zAltBase ) set_base_url(zAltBase); |
| 1929 | if( find_option("https",0,0)!=0 ) cgi_replace_parameter("HTTPS","on"); |
| 1930 | zHost = find_option("host", 0, 1); |
| 1931 | if( zHost ) cgi_replace_parameter("HTTP_HOST",zHost); |
| 1932 | g.cgiOutput = 1; |
| 1933 | if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){ |
| 1934 | fossil_fatal("no repository specified"); |
| 1935 | } |
| 1936 | g.fullHttpReply = 1; |
| 1937 | if( g.argc==6 ){ |
| @@ -2107,10 +2118,14 @@ | |
| 2107 | set_base_url(zAltBase); |
| 2108 | } |
| 2109 | if ( find_option("localhost", 0, 0)!=0 ){ |
| 2110 | flags |= HTTP_SERVER_LOCALHOST; |
| 2111 | } |
| 2112 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2113 | isUiCmd = g.argv[1][0]=='u'; |
| 2114 | if( isUiCmd ){ |
| 2115 | flags |= HTTP_SERVER_LOCALHOST; |
| 2116 | g.useLocalauth = 1; |
| 2117 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -936,12 +936,19 @@ | |
| 936 | ** If the verbose option is specified, additional details will |
| 937 | ** be output about what optional features this binary was compiled |
| 938 | ** with |
| 939 | */ |
| 940 | void version_cmd(void){ |
| 941 | int verboseFlag = 0; |
| 942 | |
| 943 | fossil_print("This is fossil version %s\n", get_version()); |
| 944 | verboseFlag = find_option("verbose","v",0)!=0; |
| 945 | |
| 946 | /* We should be done with options.. */ |
| 947 | verify_all_options(); |
| 948 | |
| 949 | if(!verboseFlag){ |
| 950 | return; |
| 951 | }else{ |
| 952 | #if defined(FOSSIL_ENABLE_TCL) |
| 953 | int rc; |
| 954 | const char *zRc; |
| @@ -1928,10 +1935,14 @@ | |
| 1935 | if( zAltBase ) set_base_url(zAltBase); |
| 1936 | if( find_option("https",0,0)!=0 ) cgi_replace_parameter("HTTPS","on"); |
| 1937 | zHost = find_option("host", 0, 1); |
| 1938 | if( zHost ) cgi_replace_parameter("HTTP_HOST",zHost); |
| 1939 | g.cgiOutput = 1; |
| 1940 | |
| 1941 | /* We should be done with options.. */ |
| 1942 | verify_all_options(); |
| 1943 | |
| 1944 | if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){ |
| 1945 | fossil_fatal("no repository specified"); |
| 1946 | } |
| 1947 | g.fullHttpReply = 1; |
| 1948 | if( g.argc==6 ){ |
| @@ -2107,10 +2118,14 @@ | |
| 2118 | set_base_url(zAltBase); |
| 2119 | } |
| 2120 | if ( find_option("localhost", 0, 0)!=0 ){ |
| 2121 | flags |= HTTP_SERVER_LOCALHOST; |
| 2122 | } |
| 2123 | |
| 2124 | /* We should be done with options.. */ |
| 2125 | verify_all_options(); |
| 2126 | |
| 2127 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2128 | isUiCmd = g.argv[1][0]=='u'; |
| 2129 | if( isUiCmd ){ |
| 2130 | flags |= HTTP_SERVER_LOCALHOST; |
| 2131 | g.useLocalauth = 1; |
| 2132 |
+4
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -368,10 +368,14 @@ | ||
| 368 | 368 | ** fossil commit |
| 369 | 369 | ** |
| 370 | 370 | */ |
| 371 | 371 | void delta_3waymerge_cmd(void){ |
| 372 | 372 | Blob pivot, v1, v2, merged; |
| 373 | + | |
| 374 | + /* We should be done with options.. */ | |
| 375 | + verify_all_options(); | |
| 376 | + | |
| 373 | 377 | if( g.argc!=6 ){ |
| 374 | 378 | usage("PIVOT V1 V2 MERGED"); |
| 375 | 379 | } |
| 376 | 380 | if( blob_read_from_file(&pivot, g.argv[2])<0 ){ |
| 377 | 381 | fossil_fatal("cannot read %s\n", g.argv[2]); |
| 378 | 382 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -368,10 +368,14 @@ | |
| 368 | ** fossil commit |
| 369 | ** |
| 370 | */ |
| 371 | void delta_3waymerge_cmd(void){ |
| 372 | Blob pivot, v1, v2, merged; |
| 373 | if( g.argc!=6 ){ |
| 374 | usage("PIVOT V1 V2 MERGED"); |
| 375 | } |
| 376 | if( blob_read_from_file(&pivot, g.argv[2])<0 ){ |
| 377 | fossil_fatal("cannot read %s\n", g.argv[2]); |
| 378 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -368,10 +368,14 @@ | |
| 368 | ** fossil commit |
| 369 | ** |
| 370 | */ |
| 371 | void delta_3waymerge_cmd(void){ |
| 372 | Blob pivot, v1, v2, merged; |
| 373 | |
| 374 | /* We should be done with options.. */ |
| 375 | verify_all_options(); |
| 376 | |
| 377 | if( g.argc!=6 ){ |
| 378 | usage("PIVOT V1 V2 MERGED"); |
| 379 | } |
| 380 | if( blob_read_from_file(&pivot, g.argv[2])<0 ){ |
| 381 | fossil_fatal("cannot read %s\n", g.argv[2]); |
| 382 |
+4
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -659,10 +659,14 @@ | ||
| 659 | 659 | const char *zName; |
| 660 | 660 | int verboseFlag; |
| 661 | 661 | int i; |
| 662 | 662 | db_find_and_open_repository(0,0); |
| 663 | 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 664 | + | |
| 665 | + /* We should be done with options.. */ | |
| 666 | + verify_all_options(); | |
| 667 | + | |
| 664 | 668 | if( g.argc<3 ) usage("whatis NAME ..."); |
| 665 | 669 | for(i=2; i<g.argc; i++){ |
| 666 | 670 | zName = g.argv[i]; |
| 667 | 671 | if( i>2 ) fossil_print("%.79c\n",'-'); |
| 668 | 672 | rid = symbolic_name_to_rid(zName, 0); |
| 669 | 673 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -659,10 +659,14 @@ | |
| 659 | const char *zName; |
| 660 | int verboseFlag; |
| 661 | int i; |
| 662 | db_find_and_open_repository(0,0); |
| 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 664 | if( g.argc<3 ) usage("whatis NAME ..."); |
| 665 | for(i=2; i<g.argc; i++){ |
| 666 | zName = g.argv[i]; |
| 667 | if( i>2 ) fossil_print("%.79c\n",'-'); |
| 668 | rid = symbolic_name_to_rid(zName, 0); |
| 669 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -659,10 +659,14 @@ | |
| 659 | const char *zName; |
| 660 | int verboseFlag; |
| 661 | int i; |
| 662 | db_find_and_open_repository(0,0); |
| 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 664 | |
| 665 | /* We should be done with options.. */ |
| 666 | verify_all_options(); |
| 667 | |
| 668 | if( g.argc<3 ) usage("whatis NAME ..."); |
| 669 | for(i=2; i<g.argc; i++){ |
| 670 | zName = g.argv[i]; |
| 671 | if( i>2 ) fossil_print("%.79c\n",'-'); |
| 672 | rid = symbolic_name_to_rid(zName, 0); |
| 673 |
+12
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -578,10 +578,14 @@ | ||
| 578 | 578 | usage("?REPOSITORY-FILENAME?"); |
| 579 | 579 | } |
| 580 | 580 | db_close(1); |
| 581 | 581 | db_open_repository(g.zRepositoryName); |
| 582 | 582 | } |
| 583 | + | |
| 584 | + /* We should be done with options.. */ | |
| 585 | + verify_all_options(); | |
| 586 | + | |
| 583 | 587 | db_begin_transaction(); |
| 584 | 588 | ttyOutput = 1; |
| 585 | 589 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 586 | 590 | reconstruct_private_table(); |
| 587 | 591 | db_multi_exec( |
| @@ -793,10 +797,14 @@ | ||
| 793 | 797 | int privateOnly = find_option("private",0,0)!=0; |
| 794 | 798 | int bNeedRebuild = 0; |
| 795 | 799 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); |
| 796 | 800 | db_close(1); |
| 797 | 801 | db_open_repository(g.zRepositoryName); |
| 802 | + | |
| 803 | + /* We should be done with options.. */ | |
| 804 | + verify_all_options(); | |
| 805 | + | |
| 798 | 806 | if( !bForce ){ |
| 799 | 807 | Blob ans; |
| 800 | 808 | char cReply; |
| 801 | 809 | prompt_user( |
| 802 | 810 | "Scrubbing the repository will permanently delete information.\n" |
| @@ -915,10 +923,14 @@ | ||
| 915 | 923 | fossil_print("\"%s\" is not a directory\n\n", g.argv[3]); |
| 916 | 924 | usage("FILENAME DIRECTORY"); |
| 917 | 925 | } |
| 918 | 926 | db_create_repository(g.argv[2]); |
| 919 | 927 | db_open_repository(g.argv[2]); |
| 928 | + | |
| 929 | + /* We should be done with options.. */ | |
| 930 | + verify_all_options(); | |
| 931 | + | |
| 920 | 932 | db_open_config(0); |
| 921 | 933 | db_begin_transaction(); |
| 922 | 934 | db_initial_setup(0, 0, 0, 1); |
| 923 | 935 | |
| 924 | 936 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 925 | 937 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -578,10 +578,14 @@ | |
| 578 | usage("?REPOSITORY-FILENAME?"); |
| 579 | } |
| 580 | db_close(1); |
| 581 | db_open_repository(g.zRepositoryName); |
| 582 | } |
| 583 | db_begin_transaction(); |
| 584 | ttyOutput = 1; |
| 585 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 586 | reconstruct_private_table(); |
| 587 | db_multi_exec( |
| @@ -793,10 +797,14 @@ | |
| 793 | int privateOnly = find_option("private",0,0)!=0; |
| 794 | int bNeedRebuild = 0; |
| 795 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); |
| 796 | db_close(1); |
| 797 | db_open_repository(g.zRepositoryName); |
| 798 | if( !bForce ){ |
| 799 | Blob ans; |
| 800 | char cReply; |
| 801 | prompt_user( |
| 802 | "Scrubbing the repository will permanently delete information.\n" |
| @@ -915,10 +923,14 @@ | |
| 915 | fossil_print("\"%s\" is not a directory\n\n", g.argv[3]); |
| 916 | usage("FILENAME DIRECTORY"); |
| 917 | } |
| 918 | db_create_repository(g.argv[2]); |
| 919 | db_open_repository(g.argv[2]); |
| 920 | db_open_config(0); |
| 921 | db_begin_transaction(); |
| 922 | db_initial_setup(0, 0, 0, 1); |
| 923 | |
| 924 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 925 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -578,10 +578,14 @@ | |
| 578 | usage("?REPOSITORY-FILENAME?"); |
| 579 | } |
| 580 | db_close(1); |
| 581 | db_open_repository(g.zRepositoryName); |
| 582 | } |
| 583 | |
| 584 | /* We should be done with options.. */ |
| 585 | verify_all_options(); |
| 586 | |
| 587 | db_begin_transaction(); |
| 588 | ttyOutput = 1; |
| 589 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 590 | reconstruct_private_table(); |
| 591 | db_multi_exec( |
| @@ -793,10 +797,14 @@ | |
| 797 | int privateOnly = find_option("private",0,0)!=0; |
| 798 | int bNeedRebuild = 0; |
| 799 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); |
| 800 | db_close(1); |
| 801 | db_open_repository(g.zRepositoryName); |
| 802 | |
| 803 | /* We should be done with options.. */ |
| 804 | verify_all_options(); |
| 805 | |
| 806 | if( !bForce ){ |
| 807 | Blob ans; |
| 808 | char cReply; |
| 809 | prompt_user( |
| 810 | "Scrubbing the repository will permanently delete information.\n" |
| @@ -915,10 +923,14 @@ | |
| 923 | fossil_print("\"%s\" is not a directory\n\n", g.argv[3]); |
| 924 | usage("FILENAME DIRECTORY"); |
| 925 | } |
| 926 | db_create_repository(g.argv[2]); |
| 927 | db_open_repository(g.argv[2]); |
| 928 | |
| 929 | /* We should be done with options.. */ |
| 930 | verify_all_options(); |
| 931 | |
| 932 | db_open_config(0); |
| 933 | db_begin_transaction(); |
| 934 | db_initial_setup(0, 0, 0, 1); |
| 935 | |
| 936 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 937 |
-1
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -768,11 +768,10 @@ | ||
| 768 | 768 | */ |
| 769 | 769 | void re_test_grep(void){ |
| 770 | 770 | ReCompiled *pRe; |
| 771 | 771 | const char *zErr; |
| 772 | 772 | int ignoreCase = find_option("ignore-case","i",0)!=0; |
| 773 | - | |
| 774 | 773 | if( g.argc<3 ){ |
| 775 | 774 | usage("REGEXP [FILE...]"); |
| 776 | 775 | } |
| 777 | 776 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 778 | 777 | if( zErr ) fossil_fatal("%s", zErr); |
| 779 | 778 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -768,11 +768,10 @@ | |
| 768 | */ |
| 769 | void re_test_grep(void){ |
| 770 | ReCompiled *pRe; |
| 771 | const char *zErr; |
| 772 | int ignoreCase = find_option("ignore-case","i",0)!=0; |
| 773 | |
| 774 | if( g.argc<3 ){ |
| 775 | usage("REGEXP [FILE...]"); |
| 776 | } |
| 777 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 778 | if( zErr ) fossil_fatal("%s", zErr); |
| 779 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -768,11 +768,10 @@ | |
| 768 | */ |
| 769 | void re_test_grep(void){ |
| 770 | ReCompiled *pRe; |
| 771 | const char *zErr; |
| 772 | int ignoreCase = find_option("ignore-case","i",0)!=0; |
| 773 | if( g.argc<3 ){ |
| 774 | usage("REGEXP [FILE...]"); |
| 775 | } |
| 776 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 777 | if( zErr ) fossil_fatal("%s", zErr); |
| 778 |
+3
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -267,10 +267,13 @@ | ||
| 267 | 267 | if(!zBaseURL || !*zBaseURL){ |
| 268 | 268 | zBaseURL = "URL-PLACEHOLDER"; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | db_find_and_open_repository(0, 0); |
| 272 | + | |
| 273 | + /* We should be done with options.. */ | |
| 274 | + verify_all_options(); | |
| 272 | 275 | |
| 273 | 276 | blob_zero(&bSQL); |
| 274 | 277 | blob_append( &bSQL, zSQL1, -1 ); |
| 275 | 278 | |
| 276 | 279 | if( zType[0]!='a' ){ |
| 277 | 280 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -267,10 +267,13 @@ | |
| 267 | if(!zBaseURL || !*zBaseURL){ |
| 268 | zBaseURL = "URL-PLACEHOLDER"; |
| 269 | } |
| 270 | |
| 271 | db_find_and_open_repository(0, 0); |
| 272 | |
| 273 | blob_zero(&bSQL); |
| 274 | blob_append( &bSQL, zSQL1, -1 ); |
| 275 | |
| 276 | if( zType[0]!='a' ){ |
| 277 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -267,10 +267,13 @@ | |
| 267 | if(!zBaseURL || !*zBaseURL){ |
| 268 | zBaseURL = "URL-PLACEHOLDER"; |
| 269 | } |
| 270 | |
| 271 | db_find_and_open_repository(0, 0); |
| 272 | |
| 273 | /* We should be done with options.. */ |
| 274 | verify_all_options(); |
| 275 | |
| 276 | blob_zero(&bSQL); |
| 277 | blob_append( &bSQL, zSQL1, -1 ); |
| 278 | |
| 279 | if( zType[0]!='a' ){ |
| 280 |
+4
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -172,10 +172,14 @@ | ||
| 172 | 172 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 173 | 173 | const char *p; |
| 174 | 174 | |
| 175 | 175 | brief = find_option("brief", "b",0)!=0; |
| 176 | 176 | db_find_and_open_repository(0,0); |
| 177 | + | |
| 178 | + /* We should be done with options.. */ | |
| 179 | + verify_all_options(); | |
| 180 | + | |
| 177 | 181 | fsize = file_size(g.zRepositoryName); |
| 178 | 182 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 179 | 183 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| 180 | 184 | if( !brief ){ |
| 181 | 185 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 182 | 186 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -172,10 +172,14 @@ | |
| 172 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 173 | const char *p; |
| 174 | |
| 175 | brief = find_option("brief", "b",0)!=0; |
| 176 | db_find_and_open_repository(0,0); |
| 177 | fsize = file_size(g.zRepositoryName); |
| 178 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 179 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| 180 | if( !brief ){ |
| 181 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 182 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -172,10 +172,14 @@ | |
| 172 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 173 | const char *p; |
| 174 | |
| 175 | brief = find_option("brief", "b",0)!=0; |
| 176 | db_find_and_open_repository(0,0); |
| 177 | |
| 178 | /* We should be done with options.. */ |
| 179 | verify_all_options(); |
| 180 | |
| 181 | fsize = file_size(g.zRepositoryName); |
| 182 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 183 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| 184 | if( !brief ){ |
| 185 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 186 |
+16
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -186,10 +186,14 @@ | ||
| 186 | 186 | */ |
| 187 | 187 | void pull_cmd(void){ |
| 188 | 188 | unsigned configFlags = 0; |
| 189 | 189 | unsigned syncFlags = SYNC_PULL; |
| 190 | 190 | process_sync_args(&configFlags, &syncFlags); |
| 191 | + | |
| 192 | + /* We should be done with options.. */ | |
| 193 | + verify_all_options(); | |
| 194 | + | |
| 191 | 195 | client_sync(syncFlags, configFlags, 0); |
| 192 | 196 | } |
| 193 | 197 | |
| 194 | 198 | /* |
| 195 | 199 | ** COMMAND: push |
| @@ -217,10 +221,14 @@ | ||
| 217 | 221 | */ |
| 218 | 222 | void push_cmd(void){ |
| 219 | 223 | unsigned configFlags = 0; |
| 220 | 224 | unsigned syncFlags = SYNC_PUSH; |
| 221 | 225 | process_sync_args(&configFlags, &syncFlags); |
| 226 | + | |
| 227 | + /* We should be done with options.. */ | |
| 228 | + verify_all_options(); | |
| 229 | + | |
| 222 | 230 | if( db_get_boolean("dont-push",0) ){ |
| 223 | 231 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 224 | 232 | } |
| 225 | 233 | client_sync(syncFlags, 0, 0); |
| 226 | 234 | } |
| @@ -253,10 +261,14 @@ | ||
| 253 | 261 | */ |
| 254 | 262 | void sync_cmd(void){ |
| 255 | 263 | unsigned configFlags = 0; |
| 256 | 264 | unsigned syncFlags = SYNC_PUSH|SYNC_PULL; |
| 257 | 265 | process_sync_args(&configFlags, &syncFlags); |
| 266 | + | |
| 267 | + /* We should be done with options.. */ | |
| 268 | + verify_all_options(); | |
| 269 | + | |
| 258 | 270 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 259 | 271 | client_sync(syncFlags, configFlags, 0); |
| 260 | 272 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 261 | 273 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 262 | 274 | } |
| @@ -280,10 +292,14 @@ | ||
| 280 | 292 | ** See also: clone, push, pull, sync |
| 281 | 293 | */ |
| 282 | 294 | void remote_url_cmd(void){ |
| 283 | 295 | char *zUrl; |
| 284 | 296 | db_find_and_open_repository(0, 0); |
| 297 | + | |
| 298 | + /* We should be done with options.. */ | |
| 299 | + verify_all_options(); | |
| 300 | + | |
| 285 | 301 | if( g.argc!=2 && g.argc!=3 ){ |
| 286 | 302 | usage("remote-url ?URL|off?"); |
| 287 | 303 | } |
| 288 | 304 | if( g.argc==3 ){ |
| 289 | 305 | db_unset("last-sync-url", 0); |
| 290 | 306 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -186,10 +186,14 @@ | |
| 186 | */ |
| 187 | void pull_cmd(void){ |
| 188 | unsigned configFlags = 0; |
| 189 | unsigned syncFlags = SYNC_PULL; |
| 190 | process_sync_args(&configFlags, &syncFlags); |
| 191 | client_sync(syncFlags, configFlags, 0); |
| 192 | } |
| 193 | |
| 194 | /* |
| 195 | ** COMMAND: push |
| @@ -217,10 +221,14 @@ | |
| 217 | */ |
| 218 | void push_cmd(void){ |
| 219 | unsigned configFlags = 0; |
| 220 | unsigned syncFlags = SYNC_PUSH; |
| 221 | process_sync_args(&configFlags, &syncFlags); |
| 222 | if( db_get_boolean("dont-push",0) ){ |
| 223 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 224 | } |
| 225 | client_sync(syncFlags, 0, 0); |
| 226 | } |
| @@ -253,10 +261,14 @@ | |
| 253 | */ |
| 254 | void sync_cmd(void){ |
| 255 | unsigned configFlags = 0; |
| 256 | unsigned syncFlags = SYNC_PUSH|SYNC_PULL; |
| 257 | process_sync_args(&configFlags, &syncFlags); |
| 258 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 259 | client_sync(syncFlags, configFlags, 0); |
| 260 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 261 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 262 | } |
| @@ -280,10 +292,14 @@ | |
| 280 | ** See also: clone, push, pull, sync |
| 281 | */ |
| 282 | void remote_url_cmd(void){ |
| 283 | char *zUrl; |
| 284 | db_find_and_open_repository(0, 0); |
| 285 | if( g.argc!=2 && g.argc!=3 ){ |
| 286 | usage("remote-url ?URL|off?"); |
| 287 | } |
| 288 | if( g.argc==3 ){ |
| 289 | db_unset("last-sync-url", 0); |
| 290 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -186,10 +186,14 @@ | |
| 186 | */ |
| 187 | void pull_cmd(void){ |
| 188 | unsigned configFlags = 0; |
| 189 | unsigned syncFlags = SYNC_PULL; |
| 190 | process_sync_args(&configFlags, &syncFlags); |
| 191 | |
| 192 | /* We should be done with options.. */ |
| 193 | verify_all_options(); |
| 194 | |
| 195 | client_sync(syncFlags, configFlags, 0); |
| 196 | } |
| 197 | |
| 198 | /* |
| 199 | ** COMMAND: push |
| @@ -217,10 +221,14 @@ | |
| 221 | */ |
| 222 | void push_cmd(void){ |
| 223 | unsigned configFlags = 0; |
| 224 | unsigned syncFlags = SYNC_PUSH; |
| 225 | process_sync_args(&configFlags, &syncFlags); |
| 226 | |
| 227 | /* We should be done with options.. */ |
| 228 | verify_all_options(); |
| 229 | |
| 230 | if( db_get_boolean("dont-push",0) ){ |
| 231 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 232 | } |
| 233 | client_sync(syncFlags, 0, 0); |
| 234 | } |
| @@ -253,10 +261,14 @@ | |
| 261 | */ |
| 262 | void sync_cmd(void){ |
| 263 | unsigned configFlags = 0; |
| 264 | unsigned syncFlags = SYNC_PUSH|SYNC_PULL; |
| 265 | process_sync_args(&configFlags, &syncFlags); |
| 266 | |
| 267 | /* We should be done with options.. */ |
| 268 | verify_all_options(); |
| 269 | |
| 270 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 271 | client_sync(syncFlags, configFlags, 0); |
| 272 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 273 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 274 | } |
| @@ -280,10 +292,14 @@ | |
| 292 | ** See also: clone, push, pull, sync |
| 293 | */ |
| 294 | void remote_url_cmd(void){ |
| 295 | char *zUrl; |
| 296 | db_find_and_open_repository(0, 0); |
| 297 | |
| 298 | /* We should be done with options.. */ |
| 299 | verify_all_options(); |
| 300 | |
| 301 | if( g.argc!=2 && g.argc!=3 ){ |
| 302 | usage("remote-url ?URL|off?"); |
| 303 | } |
| 304 | if( g.argc==3 ){ |
| 305 | db_unset("last-sync-url", 0); |
| 306 |
+4
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -540,10 +540,14 @@ | ||
| 540 | 540 | int rid; |
| 541 | 541 | Blob tarball; |
| 542 | 542 | const char *zName; |
| 543 | 543 | zName = find_option("name", 0, 1); |
| 544 | 544 | db_find_and_open_repository(0, 0); |
| 545 | + | |
| 546 | + /* We should be done with options.. */ | |
| 547 | + verify_all_options(); | |
| 548 | + | |
| 545 | 549 | if( g.argc!=4 ){ |
| 546 | 550 | usage("VERSION OUTPUTFILE"); |
| 547 | 551 | } |
| 548 | 552 | rid = name_to_typed_rid(g.argv[2], "ci"); |
| 549 | 553 | if( rid==0 ){ |
| 550 | 554 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -540,10 +540,14 @@ | |
| 540 | int rid; |
| 541 | Blob tarball; |
| 542 | const char *zName; |
| 543 | zName = find_option("name", 0, 1); |
| 544 | db_find_and_open_repository(0, 0); |
| 545 | if( g.argc!=4 ){ |
| 546 | usage("VERSION OUTPUTFILE"); |
| 547 | } |
| 548 | rid = name_to_typed_rid(g.argv[2], "ci"); |
| 549 | if( rid==0 ){ |
| 550 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -540,10 +540,14 @@ | |
| 540 | int rid; |
| 541 | Blob tarball; |
| 542 | const char *zName; |
| 543 | zName = find_option("name", 0, 1); |
| 544 | db_find_and_open_repository(0, 0); |
| 545 | |
| 546 | /* We should be done with options.. */ |
| 547 | verify_all_options(); |
| 548 | |
| 549 | if( g.argc!=4 ){ |
| 550 | usage("VERSION OUTPUTFILE"); |
| 551 | } |
| 552 | rid = name_to_typed_rid(g.argv[2], "ci"); |
| 553 | if( rid==0 ){ |
| 554 |
+4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1779,10 +1779,14 @@ | ||
| 1779 | 1779 | }else{ |
| 1780 | 1780 | width = -1; |
| 1781 | 1781 | } |
| 1782 | 1782 | zOffset = find_option("offset",0,1); |
| 1783 | 1783 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1784 | + | |
| 1785 | + /* We should be done with options.. */ | |
| 1786 | + verify_all_options(); | |
| 1787 | + | |
| 1784 | 1788 | if( g.argc>=4 ){ |
| 1785 | 1789 | k = strlen(g.argv[2]); |
| 1786 | 1790 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1787 | 1791 | mode = 1; |
| 1788 | 1792 | }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){ |
| 1789 | 1793 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1779,10 +1779,14 @@ | |
| 1779 | }else{ |
| 1780 | width = -1; |
| 1781 | } |
| 1782 | zOffset = find_option("offset",0,1); |
| 1783 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1784 | if( g.argc>=4 ){ |
| 1785 | k = strlen(g.argv[2]); |
| 1786 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1787 | mode = 1; |
| 1788 | }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){ |
| 1789 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1779,10 +1779,14 @@ | |
| 1779 | }else{ |
| 1780 | width = -1; |
| 1781 | } |
| 1782 | zOffset = find_option("offset",0,1); |
| 1783 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1784 | |
| 1785 | /* We should be done with options.. */ |
| 1786 | verify_all_options(); |
| 1787 | |
| 1788 | if( g.argc>=4 ){ |
| 1789 | k = strlen(g.argv[2]); |
| 1790 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1791 | mode = 1; |
| 1792 | }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){ |
| 1793 |
+4
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -139,10 +139,14 @@ | ||
| 139 | 139 | verboseFlag = find_option("verbose","v",0)!=0; |
| 140 | 140 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 141 | 141 | debugFlag = find_option("debug",0,0)!=0; |
| 142 | 142 | setmtimeFlag = find_option("setmtime",0,0)!=0; |
| 143 | 143 | capture_case_sensitive_option(); |
| 144 | + | |
| 145 | + /* We should be done with options.. */ | |
| 146 | + verify_all_options(); | |
| 147 | + | |
| 144 | 148 | db_must_be_within_tree(); |
| 145 | 149 | vid = db_lget_int("checkout", 0); |
| 146 | 150 | user_select(); |
| 147 | 151 | if( !dryRunFlag && !internalUpdate ){ |
| 148 | 152 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 149 | 153 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -139,10 +139,14 @@ | |
| 139 | verboseFlag = find_option("verbose","v",0)!=0; |
| 140 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 141 | debugFlag = find_option("debug",0,0)!=0; |
| 142 | setmtimeFlag = find_option("setmtime",0,0)!=0; |
| 143 | capture_case_sensitive_option(); |
| 144 | db_must_be_within_tree(); |
| 145 | vid = db_lget_int("checkout", 0); |
| 146 | user_select(); |
| 147 | if( !dryRunFlag && !internalUpdate ){ |
| 148 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 149 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -139,10 +139,14 @@ | |
| 139 | verboseFlag = find_option("verbose","v",0)!=0; |
| 140 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 141 | debugFlag = find_option("debug",0,0)!=0; |
| 142 | setmtimeFlag = find_option("setmtime",0,0)!=0; |
| 143 | capture_case_sensitive_option(); |
| 144 | |
| 145 | /* We should be done with options.. */ |
| 146 | verify_all_options(); |
| 147 | |
| 148 | db_must_be_within_tree(); |
| 149 | vid = db_lget_int("checkout", 0); |
| 150 | user_select(); |
| 151 | if( !dryRunFlag && !internalUpdate ){ |
| 152 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 153 |
+4
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -393,10 +393,14 @@ | ||
| 393 | 393 | int rid; |
| 394 | 394 | Blob zip; |
| 395 | 395 | const char *zName; |
| 396 | 396 | zName = find_option("name", 0, 1); |
| 397 | 397 | db_find_and_open_repository(0, 0); |
| 398 | + | |
| 399 | + /* We should be done with options.. */ | |
| 400 | + verify_all_options(); | |
| 401 | + | |
| 398 | 402 | if( g.argc!=4 ){ |
| 399 | 403 | usage("VERSION OUTPUTFILE"); |
| 400 | 404 | } |
| 401 | 405 | rid = name_to_typed_rid(g.argv[2],"ci"); |
| 402 | 406 | if( zName==0 ){ |
| 403 | 407 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -393,10 +393,14 @@ | |
| 393 | int rid; |
| 394 | Blob zip; |
| 395 | const char *zName; |
| 396 | zName = find_option("name", 0, 1); |
| 397 | db_find_and_open_repository(0, 0); |
| 398 | if( g.argc!=4 ){ |
| 399 | usage("VERSION OUTPUTFILE"); |
| 400 | } |
| 401 | rid = name_to_typed_rid(g.argv[2],"ci"); |
| 402 | if( zName==0 ){ |
| 403 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -393,10 +393,14 @@ | |
| 393 | int rid; |
| 394 | Blob zip; |
| 395 | const char *zName; |
| 396 | zName = find_option("name", 0, 1); |
| 397 | db_find_and_open_repository(0, 0); |
| 398 | |
| 399 | /* We should be done with options.. */ |
| 400 | verify_all_options(); |
| 401 | |
| 402 | if( g.argc!=4 ){ |
| 403 | usage("VERSION OUTPUTFILE"); |
| 404 | } |
| 405 | rid = name_to_typed_rid(g.argv[2],"ci"); |
| 406 | if( zName==0 ){ |
| 407 |