Fossil SCM

Added -- support to (3-way-merge, open, sqlar, stash save|snapshot, tarball, touch, undo/redo, update, zip).

stephan 2019-09-27 23:56 double-dash-flag
Commit 52ae3288abed44167db30773fa7d8aa47c2903215dff71457f0d5522a9940ef8
+5 -2
--- src/db.c
+++ src/db.c
@@ -2904,11 +2904,11 @@
29042904
}
29052905
29062906
/*
29072907
** COMMAND: open
29082908
**
2909
-** Usage: %fossil open FILENAME ?VERSION? ?OPTIONS?
2909
+** Usage: %fossil open ?OPTIONS? ?--? FILENAME ?VERSION?
29102910
**
29112911
** Open a connection to the local repository in FILENAME. A checkout
29122912
** for the repository is created with its root at the working directory.
29132913
** If VERSION is specified then that version is checked out. Otherwise
29142914
** the latest version is checked out. No files other than "manifest"
@@ -2922,10 +2922,13 @@
29222922
** --nested Allow opening a repository inside an opened checkout
29232923
** --force-missing Force opening a repository with missing content
29242924
** --setmtime Set timestamps of all files to match their SCM-side
29252925
** times (the timestamp of the last checkin which modified
29262926
** them).
2927
+** -- Treat all following arguments as files, even if they
2928
+** look like flags. Use before the FILENAME or VERSION,
2929
+** but not both.
29272930
**
29282931
** See also: close
29292932
*/
29302933
void cmd_open(void){
29312934
int emptyFlag;
@@ -2942,11 +2945,11 @@
29422945
forceMissingFlag = find_option("force-missing",0,0)!=0;
29432946
allowNested = find_option("nested",0,0)!=0;
29442947
setmtimeFlag = find_option("setmtime",0,0)!=0;
29452948
29462949
/* We should be done with options.. */
2947
- verify_all_options();
2950
+ verify_all_options2();
29482951
29492952
if( g.argc!=3 && g.argc!=4 ){
29502953
usage("REPOSITORY-FILENAME ?VERSION?");
29512954
}
29522955
if( !allowNested && db_open_local(0) ){
29532956
--- src/db.c
+++ src/db.c
@@ -2904,11 +2904,11 @@
2904 }
2905
2906 /*
2907 ** COMMAND: open
2908 **
2909 ** Usage: %fossil open FILENAME ?VERSION? ?OPTIONS?
2910 **
2911 ** Open a connection to the local repository in FILENAME. A checkout
2912 ** for the repository is created with its root at the working directory.
2913 ** If VERSION is specified then that version is checked out. Otherwise
2914 ** the latest version is checked out. No files other than "manifest"
@@ -2922,10 +2922,13 @@
2922 ** --nested Allow opening a repository inside an opened checkout
2923 ** --force-missing Force opening a repository with missing content
2924 ** --setmtime Set timestamps of all files to match their SCM-side
2925 ** times (the timestamp of the last checkin which modified
2926 ** them).
 
 
 
2927 **
2928 ** See also: close
2929 */
2930 void cmd_open(void){
2931 int emptyFlag;
@@ -2942,11 +2945,11 @@
2942 forceMissingFlag = find_option("force-missing",0,0)!=0;
2943 allowNested = find_option("nested",0,0)!=0;
2944 setmtimeFlag = find_option("setmtime",0,0)!=0;
2945
2946 /* We should be done with options.. */
2947 verify_all_options();
2948
2949 if( g.argc!=3 && g.argc!=4 ){
2950 usage("REPOSITORY-FILENAME ?VERSION?");
2951 }
2952 if( !allowNested && db_open_local(0) ){
2953
--- src/db.c
+++ src/db.c
@@ -2904,11 +2904,11 @@
2904 }
2905
2906 /*
2907 ** COMMAND: open
2908 **
2909 ** Usage: %fossil open ?OPTIONS? ?--? FILENAME ?VERSION?
2910 **
2911 ** Open a connection to the local repository in FILENAME. A checkout
2912 ** for the repository is created with its root at the working directory.
2913 ** If VERSION is specified then that version is checked out. Otherwise
2914 ** the latest version is checked out. No files other than "manifest"
@@ -2922,10 +2922,13 @@
2922 ** --nested Allow opening a repository inside an opened checkout
2923 ** --force-missing Force opening a repository with missing content
2924 ** --setmtime Set timestamps of all files to match their SCM-side
2925 ** times (the timestamp of the last checkin which modified
2926 ** them).
2927 ** -- Treat all following arguments as files, even if they
2928 ** look like flags. Use before the FILENAME or VERSION,
2929 ** but not both.
2930 **
2931 ** See also: close
2932 */
2933 void cmd_open(void){
2934 int emptyFlag;
@@ -2942,11 +2945,11 @@
2945 forceMissingFlag = find_option("force-missing",0,0)!=0;
2946 allowNested = find_option("nested",0,0)!=0;
2947 setmtimeFlag = find_option("setmtime",0,0)!=0;
2948
2949 /* We should be done with options.. */
2950 verify_all_options2();
2951
2952 if( g.argc!=3 && g.argc!=4 ){
2953 usage("REPOSITORY-FILENAME ?VERSION?");
2954 }
2955 if( !allowNested && db_open_local(0) ){
2956
+4 -2
--- src/file.c
+++ src/file.c
@@ -1999,11 +1999,11 @@
19991999
}
20002000
20012001
/*
20022002
** COMMAND: touch*
20032003
**
2004
-** Usage: %fossil touch ?OPTIONS? ?FILENAME...?
2004
+** Usage: %fossil touch ?OPTIONS? ?--? ?FILENAME...?
20052005
**
20062006
** For each file in the current checkout matching one of the provided
20072007
** list of glob patterns and/or file names, the file's mtime is
20082008
** updated to a value specified by one of the flags --checkout,
20092009
** --checkin, or --now.
@@ -2028,10 +2028,12 @@
20282028
** and each file it touches.
20292029
** -n|--dry-run Outputs which files would require touching,
20302030
** but does not touch them.
20312031
** -q|--quiet Suppress warnings, e.g. when skipping unmanaged
20322032
** or out-of-tree files.
2033
+** -- Treat all following arguments as non-flags, even if
2034
+** they look like flags.
20332035
**
20342036
** Only one of --now, --checkin, and --checkout may be used. The
20352037
** default is --now.
20362038
**
20372039
** Only one of -g or -G may be used. If neither is provided and no
@@ -2100,11 +2102,11 @@
21002102
fossil_print("Timestamp = current system time.\n");
21012103
}
21022104
}
21032105
}
21042106
2105
- verify_all_options();
2107
+ verify_all_options2();
21062108
21072109
db_must_be_within_tree();
21082110
vid = db_lget_int("checkout", 0);
21092111
if(vid==0){
21102112
fossil_fatal("Cannot determine checkout version.");
21112113
--- src/file.c
+++ src/file.c
@@ -1999,11 +1999,11 @@
1999 }
2000
2001 /*
2002 ** COMMAND: touch*
2003 **
2004 ** Usage: %fossil touch ?OPTIONS? ?FILENAME...?
2005 **
2006 ** For each file in the current checkout matching one of the provided
2007 ** list of glob patterns and/or file names, the file's mtime is
2008 ** updated to a value specified by one of the flags --checkout,
2009 ** --checkin, or --now.
@@ -2028,10 +2028,12 @@
2028 ** and each file it touches.
2029 ** -n|--dry-run Outputs which files would require touching,
2030 ** but does not touch them.
2031 ** -q|--quiet Suppress warnings, e.g. when skipping unmanaged
2032 ** or out-of-tree files.
 
 
2033 **
2034 ** Only one of --now, --checkin, and --checkout may be used. The
2035 ** default is --now.
2036 **
2037 ** Only one of -g or -G may be used. If neither is provided and no
@@ -2100,11 +2102,11 @@
2100 fossil_print("Timestamp = current system time.\n");
2101 }
2102 }
2103 }
2104
2105 verify_all_options();
2106
2107 db_must_be_within_tree();
2108 vid = db_lget_int("checkout", 0);
2109 if(vid==0){
2110 fossil_fatal("Cannot determine checkout version.");
2111
--- src/file.c
+++ src/file.c
@@ -1999,11 +1999,11 @@
1999 }
2000
2001 /*
2002 ** COMMAND: touch*
2003 **
2004 ** Usage: %fossil touch ?OPTIONS? ?--? ?FILENAME...?
2005 **
2006 ** For each file in the current checkout matching one of the provided
2007 ** list of glob patterns and/or file names, the file's mtime is
2008 ** updated to a value specified by one of the flags --checkout,
2009 ** --checkin, or --now.
@@ -2028,10 +2028,12 @@
2028 ** and each file it touches.
2029 ** -n|--dry-run Outputs which files would require touching,
2030 ** but does not touch them.
2031 ** -q|--quiet Suppress warnings, e.g. when skipping unmanaged
2032 ** or out-of-tree files.
2033 ** -- Treat all following arguments as non-flags, even if
2034 ** they look like flags.
2035 **
2036 ** Only one of --now, --checkin, and --checkout may be used. The
2037 ** default is --now.
2038 **
2039 ** Only one of -g or -G may be used. If neither is provided and no
@@ -2100,11 +2102,11 @@
2102 fossil_print("Timestamp = current system time.\n");
2103 }
2104 }
2105 }
2106
2107 verify_all_options2();
2108
2109 db_must_be_within_tree();
2110 vid = db_lget_int("checkout", 0);
2111 if(vid==0){
2112 fossil_fatal("Cannot determine checkout version.");
2113
+5 -3
--- src/merge3.c
+++ src/merge3.c
@@ -342,18 +342,20 @@
342342
}
343343
344344
/*
345345
** COMMAND: 3-way-merge*
346346
**
347
-** Usage: %fossil 3-way-merge BASELINE V1 V2 MERGED
347
+** Usage: %fossil 3-way-merge ?--? BASELINE V1 V2 MERGED
348348
**
349349
** Inputs are files BASELINE, V1, and V2. The file MERGED is generated
350350
** as output.
351351
**
352352
** BASELINE is a common ancestor of two files V1 and V2 that have diverging
353353
** edits. The generated output file MERGED is the combination of all
354
-** changes in both V1 and V2.
354
+** changes in both V1 and V2. The -- flag may be used one time, anywhere
355
+** in the argument list, to mean that all following arguments should be
356
+** treated as filenames even if they look like flags.
355357
**
356358
** This command has no effect on the Fossil repository. It is a utility
357359
** command made available for the convenience of users. This command can
358360
** be used, for example, to help import changes from an upstream project.
359361
**
@@ -371,11 +373,11 @@
371373
void delta_3waymerge_cmd(void){
372374
Blob pivot, v1, v2, merged;
373375
int nConflict;
374376
375377
/* We should be done with options.. */
376
- verify_all_options();
378
+ verify_all_options2();
377379
378380
if( g.argc!=6 ){
379381
usage("PIVOT V1 V2 MERGED");
380382
}
381383
if( blob_read_from_file(&pivot, g.argv[2], ExtFILE)<0 ){
382384
--- src/merge3.c
+++ src/merge3.c
@@ -342,18 +342,20 @@
342 }
343
344 /*
345 ** COMMAND: 3-way-merge*
346 **
347 ** Usage: %fossil 3-way-merge BASELINE V1 V2 MERGED
348 **
349 ** Inputs are files BASELINE, V1, and V2. The file MERGED is generated
350 ** as output.
351 **
352 ** BASELINE is a common ancestor of two files V1 and V2 that have diverging
353 ** edits. The generated output file MERGED is the combination of all
354 ** changes in both V1 and V2.
 
 
355 **
356 ** This command has no effect on the Fossil repository. It is a utility
357 ** command made available for the convenience of users. This command can
358 ** be used, for example, to help import changes from an upstream project.
359 **
@@ -371,11 +373,11 @@
371 void delta_3waymerge_cmd(void){
372 Blob pivot, v1, v2, merged;
373 int nConflict;
374
375 /* We should be done with options.. */
376 verify_all_options();
377
378 if( g.argc!=6 ){
379 usage("PIVOT V1 V2 MERGED");
380 }
381 if( blob_read_from_file(&pivot, g.argv[2], ExtFILE)<0 ){
382
--- src/merge3.c
+++ src/merge3.c
@@ -342,18 +342,20 @@
342 }
343
344 /*
345 ** COMMAND: 3-way-merge*
346 **
347 ** Usage: %fossil 3-way-merge ?--? BASELINE V1 V2 MERGED
348 **
349 ** Inputs are files BASELINE, V1, and V2. The file MERGED is generated
350 ** as output.
351 **
352 ** BASELINE is a common ancestor of two files V1 and V2 that have diverging
353 ** edits. The generated output file MERGED is the combination of all
354 ** changes in both V1 and V2. The -- flag may be used one time, anywhere
355 ** in the argument list, to mean that all following arguments should be
356 ** treated as filenames even if they look like flags.
357 **
358 ** This command has no effect on the Fossil repository. It is a utility
359 ** command made available for the convenience of users. This command can
360 ** be used, for example, to help import changes from an upstream project.
361 **
@@ -371,11 +373,11 @@
373 void delta_3waymerge_cmd(void){
374 Blob pivot, v1, v2, merged;
375 int nConflict;
376
377 /* We should be done with options.. */
378 verify_all_options2();
379
380 if( g.argc!=6 ){
381 usage("PIVOT V1 V2 MERGED");
382 }
383 if( blob_read_from_file(&pivot, g.argv[2], ExtFILE)<0 ){
384
+4 -2
--- src/name.c
+++ src/name.c
@@ -790,11 +790,11 @@
790790
}
791791
792792
/*
793793
** COMMAND: whatis*
794794
**
795
-** Usage: %fossil whatis NAME
795
+** Usage: %fossil whatis ?--? NAME
796796
**
797797
** Resolve the symbol NAME into its canonical artifact hash
798798
** artifact name and provide a description of what role that artifact
799799
** plays.
800800
**
@@ -801,10 +801,12 @@
801801
** Options:
802802
**
803803
** --type TYPE Only find artifacts of TYPE (one of: 'ci', 't',
804804
** 'w', 'g', or 'e').
805805
** -v|--verbose Provide extra information (such as the RID)
806
+** -- Treat all following arguments as non-flags, even if
807
+** they look like flags.
806808
*/
807809
void whatis_cmd(void){
808810
int rid;
809811
const char *zName;
810812
int verboseFlag;
@@ -813,11 +815,11 @@
813815
db_find_and_open_repository(0,0);
814816
verboseFlag = find_option("verbose","v",0)!=0;
815817
zType = find_option("type",0,1);
816818
817819
/* We should be done with options.. */
818
- verify_all_options();
820
+ verify_all_options2();
819821
820822
if( g.argc<3 ) usage("NAME ...");
821823
for(i=2; i<g.argc; i++){
822824
zName = g.argv[i];
823825
if( i>2 ) fossil_print("%.79c\n",'-');
824826
--- src/name.c
+++ src/name.c
@@ -790,11 +790,11 @@
790 }
791
792 /*
793 ** COMMAND: whatis*
794 **
795 ** Usage: %fossil whatis NAME
796 **
797 ** Resolve the symbol NAME into its canonical artifact hash
798 ** artifact name and provide a description of what role that artifact
799 ** plays.
800 **
@@ -801,10 +801,12 @@
801 ** Options:
802 **
803 ** --type TYPE Only find artifacts of TYPE (one of: 'ci', 't',
804 ** 'w', 'g', or 'e').
805 ** -v|--verbose Provide extra information (such as the RID)
 
 
806 */
807 void whatis_cmd(void){
808 int rid;
809 const char *zName;
810 int verboseFlag;
@@ -813,11 +815,11 @@
813 db_find_and_open_repository(0,0);
814 verboseFlag = find_option("verbose","v",0)!=0;
815 zType = find_option("type",0,1);
816
817 /* We should be done with options.. */
818 verify_all_options();
819
820 if( g.argc<3 ) usage("NAME ...");
821 for(i=2; i<g.argc; i++){
822 zName = g.argv[i];
823 if( i>2 ) fossil_print("%.79c\n",'-');
824
--- src/name.c
+++ src/name.c
@@ -790,11 +790,11 @@
790 }
791
792 /*
793 ** COMMAND: whatis*
794 **
795 ** Usage: %fossil whatis ?--? NAME
796 **
797 ** Resolve the symbol NAME into its canonical artifact hash
798 ** artifact name and provide a description of what role that artifact
799 ** plays.
800 **
@@ -801,10 +801,12 @@
801 ** Options:
802 **
803 ** --type TYPE Only find artifacts of TYPE (one of: 'ci', 't',
804 ** 'w', 'g', or 'e').
805 ** -v|--verbose Provide extra information (such as the RID)
806 ** -- Treat all following arguments as non-flags, even if
807 ** they look like flags.
808 */
809 void whatis_cmd(void){
810 int rid;
811 const char *zName;
812 int verboseFlag;
@@ -813,11 +815,11 @@
815 db_find_and_open_repository(0,0);
816 verboseFlag = find_option("verbose","v",0)!=0;
817 zType = find_option("type",0,1);
818
819 /* We should be done with options.. */
820 verify_all_options2();
821
822 if( g.argc<3 ) usage("NAME ...");
823 for(i=2; i<g.argc; i++){
824 zName = g.argv[i];
825 if( i>2 ) fossil_print("%.79c\n",'-');
826
+10 -5
--- src/stash.c
+++ src/stash.c
@@ -259,11 +259,11 @@
259259
const char *zComment; /* Comment to add to the stash */
260260
int stashid; /* ID of the new stash */
261261
int vid; /* Current checkout */
262262
263263
zComment = find_option("comment", "m", 1);
264
- verify_all_options();
264
+ verify_all_options2();
265265
if( zComment==0 ){
266266
Blob prompt; /* Prompt for stash comment */
267267
Blob comment; /* User comment reply */
268268
#if defined(_WIN32) || defined(__CYGWIN__)
269269
int bomSize;
@@ -511,12 +511,12 @@
511511
** COMMAND: stash
512512
**
513513
** Usage: %fossil stash SUBCOMMAND ARGS...
514514
**
515515
** fossil stash
516
-** fossil stash save ?-m|--comment COMMENT? ?FILES...?
517
-** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
516
+** fossil stash save ?-m|--comment COMMENT? ?--? ?FILES...?
517
+** fossil stash snapshot ?-m|--comment COMMENT? ?--? ?FILES...?
518518
**
519519
** Save the current changes in the working tree as a new stash.
520520
** Then revert the changes back to the last check-in. If FILES
521521
** are listed, then only stash and revert the named files. The
522522
** "save" verb can be omitted if and only if there are no other
@@ -562,20 +562,25 @@
562562
** directory would be if STASHID were applied. With gdiff,
563563
** gdiff-command is used instead of internal diff logic.
564564
**
565565
** SUMMARY:
566566
** fossil stash
567
-** fossil stash save ?-m|--comment COMMENT? ?FILES...?
568
-** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
567
+** fossil stash save ?-m|--comment COMMENT? ?--? ?FILES...?
568
+** fossil stash snapshot ?-m|--comment COMMENT? ?--? ?FILES...?
569569
** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>?
570570
** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
571571
** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
572572
** fossil stash pop
573573
** fossil stash apply|goto ?STASHID?
574574
** fossil stash drop|rm ?STASHID? ?-a|--all?
575575
** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
576576
** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
577
+**
578
+** Options:
579
+** -- For commands which support it, treat all following
580
+** arguments as non-flags, even if they look like flags.
581
+**
577582
*/
578583
void stash_cmd(void){
579584
const char *zCmd;
580585
int nCmd;
581586
int stashid = 0;
582587
--- src/stash.c
+++ src/stash.c
@@ -259,11 +259,11 @@
259 const char *zComment; /* Comment to add to the stash */
260 int stashid; /* ID of the new stash */
261 int vid; /* Current checkout */
262
263 zComment = find_option("comment", "m", 1);
264 verify_all_options();
265 if( zComment==0 ){
266 Blob prompt; /* Prompt for stash comment */
267 Blob comment; /* User comment reply */
268 #if defined(_WIN32) || defined(__CYGWIN__)
269 int bomSize;
@@ -511,12 +511,12 @@
511 ** COMMAND: stash
512 **
513 ** Usage: %fossil stash SUBCOMMAND ARGS...
514 **
515 ** fossil stash
516 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
517 ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
518 **
519 ** Save the current changes in the working tree as a new stash.
520 ** Then revert the changes back to the last check-in. If FILES
521 ** are listed, then only stash and revert the named files. The
522 ** "save" verb can be omitted if and only if there are no other
@@ -562,20 +562,25 @@
562 ** directory would be if STASHID were applied. With gdiff,
563 ** gdiff-command is used instead of internal diff logic.
564 **
565 ** SUMMARY:
566 ** fossil stash
567 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
568 ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
569 ** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>?
570 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
571 ** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
572 ** fossil stash pop
573 ** fossil stash apply|goto ?STASHID?
574 ** fossil stash drop|rm ?STASHID? ?-a|--all?
575 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
576 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
 
 
 
 
 
577 */
578 void stash_cmd(void){
579 const char *zCmd;
580 int nCmd;
581 int stashid = 0;
582
--- src/stash.c
+++ src/stash.c
@@ -259,11 +259,11 @@
259 const char *zComment; /* Comment to add to the stash */
260 int stashid; /* ID of the new stash */
261 int vid; /* Current checkout */
262
263 zComment = find_option("comment", "m", 1);
264 verify_all_options2();
265 if( zComment==0 ){
266 Blob prompt; /* Prompt for stash comment */
267 Blob comment; /* User comment reply */
268 #if defined(_WIN32) || defined(__CYGWIN__)
269 int bomSize;
@@ -511,12 +511,12 @@
511 ** COMMAND: stash
512 **
513 ** Usage: %fossil stash SUBCOMMAND ARGS...
514 **
515 ** fossil stash
516 ** fossil stash save ?-m|--comment COMMENT? ?--? ?FILES...?
517 ** fossil stash snapshot ?-m|--comment COMMENT? ?--? ?FILES...?
518 **
519 ** Save the current changes in the working tree as a new stash.
520 ** Then revert the changes back to the last check-in. If FILES
521 ** are listed, then only stash and revert the named files. The
522 ** "save" verb can be omitted if and only if there are no other
@@ -562,20 +562,25 @@
562 ** directory would be if STASHID were applied. With gdiff,
563 ** gdiff-command is used instead of internal diff logic.
564 **
565 ** SUMMARY:
566 ** fossil stash
567 ** fossil stash save ?-m|--comment COMMENT? ?--? ?FILES...?
568 ** fossil stash snapshot ?-m|--comment COMMENT? ?--? ?FILES...?
569 ** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>?
570 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
571 ** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
572 ** fossil stash pop
573 ** fossil stash apply|goto ?STASHID?
574 ** fossil stash drop|rm ?STASHID? ?-a|--all?
575 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
576 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
577 **
578 ** Options:
579 ** -- For commands which support it, treat all following
580 ** arguments as non-flags, even if they look like flags.
581 **
582 */
583 void stash_cmd(void){
584 const char *zCmd;
585 int nCmd;
586 int stashid = 0;
587
+5 -2
--- src/tar.c
+++ src/tar.c
@@ -582,11 +582,11 @@
582582
}
583583
584584
/*
585585
** COMMAND: tarball*
586586
**
587
-** Usage: %fossil tarball VERSION OUTPUTFILE [OPTIONS]
587
+** Usage: %fossil tarball ?OPTIONS? VERSION ?--? OUTPUTFILE
588588
**
589589
** Generate a compressed tarball for a specified version. If the --name
590590
** option is used, its argument becomes the name of the top-level directory
591591
** in the resulting tarball. If --name is omitted, the top-level directory
592592
** name is derived from the project name, the check-in date and time, and
@@ -600,10 +600,13 @@
600600
** Options:
601601
** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
602602
** --include GLOBLIST Comma-separated list of GLOBs of files to include
603603
** --name DIRECTORYNAME The name of the top-level directory in the archive
604604
** -R REPOSITORY Specify a Fossil repository
605
+** -- Treat all following arguments as non-flags, even if
606
+** they look like flags. Use before the VERSION or
607
+** OUTPUTFILE, but not both.
605608
*/
606609
void tarball_cmd(void){
607610
int rid;
608611
Blob tarball;
609612
const char *zName;
@@ -617,11 +620,11 @@
617620
zInclude = find_option("include", 0, 1);
618621
if( zInclude ) pInclude = glob_create(zInclude);
619622
db_find_and_open_repository(0, 0);
620623
621624
/* We should be done with options.. */
622
- verify_all_options();
625
+ verify_all_options2();
623626
624627
if( g.argc!=4 ){
625628
usage("VERSION OUTPUTFILE");
626629
}
627630
g.zOpenRevision = g.argv[2];
628631
--- src/tar.c
+++ src/tar.c
@@ -582,11 +582,11 @@
582 }
583
584 /*
585 ** COMMAND: tarball*
586 **
587 ** Usage: %fossil tarball VERSION OUTPUTFILE [OPTIONS]
588 **
589 ** Generate a compressed tarball for a specified version. If the --name
590 ** option is used, its argument becomes the name of the top-level directory
591 ** in the resulting tarball. If --name is omitted, the top-level directory
592 ** name is derived from the project name, the check-in date and time, and
@@ -600,10 +600,13 @@
600 ** Options:
601 ** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
602 ** --include GLOBLIST Comma-separated list of GLOBs of files to include
603 ** --name DIRECTORYNAME The name of the top-level directory in the archive
604 ** -R REPOSITORY Specify a Fossil repository
 
 
 
605 */
606 void tarball_cmd(void){
607 int rid;
608 Blob tarball;
609 const char *zName;
@@ -617,11 +620,11 @@
617 zInclude = find_option("include", 0, 1);
618 if( zInclude ) pInclude = glob_create(zInclude);
619 db_find_and_open_repository(0, 0);
620
621 /* We should be done with options.. */
622 verify_all_options();
623
624 if( g.argc!=4 ){
625 usage("VERSION OUTPUTFILE");
626 }
627 g.zOpenRevision = g.argv[2];
628
--- src/tar.c
+++ src/tar.c
@@ -582,11 +582,11 @@
582 }
583
584 /*
585 ** COMMAND: tarball*
586 **
587 ** Usage: %fossil tarball ?OPTIONS? VERSION ?--? OUTPUTFILE
588 **
589 ** Generate a compressed tarball for a specified version. If the --name
590 ** option is used, its argument becomes the name of the top-level directory
591 ** in the resulting tarball. If --name is omitted, the top-level directory
592 ** name is derived from the project name, the check-in date and time, and
@@ -600,10 +600,13 @@
600 ** Options:
601 ** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
602 ** --include GLOBLIST Comma-separated list of GLOBs of files to include
603 ** --name DIRECTORYNAME The name of the top-level directory in the archive
604 ** -R REPOSITORY Specify a Fossil repository
605 ** -- Treat all following arguments as non-flags, even if
606 ** they look like flags. Use before the VERSION or
607 ** OUTPUTFILE, but not both.
608 */
609 void tarball_cmd(void){
610 int rid;
611 Blob tarball;
612 const char *zName;
@@ -617,11 +620,11 @@
620 zInclude = find_option("include", 0, 1);
621 if( zInclude ) pInclude = glob_create(zInclude);
622 db_find_and_open_repository(0, 0);
623
624 /* We should be done with options.. */
625 verify_all_options2();
626
627 if( g.argc!=4 ){
628 usage("VERSION OUTPUTFILE");
629 }
630 g.zOpenRevision = g.argv[2];
631
+5 -3
--- src/undo.c
+++ src/undo.c
@@ -420,12 +420,12 @@
420420
421421
/*
422422
** COMMAND: undo
423423
** COMMAND: redo*
424424
**
425
-** Usage: %fossil undo ?OPTIONS? ?FILENAME...?
426
-** or: %fossil redo ?OPTIONS? ?FILENAME...?
425
+** Usage: %fossil undo ?OPTIONS? ?--? ?FILENAME...?
426
+** or: %fossil redo ?OPTIONS? ?--? ?FILENAME...?
427427
**
428428
** Undo the changes to the working checkout caused by the most recent
429429
** of the following operations:
430430
**
431431
** (1) fossil update (5) fossil stash apply
@@ -447,10 +447,12 @@
447447
** A single level of undo/redo is supported. The undo/redo stack
448448
** is cleared by the commit and checkout commands.
449449
**
450450
** Options:
451451
** -n|--dry-run do not make changes but show what would be done
452
+** -- Treat all following arguments as non-flags, even if
453
+** they look like flags.
452454
**
453455
** See also: commit, status
454456
*/
455457
void undo_cmd(void){
456458
int isRedo = g.argv[1][0]=='r';
@@ -460,11 +462,11 @@
460462
461463
if( !dryRunFlag ){
462464
dryRunFlag = find_option("explain", 0, 0)!=0;
463465
}
464466
db_must_be_within_tree();
465
- verify_all_options();
467
+ verify_all_options2();
466468
db_begin_transaction();
467469
undo_available = db_lget_int("undo_available", 0);
468470
if( dryRunFlag ){
469471
if( undo_available==0 ){
470472
fossil_print("No undo or redo is available\n");
471473
--- src/undo.c
+++ src/undo.c
@@ -420,12 +420,12 @@
420
421 /*
422 ** COMMAND: undo
423 ** COMMAND: redo*
424 **
425 ** Usage: %fossil undo ?OPTIONS? ?FILENAME...?
426 ** or: %fossil redo ?OPTIONS? ?FILENAME...?
427 **
428 ** Undo the changes to the working checkout caused by the most recent
429 ** of the following operations:
430 **
431 ** (1) fossil update (5) fossil stash apply
@@ -447,10 +447,12 @@
447 ** A single level of undo/redo is supported. The undo/redo stack
448 ** is cleared by the commit and checkout commands.
449 **
450 ** Options:
451 ** -n|--dry-run do not make changes but show what would be done
 
 
452 **
453 ** See also: commit, status
454 */
455 void undo_cmd(void){
456 int isRedo = g.argv[1][0]=='r';
@@ -460,11 +462,11 @@
460
461 if( !dryRunFlag ){
462 dryRunFlag = find_option("explain", 0, 0)!=0;
463 }
464 db_must_be_within_tree();
465 verify_all_options();
466 db_begin_transaction();
467 undo_available = db_lget_int("undo_available", 0);
468 if( dryRunFlag ){
469 if( undo_available==0 ){
470 fossil_print("No undo or redo is available\n");
471
--- src/undo.c
+++ src/undo.c
@@ -420,12 +420,12 @@
420
421 /*
422 ** COMMAND: undo
423 ** COMMAND: redo*
424 **
425 ** Usage: %fossil undo ?OPTIONS? ?--? ?FILENAME...?
426 ** or: %fossil redo ?OPTIONS? ?--? ?FILENAME...?
427 **
428 ** Undo the changes to the working checkout caused by the most recent
429 ** of the following operations:
430 **
431 ** (1) fossil update (5) fossil stash apply
@@ -447,10 +447,12 @@
447 ** A single level of undo/redo is supported. The undo/redo stack
448 ** is cleared by the commit and checkout commands.
449 **
450 ** Options:
451 ** -n|--dry-run do not make changes but show what would be done
452 ** -- Treat all following arguments as non-flags, even if
453 ** they look like flags.
454 **
455 ** See also: commit, status
456 */
457 void undo_cmd(void){
458 int isRedo = g.argv[1][0]=='r';
@@ -460,11 +462,11 @@
462
463 if( !dryRunFlag ){
464 dryRunFlag = find_option("explain", 0, 0)!=0;
465 }
466 db_must_be_within_tree();
467 verify_all_options2();
468 db_begin_transaction();
469 undo_available = db_lget_int("undo_available", 0);
470 if( dryRunFlag ){
471 if( undo_available==0 ){
472 fossil_print("No undo or redo is available\n");
473
+9 -4
--- src/update.c
+++ src/update.c
@@ -60,11 +60,11 @@
6060
}
6161
6262
/*
6363
** COMMAND: update
6464
**
65
-** Usage: %fossil update ?OPTIONS? ?VERSION? ?FILES...?
65
+** Usage: %fossil update ?OPTIONS? ?--? ?VERSION? ?FILES...?
6666
**
6767
** Change the version of the current checkout to VERSION. Any
6868
** uncommitted changes are retained and applied to the new checkout.
6969
**
7070
** The VERSION argument can be a specific version or tag or branch
@@ -102,10 +102,13 @@
102102
** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
103103
** or 0 (= no limit, resulting in a single line per entry).
104104
** --setmtime Set timestamps of all files to match their SCM-side
105105
** times (the timestamp of the last checkin which modified
106106
** them).
107
+** -- Treat all following arguments as non-flags, even if
108
+** they look like flags. Use before the VERSION or
109
+** FILES..., but not both.
107110
**
108111
** See also: revert
109112
*/
110113
void update_cmd(void){
111114
int vid; /* Current version */
@@ -149,11 +152,11 @@
149152
forceMissingFlag = find_option("force-missing",0,0)!=0;
150153
debugFlag = find_option("debug",0,0)!=0;
151154
setmtimeFlag = find_option("setmtime",0,0)!=0;
152155
153156
/* We should be done with options.. */
154
- verify_all_options();
157
+ verify_all_options2();
155158
156159
db_must_be_within_tree();
157160
vid = db_lget_int("checkout", 0);
158161
user_select();
159162
if( !dryRunFlag && !internalUpdate ){
@@ -757,11 +760,11 @@
757760
}
758761
759762
/*
760763
** COMMAND: revert
761764
**
762
-** Usage: %fossil revert ?-r REVISION? ?FILE ...?
765
+** Usage: %fossil revert ?-r REVISION? ?--? ?FILE ...?
763766
**
764767
** Revert to the current repository version of FILE, or to
765768
** the version associated with baseline REVISION if the -r flag
766769
** appears.
767770
**
@@ -773,10 +776,12 @@
773776
** If a file is reverted accidentally, it can be restored using
774777
** the "fossil undo" command.
775778
**
776779
** Options:
777780
** -r REVISION revert given FILE(s) back to given REVISION
781
+** -- Treat all following arguments as files, even
782
+** if they look like flags.
778783
**
779784
** See also: redo, undo, update
780785
*/
781786
void revert_cmd(void){
782787
Manifest *pCoManifest; /* Manifest of current checkout */
@@ -789,11 +794,11 @@
789794
int i;
790795
Stmt q;
791796
792797
undo_capture_command_line();
793798
zRevision = find_option("revision", "r", 1);
794
- verify_all_options();
799
+ verify_all_options2();
795800
796801
if( g.argc<2 ){
797802
usage("?OPTIONS? [FILE] ...");
798803
}
799804
if( zRevision && g.argc<3 ){
800805
--- src/update.c
+++ src/update.c
@@ -60,11 +60,11 @@
60 }
61
62 /*
63 ** COMMAND: update
64 **
65 ** Usage: %fossil update ?OPTIONS? ?VERSION? ?FILES...?
66 **
67 ** Change the version of the current checkout to VERSION. Any
68 ** uncommitted changes are retained and applied to the new checkout.
69 **
70 ** The VERSION argument can be a specific version or tag or branch
@@ -102,10 +102,13 @@
102 ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
103 ** or 0 (= no limit, resulting in a single line per entry).
104 ** --setmtime Set timestamps of all files to match their SCM-side
105 ** times (the timestamp of the last checkin which modified
106 ** them).
 
 
 
107 **
108 ** See also: revert
109 */
110 void update_cmd(void){
111 int vid; /* Current version */
@@ -149,11 +152,11 @@
149 forceMissingFlag = find_option("force-missing",0,0)!=0;
150 debugFlag = find_option("debug",0,0)!=0;
151 setmtimeFlag = find_option("setmtime",0,0)!=0;
152
153 /* We should be done with options.. */
154 verify_all_options();
155
156 db_must_be_within_tree();
157 vid = db_lget_int("checkout", 0);
158 user_select();
159 if( !dryRunFlag && !internalUpdate ){
@@ -757,11 +760,11 @@
757 }
758
759 /*
760 ** COMMAND: revert
761 **
762 ** Usage: %fossil revert ?-r REVISION? ?FILE ...?
763 **
764 ** Revert to the current repository version of FILE, or to
765 ** the version associated with baseline REVISION if the -r flag
766 ** appears.
767 **
@@ -773,10 +776,12 @@
773 ** If a file is reverted accidentally, it can be restored using
774 ** the "fossil undo" command.
775 **
776 ** Options:
777 ** -r REVISION revert given FILE(s) back to given REVISION
 
 
778 **
779 ** See also: redo, undo, update
780 */
781 void revert_cmd(void){
782 Manifest *pCoManifest; /* Manifest of current checkout */
@@ -789,11 +794,11 @@
789 int i;
790 Stmt q;
791
792 undo_capture_command_line();
793 zRevision = find_option("revision", "r", 1);
794 verify_all_options();
795
796 if( g.argc<2 ){
797 usage("?OPTIONS? [FILE] ...");
798 }
799 if( zRevision && g.argc<3 ){
800
--- src/update.c
+++ src/update.c
@@ -60,11 +60,11 @@
60 }
61
62 /*
63 ** COMMAND: update
64 **
65 ** Usage: %fossil update ?OPTIONS? ?--? ?VERSION? ?FILES...?
66 **
67 ** Change the version of the current checkout to VERSION. Any
68 ** uncommitted changes are retained and applied to the new checkout.
69 **
70 ** The VERSION argument can be a specific version or tag or branch
@@ -102,10 +102,13 @@
102 ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
103 ** or 0 (= no limit, resulting in a single line per entry).
104 ** --setmtime Set timestamps of all files to match their SCM-side
105 ** times (the timestamp of the last checkin which modified
106 ** them).
107 ** -- Treat all following arguments as non-flags, even if
108 ** they look like flags. Use before the VERSION or
109 ** FILES..., but not both.
110 **
111 ** See also: revert
112 */
113 void update_cmd(void){
114 int vid; /* Current version */
@@ -149,11 +152,11 @@
152 forceMissingFlag = find_option("force-missing",0,0)!=0;
153 debugFlag = find_option("debug",0,0)!=0;
154 setmtimeFlag = find_option("setmtime",0,0)!=0;
155
156 /* We should be done with options.. */
157 verify_all_options2();
158
159 db_must_be_within_tree();
160 vid = db_lget_int("checkout", 0);
161 user_select();
162 if( !dryRunFlag && !internalUpdate ){
@@ -757,11 +760,11 @@
760 }
761
762 /*
763 ** COMMAND: revert
764 **
765 ** Usage: %fossil revert ?-r REVISION? ?--? ?FILE ...?
766 **
767 ** Revert to the current repository version of FILE, or to
768 ** the version associated with baseline REVISION if the -r flag
769 ** appears.
770 **
@@ -773,10 +776,12 @@
776 ** If a file is reverted accidentally, it can be restored using
777 ** the "fossil undo" command.
778 **
779 ** Options:
780 ** -r REVISION revert given FILE(s) back to given REVISION
781 ** -- Treat all following arguments as files, even
782 ** if they look like flags.
783 **
784 ** See also: redo, undo, update
785 */
786 void revert_cmd(void){
787 Manifest *pCoManifest; /* Manifest of current checkout */
@@ -789,11 +794,11 @@
794 int i;
795 Stmt q;
796
797 undo_capture_command_line();
798 zRevision = find_option("revision", "r", 1);
799 verify_all_options2();
800
801 if( g.argc<2 ){
802 usage("?OPTIONS? [FILE] ...");
803 }
804 if( zRevision && g.argc<3 ){
805
+9 -3
--- src/zip.c
+++ src/zip.c
@@ -747,11 +747,11 @@
747747
zInclude = find_option("include", 0, 1);
748748
if( zInclude ) pInclude = glob_create(zInclude);
749749
db_find_and_open_repository(0, 0);
750750
751751
/* We should be done with options.. */
752
- verify_all_options();
752
+ verify_all_options2();
753753
754754
if( g.argc!=4 ){
755755
usage("VERSION OUTPUTFILE");
756756
}
757757
g.zOpenRevision = g.argv[2];
@@ -780,11 +780,11 @@
780780
}
781781
782782
/*
783783
** COMMAND: zip*
784784
**
785
-** Usage: %fossil zip VERSION OUTPUTFILE [OPTIONS]
785
+** Usage: %fossil zip ?OPTIONS? VERSION ?--? OUTPUTFILE
786786
**
787787
** Generate a ZIP archive for a check-in. If the --name option is
788788
** used, its argument becomes the name of the top-level directory in the
789789
** resulting ZIP archive. If --name is omitted, the top-level directory
790790
** name is derived from the project name, the check-in date and time, and
@@ -798,19 +798,22 @@
798798
** Options:
799799
** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
800800
** --include GLOBLIST Comma-separated list of GLOBs of files to include
801801
** --name DIRECTORYNAME The name of the top-level directory in the archive
802802
** -R REPOSITORY Specify a Fossil repository
803
+** -- Treat all following arguments as non-flags, even if
804
+** they look like flags. Use before the VERSION or
805
+** OUTPUTFILE, but not both.
803806
*/
804807
void zip_cmd(void){
805808
archive_cmd(ARCHIVE_ZIP);
806809
}
807810
808811
/*
809812
** COMMAND: sqlar*
810813
**
811
-** Usage: %fossil sqlar VERSION OUTPUTFILE [OPTIONS]
814
+** Usage: %fossil sqlar ?OPTIONS? VERSION ?--? OUTPUTFILE
812815
**
813816
** Generate an SQLAR archive for a check-in. If the --name option is
814817
** used, its argument becomes the name of the top-level directory in the
815818
** resulting SQLAR archive. If --name is omitted, the top-level directory
816819
** name is derived from the project name, the check-in date and time, and
@@ -824,10 +827,13 @@
824827
** Options:
825828
** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
826829
** --include GLOBLIST Comma-separated list of GLOBs of files to include
827830
** --name DIRECTORYNAME The name of the top-level directory in the archive
828831
** -R REPOSITORY Specify a Fossil repository
832
+** -- Treat all following arguments as non-flags, even if
833
+** they look like flags. Use before the VERSION or
834
+** OUTPUTFILE, but not both.
829835
*/
830836
void sqlar_cmd(void){
831837
archive_cmd(ARCHIVE_SQLAR);
832838
}
833839
834840
--- src/zip.c
+++ src/zip.c
@@ -747,11 +747,11 @@
747 zInclude = find_option("include", 0, 1);
748 if( zInclude ) pInclude = glob_create(zInclude);
749 db_find_and_open_repository(0, 0);
750
751 /* We should be done with options.. */
752 verify_all_options();
753
754 if( g.argc!=4 ){
755 usage("VERSION OUTPUTFILE");
756 }
757 g.zOpenRevision = g.argv[2];
@@ -780,11 +780,11 @@
780 }
781
782 /*
783 ** COMMAND: zip*
784 **
785 ** Usage: %fossil zip VERSION OUTPUTFILE [OPTIONS]
786 **
787 ** Generate a ZIP archive for a check-in. If the --name option is
788 ** used, its argument becomes the name of the top-level directory in the
789 ** resulting ZIP archive. If --name is omitted, the top-level directory
790 ** name is derived from the project name, the check-in date and time, and
@@ -798,19 +798,22 @@
798 ** Options:
799 ** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
800 ** --include GLOBLIST Comma-separated list of GLOBs of files to include
801 ** --name DIRECTORYNAME The name of the top-level directory in the archive
802 ** -R REPOSITORY Specify a Fossil repository
 
 
 
803 */
804 void zip_cmd(void){
805 archive_cmd(ARCHIVE_ZIP);
806 }
807
808 /*
809 ** COMMAND: sqlar*
810 **
811 ** Usage: %fossil sqlar VERSION OUTPUTFILE [OPTIONS]
812 **
813 ** Generate an SQLAR archive for a check-in. If the --name option is
814 ** used, its argument becomes the name of the top-level directory in the
815 ** resulting SQLAR archive. If --name is omitted, the top-level directory
816 ** name is derived from the project name, the check-in date and time, and
@@ -824,10 +827,13 @@
824 ** Options:
825 ** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
826 ** --include GLOBLIST Comma-separated list of GLOBs of files to include
827 ** --name DIRECTORYNAME The name of the top-level directory in the archive
828 ** -R REPOSITORY Specify a Fossil repository
 
 
 
829 */
830 void sqlar_cmd(void){
831 archive_cmd(ARCHIVE_SQLAR);
832 }
833
834
--- src/zip.c
+++ src/zip.c
@@ -747,11 +747,11 @@
747 zInclude = find_option("include", 0, 1);
748 if( zInclude ) pInclude = glob_create(zInclude);
749 db_find_and_open_repository(0, 0);
750
751 /* We should be done with options.. */
752 verify_all_options2();
753
754 if( g.argc!=4 ){
755 usage("VERSION OUTPUTFILE");
756 }
757 g.zOpenRevision = g.argv[2];
@@ -780,11 +780,11 @@
780 }
781
782 /*
783 ** COMMAND: zip*
784 **
785 ** Usage: %fossil zip ?OPTIONS? VERSION ?--? OUTPUTFILE
786 **
787 ** Generate a ZIP archive for a check-in. If the --name option is
788 ** used, its argument becomes the name of the top-level directory in the
789 ** resulting ZIP archive. If --name is omitted, the top-level directory
790 ** name is derived from the project name, the check-in date and time, and
@@ -798,19 +798,22 @@
798 ** Options:
799 ** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
800 ** --include GLOBLIST Comma-separated list of GLOBs of files to include
801 ** --name DIRECTORYNAME The name of the top-level directory in the archive
802 ** -R REPOSITORY Specify a Fossil repository
803 ** -- Treat all following arguments as non-flags, even if
804 ** they look like flags. Use before the VERSION or
805 ** OUTPUTFILE, but not both.
806 */
807 void zip_cmd(void){
808 archive_cmd(ARCHIVE_ZIP);
809 }
810
811 /*
812 ** COMMAND: sqlar*
813 **
814 ** Usage: %fossil sqlar ?OPTIONS? VERSION ?--? OUTPUTFILE
815 **
816 ** Generate an SQLAR archive for a check-in. If the --name option is
817 ** used, its argument becomes the name of the top-level directory in the
818 ** resulting SQLAR archive. If --name is omitted, the top-level directory
819 ** name is derived from the project name, the check-in date and time, and
@@ -824,10 +827,13 @@
827 ** Options:
828 ** -X|--exclude GLOBLIST Comma-separated list of GLOBs of files to exclude
829 ** --include GLOBLIST Comma-separated list of GLOBs of files to include
830 ** --name DIRECTORYNAME The name of the top-level directory in the archive
831 ** -R REPOSITORY Specify a Fossil repository
832 ** -- Treat all following arguments as non-flags, even if
833 ** they look like flags. Use before the VERSION or
834 ** OUTPUTFILE, but not both.
835 */
836 void sqlar_cmd(void){
837 archive_cmd(ARCHIVE_SQLAR);
838 }
839
840

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button