Fossil SCM

Fix inconsistent naming between the 'fossil extras' and 'fossil all extra' commands. Add the --showfile option to the 'fossil all' command.

mistachkin 2014-03-28 02:28 trunk
Commit 7afbb70310c7b0b7442771a83426c830e6ef6f83
3 files changed +2 -2 +12 -7 +6 -6
+2 -2
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
2525
#include "cygsup.h"
2626
2727
/*
2828
** This routine returns the names of files in a working checkout that
2929
** are created by Fossil itself, and hence should not be added, deleted,
30
-** or merge, and should be omitted from "clean" and "extra" lists.
30
+** or merge, and should be omitted from "clean" and "extras" lists.
3131
**
3232
** Return the N-th name. The first name has N==0. When all names have
3333
** been used, return 0.
3434
*/
3535
const char *fossil_reserved_name(int N, int omitRepo){
@@ -461,11 +461,11 @@
461461
**
462462
** Do all necessary "add" and "rm" commands to synchronize the repository
463463
** with the content of the working checkout:
464464
**
465465
** * All files in the checkout but not in the repository (that is,
466
-** all files displayed using the "extra" command) are added as
466
+** all files displayed using the "extras" command) are added as
467467
** if by the "add" command.
468468
**
469469
** * All files in the repository but missing from the checkout (that is,
470470
** all files that show as MISSING with the "status" command) are
471471
** removed as if by the "rm" command.
472472
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
25 #include "cygsup.h"
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extra" lists.
31 **
32 ** Return the N-th name. The first name has N==0. When all names have
33 ** been used, return 0.
34 */
35 const char *fossil_reserved_name(int N, int omitRepo){
@@ -461,11 +461,11 @@
461 **
462 ** Do all necessary "add" and "rm" commands to synchronize the repository
463 ** with the content of the working checkout:
464 **
465 ** * All files in the checkout but not in the repository (that is,
466 ** all files displayed using the "extra" command) are added as
467 ** if by the "add" command.
468 **
469 ** * All files in the repository but missing from the checkout (that is,
470 ** all files that show as MISSING with the "status" command) are
471 ** removed as if by the "rm" command.
472
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
25 #include "cygsup.h"
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extras" lists.
31 **
32 ** Return the N-th name. The first name has N==0. When all names have
33 ** been used, return 0.
34 */
35 const char *fossil_reserved_name(int N, int omitRepo){
@@ -461,11 +461,11 @@
461 **
462 ** Do all necessary "add" and "rm" commands to synchronize the repository
463 ** with the content of the working checkout:
464 **
465 ** * All files in the checkout but not in the repository (that is,
466 ** all files displayed using the "extras" command) are added as
467 ** if by the "add" command.
468 **
469 ** * All files in the repository but missing from the checkout (that is,
470 ** all files that show as MISSING with the "status" command) are
471 ** removed as if by the "rm" command.
472
+12 -7
--- src/allrepo.c
+++ src/allrepo.c
@@ -76,11 +76,11 @@
7676
7777
7878
/*
7979
** COMMAND: all
8080
**
81
-** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
81
+** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync)
8282
**
8383
** The ~/.fossil file records the location of all repositories for a
8484
** user. This command performs certain operations on all repositories
8585
** that can be useful before or after a period of disconnected operation.
8686
**
@@ -99,16 +99,16 @@
9999
** and the --whatif option to carefully review the files to
100100
** be deleted beforehand is highly recommended. The command
101101
** line options supported by the clean command itself, if any
102102
** are present, are passed along verbatim.
103103
**
104
-** extra Shows extra files from all local checkouts. The command
104
+** extras Shows "extra" files from all local checkouts. The command
105105
** line options supported by the extra command itself, if any
106106
** are present, are passed along verbatim.
107107
**
108108
** ignore Arguments are repositories that should be ignored by
109
-** subsequent clean, extra, list, pull, push, rebuild, and
109
+** subsequent clean, extras, list, pull, push, rebuild, and
110110
** sync operations. The -c|--ckout option causes the listed
111111
** local checkouts to be ignored instead.
112112
**
113113
** list | ls Display the location of all repositories. The -c|--ckout
114114
** option causes all local checkouts to be listed instead.
@@ -136,10 +136,11 @@
136136
** when one of the following commands are run against the repository:
137137
** clone, info, pull, push, or sync. Even previously ignored repositories
138138
** are added back to the list of repositories by these commands.
139139
**
140140
** Options:
141
+** --showfile Show the repository or checkout being operated upon.
141142
** --dontstop Continue with other repositories even after an error.
142143
** --dry-run If given, display instead of run actions.
143144
*/
144145
void all_cmd(void){
145146
int n;
@@ -150,10 +151,11 @@
150151
char *zQFilename;
151152
Blob extra;
152153
int useCheckouts = 0;
153154
int quiet = 0;
154155
int dryRunFlag = 0;
156
+ int showFile = find_option("showfile",0,0)!=0;
155157
int stopOnError = find_option("dontstop",0,0)==0;
156158
int rc;
157159
int nToDel = 0;
158160
159161
dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -160,11 +162,11 @@
160162
if( !dryRunFlag ){
161163
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
162164
}
163165
164166
if( g.argc<3 ){
165
- usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
167
+ usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync");
166168
}
167169
n = strlen(g.argv[2]);
168170
db_open_config(1);
169171
blob_zero(&extra);
170172
zCmd = g.argv[2];
@@ -185,12 +187,12 @@
185187
collect_argument_value(&extra, "keep");
186188
collect_argument(&extra, "temp",0);
187189
collect_argument(&extra, "verbose","v");
188190
collect_argument(&extra, "whatif",0);
189191
useCheckouts = 1;
190
- }else if( strncmp(zCmd, "extra", n)==0 ){
191
- zCmd = "extra --chdir";
192
+ }else if( strncmp(zCmd, "extras", n)==0 ){
193
+ zCmd = "extras --chdir";
192194
collect_argument(&extra, "abs-paths",0);
193195
collect_argument_value(&extra, "case-sensitive");
194196
collect_argument(&extra, "dotfiles",0);
195197
collect_argument_value(&extra, "ignore");
196198
collect_argument(&extra, "rel-paths",0);
@@ -254,11 +256,11 @@
254256
}
255257
db_end_transaction(0);
256258
return;
257259
}else{
258260
fossil_fatal("\"all\" subcommand should be one of: "
259
- "changes clean extra ignore list ls push pull rebuild sync");
261
+ "changes clean extras ignore list ls push pull rebuild sync");
260262
}
261263
verify_all_options();
262264
zFossil = quoteFilename(g.nameOfExe);
263265
if( useCheckouts ){
264266
db_prepare(&q,
@@ -287,10 +289,13 @@
287289
continue;
288290
}
289291
if( zCmd[0]=='l' ){
290292
fossil_print("%s\n", zFilename);
291293
continue;
294
+ }else if( showFile ){
295
+ fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository",
296
+ zFilename);
292297
}
293298
zQFilename = quoteFilename(zFilename);
294299
zSyscmd = mprintf("%s %s %s%s",
295300
zFossil, zCmd, zQFilename, blob_str(&extra));
296301
if( !quiet || dryRunFlag ){
297302
--- src/allrepo.c
+++ src/allrepo.c
@@ -76,11 +76,11 @@
76
77
78 /*
79 ** COMMAND: all
80 **
81 ** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
82 **
83 ** The ~/.fossil file records the location of all repositories for a
84 ** user. This command performs certain operations on all repositories
85 ** that can be useful before or after a period of disconnected operation.
86 **
@@ -99,16 +99,16 @@
99 ** and the --whatif option to carefully review the files to
100 ** be deleted beforehand is highly recommended. The command
101 ** line options supported by the clean command itself, if any
102 ** are present, are passed along verbatim.
103 **
104 ** extra Shows extra files from all local checkouts. The command
105 ** line options supported by the extra command itself, if any
106 ** are present, are passed along verbatim.
107 **
108 ** ignore Arguments are repositories that should be ignored by
109 ** subsequent clean, extra, list, pull, push, rebuild, and
110 ** sync operations. The -c|--ckout option causes the listed
111 ** local checkouts to be ignored instead.
112 **
113 ** list | ls Display the location of all repositories. The -c|--ckout
114 ** option causes all local checkouts to be listed instead.
@@ -136,10 +136,11 @@
136 ** when one of the following commands are run against the repository:
137 ** clone, info, pull, push, or sync. Even previously ignored repositories
138 ** are added back to the list of repositories by these commands.
139 **
140 ** Options:
 
141 ** --dontstop Continue with other repositories even after an error.
142 ** --dry-run If given, display instead of run actions.
143 */
144 void all_cmd(void){
145 int n;
@@ -150,10 +151,11 @@
150 char *zQFilename;
151 Blob extra;
152 int useCheckouts = 0;
153 int quiet = 0;
154 int dryRunFlag = 0;
 
155 int stopOnError = find_option("dontstop",0,0)==0;
156 int rc;
157 int nToDel = 0;
158
159 dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -160,11 +162,11 @@
160 if( !dryRunFlag ){
161 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
162 }
163
164 if( g.argc<3 ){
165 usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
166 }
167 n = strlen(g.argv[2]);
168 db_open_config(1);
169 blob_zero(&extra);
170 zCmd = g.argv[2];
@@ -185,12 +187,12 @@
185 collect_argument_value(&extra, "keep");
186 collect_argument(&extra, "temp",0);
187 collect_argument(&extra, "verbose","v");
188 collect_argument(&extra, "whatif",0);
189 useCheckouts = 1;
190 }else if( strncmp(zCmd, "extra", n)==0 ){
191 zCmd = "extra --chdir";
192 collect_argument(&extra, "abs-paths",0);
193 collect_argument_value(&extra, "case-sensitive");
194 collect_argument(&extra, "dotfiles",0);
195 collect_argument_value(&extra, "ignore");
196 collect_argument(&extra, "rel-paths",0);
@@ -254,11 +256,11 @@
254 }
255 db_end_transaction(0);
256 return;
257 }else{
258 fossil_fatal("\"all\" subcommand should be one of: "
259 "changes clean extra ignore list ls push pull rebuild sync");
260 }
261 verify_all_options();
262 zFossil = quoteFilename(g.nameOfExe);
263 if( useCheckouts ){
264 db_prepare(&q,
@@ -287,10 +289,13 @@
287 continue;
288 }
289 if( zCmd[0]=='l' ){
290 fossil_print("%s\n", zFilename);
291 continue;
 
 
 
292 }
293 zQFilename = quoteFilename(zFilename);
294 zSyscmd = mprintf("%s %s %s%s",
295 zFossil, zCmd, zQFilename, blob_str(&extra));
296 if( !quiet || dryRunFlag ){
297
--- src/allrepo.c
+++ src/allrepo.c
@@ -76,11 +76,11 @@
76
77
78 /*
79 ** COMMAND: all
80 **
81 ** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync)
82 **
83 ** The ~/.fossil file records the location of all repositories for a
84 ** user. This command performs certain operations on all repositories
85 ** that can be useful before or after a period of disconnected operation.
86 **
@@ -99,16 +99,16 @@
99 ** and the --whatif option to carefully review the files to
100 ** be deleted beforehand is highly recommended. The command
101 ** line options supported by the clean command itself, if any
102 ** are present, are passed along verbatim.
103 **
104 ** extras Shows "extra" files from all local checkouts. The command
105 ** line options supported by the extra command itself, if any
106 ** are present, are passed along verbatim.
107 **
108 ** ignore Arguments are repositories that should be ignored by
109 ** subsequent clean, extras, list, pull, push, rebuild, and
110 ** sync operations. The -c|--ckout option causes the listed
111 ** local checkouts to be ignored instead.
112 **
113 ** list | ls Display the location of all repositories. The -c|--ckout
114 ** option causes all local checkouts to be listed instead.
@@ -136,10 +136,11 @@
136 ** when one of the following commands are run against the repository:
137 ** clone, info, pull, push, or sync. Even previously ignored repositories
138 ** are added back to the list of repositories by these commands.
139 **
140 ** Options:
141 ** --showfile Show the repository or checkout being operated upon.
142 ** --dontstop Continue with other repositories even after an error.
143 ** --dry-run If given, display instead of run actions.
144 */
145 void all_cmd(void){
146 int n;
@@ -150,10 +151,11 @@
151 char *zQFilename;
152 Blob extra;
153 int useCheckouts = 0;
154 int quiet = 0;
155 int dryRunFlag = 0;
156 int showFile = find_option("showfile",0,0)!=0;
157 int stopOnError = find_option("dontstop",0,0)==0;
158 int rc;
159 int nToDel = 0;
160
161 dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -160,11 +162,11 @@
162 if( !dryRunFlag ){
163 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
164 }
165
166 if( g.argc<3 ){
167 usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync");
168 }
169 n = strlen(g.argv[2]);
170 db_open_config(1);
171 blob_zero(&extra);
172 zCmd = g.argv[2];
@@ -185,12 +187,12 @@
187 collect_argument_value(&extra, "keep");
188 collect_argument(&extra, "temp",0);
189 collect_argument(&extra, "verbose","v");
190 collect_argument(&extra, "whatif",0);
191 useCheckouts = 1;
192 }else if( strncmp(zCmd, "extras", n)==0 ){
193 zCmd = "extras --chdir";
194 collect_argument(&extra, "abs-paths",0);
195 collect_argument_value(&extra, "case-sensitive");
196 collect_argument(&extra, "dotfiles",0);
197 collect_argument_value(&extra, "ignore");
198 collect_argument(&extra, "rel-paths",0);
@@ -254,11 +256,11 @@
256 }
257 db_end_transaction(0);
258 return;
259 }else{
260 fossil_fatal("\"all\" subcommand should be one of: "
261 "changes clean extras ignore list ls push pull rebuild sync");
262 }
263 verify_all_options();
264 zFossil = quoteFilename(g.nameOfExe);
265 if( useCheckouts ){
266 db_prepare(&q,
@@ -287,10 +289,13 @@
289 continue;
290 }
291 if( zCmd[0]=='l' ){
292 fossil_print("%s\n", zFilename);
293 continue;
294 }else if( showFile ){
295 fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository",
296 zFilename);
297 }
298 zQFilename = quoteFilename(zFilename);
299 zSyscmd = mprintf("%s %s %s%s",
300 zFossil, zCmd, zQFilename, blob_str(&extra));
301 if( !quiet || dryRunFlag ){
302
+6 -6
--- src/checkin.c
+++ src/checkin.c
@@ -179,11 +179,11 @@
179179
** --sha1sum Verify file status using SHA1 hashing rather
180180
** than relying on file mtimes.
181181
** --header Identify the repository if there are changes
182182
** -v|--verbose Say "(none)" if there are no changes
183183
**
184
-** See also: extra, ls, status
184
+** See also: extras, ls, status
185185
*/
186186
void changes_cmd(void){
187187
Blob report;
188188
int vid;
189189
int useSha1sum = find_option("sha1sum", 0, 0)!=0;
@@ -223,11 +223,11 @@
223223
** --rel-paths Display pathnames relative to the current working
224224
** directory.
225225
** --sha1sum Verify file status using SHA1 hashing rather
226226
** than relying on file mtimes.
227227
**
228
-** See also: changes, extra, ls
228
+** See also: changes, extras, ls
229229
*/
230230
void status_cmd(void){
231231
int vid;
232232
db_must_be_within_tree();
233233
/* 012345678901234 */
@@ -255,11 +255,11 @@
255255
**
256256
** Options:
257257
** --age Show when each file was committed
258258
** -v|--verbose Provide extra information about each file.
259259
**
260
-** See also: changes, extra, status
260
+** See also: changes, extras, status
261261
*/
262262
void ls_cmd(void){
263263
int vid;
264264
Stmt q;
265265
int verboseFlag;
@@ -439,11 +439,11 @@
439439
** --rel-paths Display pathnames relative to the current working
440440
** directory.
441441
**
442442
** See also: changes, clean, status
443443
*/
444
-void extra_cmd(void){
444
+void extras_cmd(void){
445445
Stmt q;
446446
const char *zIgnoreFlag = find_option("ignore",0,1);
447447
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
448448
int cwdRelative = 0;
449449
Glob *pIgnore;
@@ -536,11 +536,11 @@
536536
** list of glob patterns.
537537
** -n|--dry-run If given, display instead of run actions.
538538
** --temp Remove only Fossil-generated temporary files.
539539
** -v|--verbose Show all files as they are removed.
540540
**
541
-** See also: addremove, extra, status
541
+** See also: addremove, extras, status
542542
*/
543543
void clean_cmd(void){
544544
int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
545545
int emptyDirsFlag, dirsOnlyFlag;
546546
unsigned scanFlags = 0;
@@ -1408,11 +1408,11 @@
14081408
** --private do not sync changes and their descendants
14091409
** --sha1sum verify file status using SHA1 hashing rather
14101410
** than relying on file mtimes
14111411
** --tag TAG-NAME assign given tag TAG-NAME to the checkin
14121412
**
1413
-** See also: branch, changes, checkout, extra, sync
1413
+** See also: branch, changes, checkout, extras, sync
14141414
*/
14151415
void commit_cmd(void){
14161416
int hasChanges; /* True if unsaved changes exist */
14171417
int vid; /* blob-id of parent version */
14181418
int nrid; /* blob-id of a modified file */
14191419
--- src/checkin.c
+++ src/checkin.c
@@ -179,11 +179,11 @@
179 ** --sha1sum Verify file status using SHA1 hashing rather
180 ** than relying on file mtimes.
181 ** --header Identify the repository if there are changes
182 ** -v|--verbose Say "(none)" if there are no changes
183 **
184 ** See also: extra, ls, status
185 */
186 void changes_cmd(void){
187 Blob report;
188 int vid;
189 int useSha1sum = find_option("sha1sum", 0, 0)!=0;
@@ -223,11 +223,11 @@
223 ** --rel-paths Display pathnames relative to the current working
224 ** directory.
225 ** --sha1sum Verify file status using SHA1 hashing rather
226 ** than relying on file mtimes.
227 **
228 ** See also: changes, extra, ls
229 */
230 void status_cmd(void){
231 int vid;
232 db_must_be_within_tree();
233 /* 012345678901234 */
@@ -255,11 +255,11 @@
255 **
256 ** Options:
257 ** --age Show when each file was committed
258 ** -v|--verbose Provide extra information about each file.
259 **
260 ** See also: changes, extra, status
261 */
262 void ls_cmd(void){
263 int vid;
264 Stmt q;
265 int verboseFlag;
@@ -439,11 +439,11 @@
439 ** --rel-paths Display pathnames relative to the current working
440 ** directory.
441 **
442 ** See also: changes, clean, status
443 */
444 void extra_cmd(void){
445 Stmt q;
446 const char *zIgnoreFlag = find_option("ignore",0,1);
447 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
448 int cwdRelative = 0;
449 Glob *pIgnore;
@@ -536,11 +536,11 @@
536 ** list of glob patterns.
537 ** -n|--dry-run If given, display instead of run actions.
538 ** --temp Remove only Fossil-generated temporary files.
539 ** -v|--verbose Show all files as they are removed.
540 **
541 ** See also: addremove, extra, status
542 */
543 void clean_cmd(void){
544 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
545 int emptyDirsFlag, dirsOnlyFlag;
546 unsigned scanFlags = 0;
@@ -1408,11 +1408,11 @@
1408 ** --private do not sync changes and their descendants
1409 ** --sha1sum verify file status using SHA1 hashing rather
1410 ** than relying on file mtimes
1411 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1412 **
1413 ** See also: branch, changes, checkout, extra, sync
1414 */
1415 void commit_cmd(void){
1416 int hasChanges; /* True if unsaved changes exist */
1417 int vid; /* blob-id of parent version */
1418 int nrid; /* blob-id of a modified file */
1419
--- src/checkin.c
+++ src/checkin.c
@@ -179,11 +179,11 @@
179 ** --sha1sum Verify file status using SHA1 hashing rather
180 ** than relying on file mtimes.
181 ** --header Identify the repository if there are changes
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;
@@ -223,11 +223,11 @@
223 ** --rel-paths Display pathnames relative to the current working
224 ** directory.
225 ** --sha1sum Verify file status using SHA1 hashing rather
226 ** than relying on file mtimes.
227 **
228 ** See also: changes, extras, ls
229 */
230 void status_cmd(void){
231 int vid;
232 db_must_be_within_tree();
233 /* 012345678901234 */
@@ -255,11 +255,11 @@
255 **
256 ** Options:
257 ** --age Show when each file was committed
258 ** -v|--verbose Provide extra information about each file.
259 **
260 ** See also: changes, extras, status
261 */
262 void ls_cmd(void){
263 int vid;
264 Stmt q;
265 int verboseFlag;
@@ -439,11 +439,11 @@
439 ** --rel-paths Display pathnames relative to the current working
440 ** directory.
441 **
442 ** See also: changes, clean, status
443 */
444 void extras_cmd(void){
445 Stmt q;
446 const char *zIgnoreFlag = find_option("ignore",0,1);
447 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
448 int cwdRelative = 0;
449 Glob *pIgnore;
@@ -536,11 +536,11 @@
536 ** list of glob patterns.
537 ** -n|--dry-run If given, display instead of run actions.
538 ** --temp Remove only Fossil-generated temporary files.
539 ** -v|--verbose Show all files as they are removed.
540 **
541 ** See also: addremove, extras, status
542 */
543 void clean_cmd(void){
544 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
545 int emptyDirsFlag, dirsOnlyFlag;
546 unsigned scanFlags = 0;
@@ -1408,11 +1408,11 @@
1408 ** --private do not sync changes and their descendants
1409 ** --sha1sum verify file status using SHA1 hashing rather
1410 ** than relying on file mtimes
1411 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1412 **
1413 ** See also: branch, changes, checkout, extras, sync
1414 */
1415 void commit_cmd(void){
1416 int hasChanges; /* True if unsaved changes exist */
1417 int vid; /* blob-id of parent version */
1418 int nrid; /* blob-id of a modified file */
1419

Keyboard Shortcuts

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