| | @@ -58,19 +58,23 @@ |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | static void collect_argument_value(Blob *pExtra, const char *zArg){ |
| 61 | 61 | const char *zValue = find_option(zArg, 0, 1); |
| 62 | 62 | if( zValue ){ |
| 63 | | - blob_appendf(pExtra, " --%s %s", zArg, zValue); |
| 63 | + if( zValue[0] ){ |
| 64 | + blob_appendf(pExtra, " --%s %s", zArg, zValue); |
| 65 | + }else{ |
| 66 | + blob_appendf(pExtra, " --%s \"\"", zArg); |
| 67 | + } |
| 64 | 68 | } |
| 65 | 69 | } |
| 66 | 70 | |
| 67 | 71 | |
| 68 | 72 | /* |
| 69 | 73 | ** COMMAND: all |
| 70 | 74 | ** |
| 71 | | -** Usage: %fossil all (changes|ignore|list|ls|pull|push|rebuild|sync) |
| 75 | +** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync) |
| 72 | 76 | ** |
| 73 | 77 | ** The ~/.fossil file records the location of all repositories for a |
| 74 | 78 | ** user. This command performs certain operations on all repositories |
| 75 | 79 | ** that can be useful before or after a period of disconnected operation. |
| 76 | 80 | ** |
| | @@ -78,10 +82,19 @@ |
| 78 | 82 | ** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%. |
| 79 | 83 | ** |
| 80 | 84 | ** Available operations are: |
| 81 | 85 | ** |
| 82 | 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 -dry-run option to |
| 91 | +** carefully review the local checkouts to be operated upon |
| 92 | +** and the -whatif option to carefully review the files to |
| 93 | +** be deleted beforehand is highly recommended. |
| 94 | +** |
| 95 | +** extra Shows extra files from all local checkouts |
| 83 | 96 | ** |
| 84 | 97 | ** ignore Arguments are repositories that should be ignored |
| 85 | 98 | ** by subsequent list, pull, push, rebuild, and sync. |
| 86 | 99 | ** The -c|--ckout option causes the listed local checkouts |
| 87 | 100 | ** to be ignored instead. |
| | @@ -125,20 +138,45 @@ |
| 125 | 138 | if( !dryRunFlag ){ |
| 126 | 139 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 127 | 140 | } |
| 128 | 141 | |
| 129 | 142 | if( g.argc<3 ){ |
| 130 | | - usage("changes|ignore|list|ls|pull|push|rebuild|sync"); |
| 143 | + usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync"); |
| 131 | 144 | } |
| 132 | 145 | n = strlen(g.argv[2]); |
| 133 | 146 | db_open_config(1); |
| 134 | 147 | blob_zero(&extra); |
| 135 | 148 | zCmd = g.argv[2]; |
| 136 | 149 | if( g.zLogin ) blob_appendf(&extra, " -U %s", g.zLogin); |
| 137 | 150 | if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){ |
| 138 | 151 | zCmd = "list"; |
| 139 | 152 | useCheckouts = find_option("ckout","c",0)!=0; |
| 153 | + }else if( strncmp(zCmd, "clean", n)==0 ){ |
| 154 | + zCmd = "clean --chdir"; |
| 155 | + collect_argument(&extra, "allckouts",0); |
| 156 | + collect_argument_value(&extra, "case-sensitive"); |
| 157 | + collect_argument_value(&extra, "clean"); |
| 158 | + collect_argument(&extra, "dirsonly",0); |
| 159 | + collect_argument(&extra, "dotfiles",0); |
| 160 | + collect_argument(&extra, "emptydirs",0); |
| 161 | + collect_argument(&extra, "force","f"); |
| 162 | + collect_argument_value(&extra, "ignore"); |
| 163 | + collect_argument_value(&extra, "keep"); |
| 164 | + collect_argument(&extra, "temp",0); |
| 165 | + collect_argument(&extra, "verbose","v"); |
| 166 | + collect_argument(&extra, "whatif",0); |
| 167 | + useCheckouts = 1; |
| 168 | + }else if( strncmp(zCmd, "extra", n)==0 ){ |
| 169 | + zCmd = "extra --chdir"; |
| 170 | + collect_argument(&extra, "abs-paths",0); |
| 171 | + collect_argument_value(&extra, "case-sensitive"); |
| 172 | + collect_argument(&extra, "dotfiles",0); |
| 173 | + collect_argument_value(&extra, "ignore"); |
| 174 | + collect_argument(&extra, "rel-paths",0); |
| 175 | + useCheckouts = 1; |
| 176 | + stopOnError = 0; |
| 177 | + quiet = 1; |
| 140 | 178 | }else if( strncmp(zCmd, "push", n)==0 ){ |
| 141 | 179 | zCmd = "push -autourl -R"; |
| 142 | 180 | collect_argument(&extra, "verbose","v"); |
| 143 | 181 | }else if( strncmp(zCmd, "pull", n)==0 ){ |
| 144 | 182 | zCmd = "pull -autourl -R"; |
| 145 | 183 | |