Fossil SCM

Add the 'fossil all clean' command. Add -whatif option to the 'fossil clean' command, primarily for use with 'fossil all clean'.

mistachkin 2013-10-07 23:52 UTC allExtra
Commit 4e7753c8a1358a56be2ecd8a8cb72cbe9e54558f
2 files changed +23 -2 +3
+23 -2
--- src/allrepo.c
+++ src/allrepo.c
@@ -70,11 +70,11 @@
7070
7171
7272
/*
7373
** COMMAND: all
7474
**
75
-** Usage: %fossil all (changes|extra|ignore|list|ls|pull|push|rebuild|sync)
75
+** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
7676
**
7777
** The ~/.fossil file records the location of all repositories for a
7878
** user. This command performs certain operations on all repositories
7979
** that can be useful before or after a period of disconnected operation.
8080
**
@@ -82,10 +82,16 @@
8282
** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
8383
**
8484
** Available operations are:
8585
**
8686
** changes Shows all local checkouts that have uncommitted changes
87
+**
88
+** clean Delete all "extra" files in all local checkouts. Extreme
89
+** caution should be exercised with this command because its
90
+** effects cannot be undone. Use of the -whatif option to
91
+** carefully review the files to be deleted beforehand is
92
+** highly recommended.
8793
**
8894
** extra Shows extra files from all local checkouts
8995
**
9096
** ignore Arguments are repositories that should be ignored
9197
** by subsequent list, pull, push, rebuild, and sync.
@@ -128,20 +134,35 @@
128134
if( !dryRunFlag ){
129135
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
130136
}
131137
132138
if( g.argc<3 ){
133
- usage("changes|extra|ignore|list|ls|pull|push|rebuild|sync");
139
+ usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
134140
}
135141
n = strlen(g.argv[2]);
136142
db_open_config(1);
137143
blob_zero(&extra);
138144
zCmd = g.argv[2];
139145
if( g.zLogin ) blob_appendf(&extra, " -U %s", g.zLogin);
140146
if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
141147
zCmd = "list";
142148
useCheckouts = find_option("ckout","c",0)!=0;
149
+ }else if( strncmp(zCmd, "clean", n)==0 ){
150
+ zCmd = "clean --chdir";
151
+ collect_argument(&extra, "allckouts",0);
152
+ collect_argument_value(&extra, "case-sensitive");
153
+ collect_argument_value(&extra, "clean");
154
+ collect_argument(&extra, "dirsonly",0);
155
+ collect_argument(&extra, "dotfiles",0);
156
+ collect_argument(&extra, "emptydirs",0);
157
+ collect_argument(&extra, "force","f");
158
+ collect_argument_value(&extra, "ignore");
159
+ collect_argument_value(&extra, "keep");
160
+ collect_argument(&extra, "temp",0);
161
+ collect_argument(&extra, "verbose","v");
162
+ collect_argument(&extra, "whatif",0);
163
+ useCheckouts = 1;
143164
}else if( strncmp(zCmd, "extra", n)==0 ){
144165
zCmd = "extra --chdir";
145166
collect_argument(&extra, "abs-paths",0);
146167
collect_argument_value(&extra, "case-sensitive");
147168
collect_argument(&extra, "dotfiles",0);
148169
--- src/allrepo.c
+++ src/allrepo.c
@@ -70,11 +70,11 @@
70
71
72 /*
73 ** COMMAND: all
74 **
75 ** Usage: %fossil all (changes|extra|ignore|list|ls|pull|push|rebuild|sync)
76 **
77 ** The ~/.fossil file records the location of all repositories for a
78 ** user. This command performs certain operations on all repositories
79 ** that can be useful before or after a period of disconnected operation.
80 **
@@ -82,10 +82,16 @@
82 ** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
83 **
84 ** Available operations are:
85 **
86 ** changes Shows all local checkouts that have uncommitted changes
 
 
 
 
 
 
87 **
88 ** extra Shows extra files from all local checkouts
89 **
90 ** ignore Arguments are repositories that should be ignored
91 ** by subsequent list, pull, push, rebuild, and sync.
@@ -128,20 +134,35 @@
128 if( !dryRunFlag ){
129 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
130 }
131
132 if( g.argc<3 ){
133 usage("changes|extra|ignore|list|ls|pull|push|rebuild|sync");
134 }
135 n = strlen(g.argv[2]);
136 db_open_config(1);
137 blob_zero(&extra);
138 zCmd = g.argv[2];
139 if( g.zLogin ) blob_appendf(&extra, " -U %s", g.zLogin);
140 if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
141 zCmd = "list";
142 useCheckouts = find_option("ckout","c",0)!=0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143 }else if( strncmp(zCmd, "extra", n)==0 ){
144 zCmd = "extra --chdir";
145 collect_argument(&extra, "abs-paths",0);
146 collect_argument_value(&extra, "case-sensitive");
147 collect_argument(&extra, "dotfiles",0);
148
--- src/allrepo.c
+++ src/allrepo.c
@@ -70,11 +70,11 @@
70
71
72 /*
73 ** COMMAND: all
74 **
75 ** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
76 **
77 ** The ~/.fossil file records the location of all repositories for a
78 ** user. This command performs certain operations on all repositories
79 ** that can be useful before or after a period of disconnected operation.
80 **
@@ -82,10 +82,16 @@
82 ** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
83 **
84 ** Available operations are:
85 **
86 ** changes Shows all local checkouts that have uncommitted changes
87 **
88 ** clean Delete all "extra" files in all local checkouts. Extreme
89 ** caution should be exercised with this command because its
90 ** effects cannot be undone. Use of the -whatif option to
91 ** carefully review the files to be deleted beforehand is
92 ** highly recommended.
93 **
94 ** extra Shows extra files from all local checkouts
95 **
96 ** ignore Arguments are repositories that should be ignored
97 ** by subsequent list, pull, push, rebuild, and sync.
@@ -128,20 +134,35 @@
134 if( !dryRunFlag ){
135 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
136 }
137
138 if( g.argc<3 ){
139 usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
140 }
141 n = strlen(g.argv[2]);
142 db_open_config(1);
143 blob_zero(&extra);
144 zCmd = g.argv[2];
145 if( g.zLogin ) blob_appendf(&extra, " -U %s", g.zLogin);
146 if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
147 zCmd = "list";
148 useCheckouts = find_option("ckout","c",0)!=0;
149 }else if( strncmp(zCmd, "clean", n)==0 ){
150 zCmd = "clean --chdir";
151 collect_argument(&extra, "allckouts",0);
152 collect_argument_value(&extra, "case-sensitive");
153 collect_argument_value(&extra, "clean");
154 collect_argument(&extra, "dirsonly",0);
155 collect_argument(&extra, "dotfiles",0);
156 collect_argument(&extra, "emptydirs",0);
157 collect_argument(&extra, "force","f");
158 collect_argument_value(&extra, "ignore");
159 collect_argument_value(&extra, "keep");
160 collect_argument(&extra, "temp",0);
161 collect_argument(&extra, "verbose","v");
162 collect_argument(&extra, "whatif",0);
163 useCheckouts = 1;
164 }else if( strncmp(zCmd, "extra", n)==0 ){
165 zCmd = "extra --chdir";
166 collect_argument(&extra, "abs-paths",0);
167 collect_argument_value(&extra, "case-sensitive");
168 collect_argument(&extra, "dotfiles",0);
169
--- src/checkin.c
+++ src/checkin.c
@@ -550,10 +550,13 @@
550550
551551
dryRunFlag = find_option("dry-run","n",0)!=0;
552552
if( !dryRunFlag ){
553553
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
554554
}
555
+ if( !dryRunFlag ){
556
+ dryRunFlag = find_option("whatif",0,0)!=0;
557
+ }
555558
allFileFlag = allDirFlag = find_option("force","f",0)!=0;
556559
dirsOnlyFlag = find_option("dirsonly",0,0)!=0;
557560
emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag;
558561
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
559562
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
560563
--- src/checkin.c
+++ src/checkin.c
@@ -550,10 +550,13 @@
550
551 dryRunFlag = find_option("dry-run","n",0)!=0;
552 if( !dryRunFlag ){
553 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
554 }
 
 
 
555 allFileFlag = allDirFlag = find_option("force","f",0)!=0;
556 dirsOnlyFlag = find_option("dirsonly",0,0)!=0;
557 emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag;
558 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
559 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
560
--- src/checkin.c
+++ src/checkin.c
@@ -550,10 +550,13 @@
550
551 dryRunFlag = find_option("dry-run","n",0)!=0;
552 if( !dryRunFlag ){
553 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
554 }
555 if( !dryRunFlag ){
556 dryRunFlag = find_option("whatif",0,0)!=0;
557 }
558 allFileFlag = allDirFlag = find_option("force","f",0)!=0;
559 dirsOnlyFlag = find_option("dirsonly",0,0)!=0;
560 emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag;
561 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
562 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
563

Keyboard Shortcuts

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