Fossil SCM
The "extra" and "clean" commands ignore the repository file if the repository happens to be within the check-out. Ticket [c7b35be88].
Commit
2ecc407d9be8f079f8cd631ddbb2e0884a1254a3
Parent
bad9999d7dc3319…
6 files changed
+2
-2
+9
-2
+1
-1
+7
-4
+2
-2
+1
-1
+2
-2
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | fossil_fatal("not found: %s", zName); |
| 61 | 61 | } |
| 62 | 62 | if( isDir==2 && access(zName, R_OK) ){ |
| 63 | 63 | fossil_fatal("cannot open %s", zName); |
| 64 | 64 | } |
| 65 | - file_tree_name(zName, &pathname); | |
| 65 | + file_tree_name(zName, &pathname, 1); | |
| 66 | 66 | zPath = blob_str(&pathname); |
| 67 | 67 | if( strcmp(zPath, "manifest")==0 |
| 68 | 68 | || strcmp(zPath, "_FOSSIL_")==0 |
| 69 | 69 | || strcmp(zPath, "manifest.uuid")==0 |
| 70 | 70 | ){ |
| @@ -109,11 +109,11 @@ | ||
| 109 | 109 | char *zName; |
| 110 | 110 | char *zPath; |
| 111 | 111 | Blob pathname; |
| 112 | 112 | |
| 113 | 113 | zName = mprintf("%/", g.argv[i]); |
| 114 | - file_tree_name(zName, &pathname); | |
| 114 | + file_tree_name(zName, &pathname, 1); | |
| 115 | 115 | zPath = blob_str(&pathname); |
| 116 | 116 | if( !db_exists( |
| 117 | 117 | "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){ |
| 118 | 118 | fossil_fatal("not in the repository: %s", zName); |
| 119 | 119 | }else{ |
| 120 | 120 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | fossil_fatal("not found: %s", zName); |
| 61 | } |
| 62 | if( isDir==2 && access(zName, R_OK) ){ |
| 63 | fossil_fatal("cannot open %s", zName); |
| 64 | } |
| 65 | file_tree_name(zName, &pathname); |
| 66 | zPath = blob_str(&pathname); |
| 67 | if( strcmp(zPath, "manifest")==0 |
| 68 | || strcmp(zPath, "_FOSSIL_")==0 |
| 69 | || strcmp(zPath, "manifest.uuid")==0 |
| 70 | ){ |
| @@ -109,11 +109,11 @@ | |
| 109 | char *zName; |
| 110 | char *zPath; |
| 111 | Blob pathname; |
| 112 | |
| 113 | zName = mprintf("%/", g.argv[i]); |
| 114 | file_tree_name(zName, &pathname); |
| 115 | zPath = blob_str(&pathname); |
| 116 | if( !db_exists( |
| 117 | "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){ |
| 118 | fossil_fatal("not in the repository: %s", zName); |
| 119 | }else{ |
| 120 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | fossil_fatal("not found: %s", zName); |
| 61 | } |
| 62 | if( isDir==2 && access(zName, R_OK) ){ |
| 63 | fossil_fatal("cannot open %s", zName); |
| 64 | } |
| 65 | file_tree_name(zName, &pathname, 1); |
| 66 | zPath = blob_str(&pathname); |
| 67 | if( strcmp(zPath, "manifest")==0 |
| 68 | || strcmp(zPath, "_FOSSIL_")==0 |
| 69 | || strcmp(zPath, "manifest.uuid")==0 |
| 70 | ){ |
| @@ -109,11 +109,11 @@ | |
| 109 | char *zName; |
| 110 | char *zPath; |
| 111 | Blob pathname; |
| 112 | |
| 113 | zName = mprintf("%/", g.argv[i]); |
| 114 | file_tree_name(zName, &pathname, 1); |
| 115 | zPath = blob_str(&pathname); |
| 116 | if( !db_exists( |
| 117 | "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){ |
| 118 | fossil_fatal("not in the repository: %s", zName); |
| 119 | }else{ |
| 120 |
+9
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -154,10 +154,11 @@ | ||
| 154 | 154 | ** Print a list of all files in the source tree that are not part of |
| 155 | 155 | ** the current checkout. See also the "clean" command. |
| 156 | 156 | */ |
| 157 | 157 | void extra_cmd(void){ |
| 158 | 158 | Blob path; |
| 159 | + Blob repo; | |
| 159 | 160 | Stmt q; |
| 160 | 161 | int n; |
| 161 | 162 | db_must_be_within_tree(); |
| 162 | 163 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| 163 | 164 | n = strlen(g.zLocalRoot); |
| @@ -165,10 +166,13 @@ | ||
| 165 | 166 | vfile_scan(0, &path, blob_size(&path)); |
| 166 | 167 | db_prepare(&q, |
| 167 | 168 | "SELECT x FROM sfile" |
| 168 | 169 | " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')" |
| 169 | 170 | " ORDER BY 1"); |
| 171 | + if( file_tree_name(g.zRepositoryName, &repo, 0) ){ | |
| 172 | + db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); | |
| 173 | + } | |
| 170 | 174 | while( db_step(&q)==SQLITE_ROW ){ |
| 171 | 175 | printf("%s\n", db_column_text(&q, 0)); |
| 172 | 176 | } |
| 173 | 177 | db_finalize(&q); |
| 174 | 178 | } |
| @@ -185,11 +189,11 @@ | ||
| 185 | 189 | ** sure you wish to remove all "extra" files you can specify the |
| 186 | 190 | ** optional -all flag. |
| 187 | 191 | */ |
| 188 | 192 | void clean_cmd(void){ |
| 189 | 193 | int allFlag; |
| 190 | - Blob path; | |
| 194 | + Blob path, repo; | |
| 191 | 195 | Stmt q; |
| 192 | 196 | int n; |
| 193 | 197 | allFlag = find_option("all","a",0)!=0; |
| 194 | 198 | db_must_be_within_tree(); |
| 195 | 199 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| @@ -198,10 +202,13 @@ | ||
| 198 | 202 | vfile_scan(0, &path, blob_size(&path)); |
| 199 | 203 | db_prepare(&q, |
| 200 | 204 | "SELECT %Q || x FROM sfile" |
| 201 | 205 | " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')" |
| 202 | 206 | " ORDER BY 1", g.zLocalRoot); |
| 207 | + if( file_tree_name(g.zRepositoryName, &repo, 0) ){ | |
| 208 | + db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); | |
| 209 | + } | |
| 203 | 210 | while( db_step(&q)==SQLITE_ROW ){ |
| 204 | 211 | if( allFlag ){ |
| 205 | 212 | unlink(db_column_text(&q, 0)); |
| 206 | 213 | }else{ |
| 207 | 214 | Blob ans; |
| @@ -303,11 +310,11 @@ | ||
| 303 | 310 | blob_zero(&b); |
| 304 | 311 | g.aCommitFile = malloc(sizeof(int)*(g.argc-1)); |
| 305 | 312 | |
| 306 | 313 | for(ii=2; ii<g.argc; ii++){ |
| 307 | 314 | int iId; |
| 308 | - file_tree_name(g.argv[ii], &b); | |
| 315 | + file_tree_name(g.argv[ii], &b, 1); | |
| 309 | 316 | iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b)); |
| 310 | 317 | if( iId<0 ){ |
| 311 | 318 | fossil_fatal("fossil knows nothing about: %s", g.argv[ii]); |
| 312 | 319 | } |
| 313 | 320 | g.aCommitFile[ii-2] = iId; |
| 314 | 321 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -154,10 +154,11 @@ | |
| 154 | ** Print a list of all files in the source tree that are not part of |
| 155 | ** the current checkout. See also the "clean" command. |
| 156 | */ |
| 157 | void extra_cmd(void){ |
| 158 | Blob path; |
| 159 | Stmt q; |
| 160 | int n; |
| 161 | db_must_be_within_tree(); |
| 162 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| 163 | n = strlen(g.zLocalRoot); |
| @@ -165,10 +166,13 @@ | |
| 165 | vfile_scan(0, &path, blob_size(&path)); |
| 166 | db_prepare(&q, |
| 167 | "SELECT x FROM sfile" |
| 168 | " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')" |
| 169 | " ORDER BY 1"); |
| 170 | while( db_step(&q)==SQLITE_ROW ){ |
| 171 | printf("%s\n", db_column_text(&q, 0)); |
| 172 | } |
| 173 | db_finalize(&q); |
| 174 | } |
| @@ -185,11 +189,11 @@ | |
| 185 | ** sure you wish to remove all "extra" files you can specify the |
| 186 | ** optional -all flag. |
| 187 | */ |
| 188 | void clean_cmd(void){ |
| 189 | int allFlag; |
| 190 | Blob path; |
| 191 | Stmt q; |
| 192 | int n; |
| 193 | allFlag = find_option("all","a",0)!=0; |
| 194 | db_must_be_within_tree(); |
| 195 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| @@ -198,10 +202,13 @@ | |
| 198 | vfile_scan(0, &path, blob_size(&path)); |
| 199 | db_prepare(&q, |
| 200 | "SELECT %Q || x FROM sfile" |
| 201 | " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')" |
| 202 | " ORDER BY 1", g.zLocalRoot); |
| 203 | while( db_step(&q)==SQLITE_ROW ){ |
| 204 | if( allFlag ){ |
| 205 | unlink(db_column_text(&q, 0)); |
| 206 | }else{ |
| 207 | Blob ans; |
| @@ -303,11 +310,11 @@ | |
| 303 | blob_zero(&b); |
| 304 | g.aCommitFile = malloc(sizeof(int)*(g.argc-1)); |
| 305 | |
| 306 | for(ii=2; ii<g.argc; ii++){ |
| 307 | int iId; |
| 308 | file_tree_name(g.argv[ii], &b); |
| 309 | iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b)); |
| 310 | if( iId<0 ){ |
| 311 | fossil_fatal("fossil knows nothing about: %s", g.argv[ii]); |
| 312 | } |
| 313 | g.aCommitFile[ii-2] = iId; |
| 314 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -154,10 +154,11 @@ | |
| 154 | ** Print a list of all files in the source tree that are not part of |
| 155 | ** the current checkout. See also the "clean" command. |
| 156 | */ |
| 157 | void extra_cmd(void){ |
| 158 | Blob path; |
| 159 | Blob repo; |
| 160 | Stmt q; |
| 161 | int n; |
| 162 | db_must_be_within_tree(); |
| 163 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| 164 | n = strlen(g.zLocalRoot); |
| @@ -165,10 +166,13 @@ | |
| 166 | vfile_scan(0, &path, blob_size(&path)); |
| 167 | db_prepare(&q, |
| 168 | "SELECT x FROM sfile" |
| 169 | " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')" |
| 170 | " ORDER BY 1"); |
| 171 | if( file_tree_name(g.zRepositoryName, &repo, 0) ){ |
| 172 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 173 | } |
| 174 | while( db_step(&q)==SQLITE_ROW ){ |
| 175 | printf("%s\n", db_column_text(&q, 0)); |
| 176 | } |
| 177 | db_finalize(&q); |
| 178 | } |
| @@ -185,11 +189,11 @@ | |
| 189 | ** sure you wish to remove all "extra" files you can specify the |
| 190 | ** optional -all flag. |
| 191 | */ |
| 192 | void clean_cmd(void){ |
| 193 | int allFlag; |
| 194 | Blob path, repo; |
| 195 | Stmt q; |
| 196 | int n; |
| 197 | allFlag = find_option("all","a",0)!=0; |
| 198 | db_must_be_within_tree(); |
| 199 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| @@ -198,10 +202,13 @@ | |
| 202 | vfile_scan(0, &path, blob_size(&path)); |
| 203 | db_prepare(&q, |
| 204 | "SELECT %Q || x FROM sfile" |
| 205 | " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')" |
| 206 | " ORDER BY 1", g.zLocalRoot); |
| 207 | if( file_tree_name(g.zRepositoryName, &repo, 0) ){ |
| 208 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 209 | } |
| 210 | while( db_step(&q)==SQLITE_ROW ){ |
| 211 | if( allFlag ){ |
| 212 | unlink(db_column_text(&q, 0)); |
| 213 | }else{ |
| 214 | Blob ans; |
| @@ -303,11 +310,11 @@ | |
| 310 | blob_zero(&b); |
| 311 | g.aCommitFile = malloc(sizeof(int)*(g.argc-1)); |
| 312 | |
| 313 | for(ii=2; ii<g.argc; ii++){ |
| 314 | int iId; |
| 315 | file_tree_name(g.argv[ii], &b, 1); |
| 316 | iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b)); |
| 317 | if( iId<0 ){ |
| 318 | fossil_fatal("fossil knows nothing about: %s", g.argv[ii]); |
| 319 | } |
| 320 | g.aCommitFile[ii-2] = iId; |
| 321 |
+1
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -99,11 +99,11 @@ | ||
| 99 | 99 | } |
| 100 | 100 | blob_zero(&cmd); |
| 101 | 101 | blob_appendf(&cmd, "%s ", zExternalCommand); |
| 102 | 102 | } |
| 103 | 103 | zFile = g.argv[g.argc-1]; |
| 104 | - file_tree_name(zFile, &fname); | |
| 104 | + file_tree_name(zFile, &fname, 1); | |
| 105 | 105 | |
| 106 | 106 | blob_zero(&vname); |
| 107 | 107 | do{ |
| 108 | 108 | blob_reset(&vname); |
| 109 | 109 | blob_appendf(&vname, "%s~%d", zFile, cnt++); |
| 110 | 110 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -99,11 +99,11 @@ | |
| 99 | } |
| 100 | blob_zero(&cmd); |
| 101 | blob_appendf(&cmd, "%s ", zExternalCommand); |
| 102 | } |
| 103 | zFile = g.argv[g.argc-1]; |
| 104 | file_tree_name(zFile, &fname); |
| 105 | |
| 106 | blob_zero(&vname); |
| 107 | do{ |
| 108 | blob_reset(&vname); |
| 109 | blob_appendf(&vname, "%s~%d", zFile, cnt++); |
| 110 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -99,11 +99,11 @@ | |
| 99 | } |
| 100 | blob_zero(&cmd); |
| 101 | blob_appendf(&cmd, "%s ", zExternalCommand); |
| 102 | } |
| 103 | zFile = g.argv[g.argc-1]; |
| 104 | file_tree_name(zFile, &fname, 1); |
| 105 | |
| 106 | blob_zero(&vname); |
| 107 | do{ |
| 108 | blob_reset(&vname); |
| 109 | blob_appendf(&vname, "%s~%d", zFile, cnt++); |
| 110 |
+7
-4
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -317,23 +317,26 @@ | ||
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /* |
| 320 | 320 | ** Compute a pathname for a file relative to the root of the local |
| 321 | 321 | ** tree. Return TRUE on success. On failure, print and error |
| 322 | -** message and quit. | |
| 322 | +** message and quit if the errFatal flag is true. If errFatal is | |
| 323 | +** false, then simply return 0. | |
| 323 | 324 | ** |
| 324 | 325 | ** The root of the tree is defined by the g.zLocalRoot variable. |
| 325 | 326 | */ |
| 326 | -int file_tree_name(const char *zOrigName, Blob *pOut){ | |
| 327 | +int file_tree_name(const char *zOrigName, Blob *pOut, int errFatal){ | |
| 327 | 328 | int n; |
| 328 | 329 | Blob full; |
| 329 | 330 | db_must_be_within_tree(); |
| 330 | 331 | file_canonical_name(zOrigName, &full); |
| 331 | 332 | n = strlen(g.zLocalRoot); |
| 332 | 333 | if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){ |
| 333 | 334 | blob_reset(&full); |
| 334 | - fossil_fatal("file outside of checkout tree: %s", zOrigName); | |
| 335 | + if( errFatal ){ | |
| 336 | + fossil_fatal("file outside of checkout tree: %s", zOrigName); | |
| 337 | + } | |
| 335 | 338 | return 0; |
| 336 | 339 | } |
| 337 | 340 | blob_zero(pOut); |
| 338 | 341 | blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n); |
| 339 | 342 | return 1; |
| @@ -347,11 +350,11 @@ | ||
| 347 | 350 | void cmd_test_tree_name(void){ |
| 348 | 351 | int i; |
| 349 | 352 | Blob x; |
| 350 | 353 | blob_zero(&x); |
| 351 | 354 | for(i=2; i<g.argc; i++){ |
| 352 | - if( file_tree_name(g.argv[i], &x) ){ | |
| 355 | + if( file_tree_name(g.argv[i], &x, 1) ){ | |
| 353 | 356 | printf("%s\n", blob_buffer(&x)); |
| 354 | 357 | blob_reset(&x); |
| 355 | 358 | } |
| 356 | 359 | } |
| 357 | 360 | } |
| 358 | 361 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -317,23 +317,26 @@ | |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | ** Compute a pathname for a file relative to the root of the local |
| 321 | ** tree. Return TRUE on success. On failure, print and error |
| 322 | ** message and quit. |
| 323 | ** |
| 324 | ** The root of the tree is defined by the g.zLocalRoot variable. |
| 325 | */ |
| 326 | int file_tree_name(const char *zOrigName, Blob *pOut){ |
| 327 | int n; |
| 328 | Blob full; |
| 329 | db_must_be_within_tree(); |
| 330 | file_canonical_name(zOrigName, &full); |
| 331 | n = strlen(g.zLocalRoot); |
| 332 | if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){ |
| 333 | blob_reset(&full); |
| 334 | fossil_fatal("file outside of checkout tree: %s", zOrigName); |
| 335 | return 0; |
| 336 | } |
| 337 | blob_zero(pOut); |
| 338 | blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n); |
| 339 | return 1; |
| @@ -347,11 +350,11 @@ | |
| 347 | void cmd_test_tree_name(void){ |
| 348 | int i; |
| 349 | Blob x; |
| 350 | blob_zero(&x); |
| 351 | for(i=2; i<g.argc; i++){ |
| 352 | if( file_tree_name(g.argv[i], &x) ){ |
| 353 | printf("%s\n", blob_buffer(&x)); |
| 354 | blob_reset(&x); |
| 355 | } |
| 356 | } |
| 357 | } |
| 358 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -317,23 +317,26 @@ | |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | ** Compute a pathname for a file relative to the root of the local |
| 321 | ** tree. Return TRUE on success. On failure, print and error |
| 322 | ** message and quit if the errFatal flag is true. If errFatal is |
| 323 | ** false, then simply return 0. |
| 324 | ** |
| 325 | ** The root of the tree is defined by the g.zLocalRoot variable. |
| 326 | */ |
| 327 | int file_tree_name(const char *zOrigName, Blob *pOut, int errFatal){ |
| 328 | int n; |
| 329 | Blob full; |
| 330 | db_must_be_within_tree(); |
| 331 | file_canonical_name(zOrigName, &full); |
| 332 | n = strlen(g.zLocalRoot); |
| 333 | if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){ |
| 334 | blob_reset(&full); |
| 335 | if( errFatal ){ |
| 336 | fossil_fatal("file outside of checkout tree: %s", zOrigName); |
| 337 | } |
| 338 | return 0; |
| 339 | } |
| 340 | blob_zero(pOut); |
| 341 | blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n); |
| 342 | return 1; |
| @@ -347,11 +350,11 @@ | |
| 350 | void cmd_test_tree_name(void){ |
| 351 | int i; |
| 352 | Blob x; |
| 353 | blob_zero(&x); |
| 354 | for(i=2; i<g.argc; i++){ |
| 355 | if( file_tree_name(g.argv[i], &x, 1) ){ |
| 356 | printf("%s\n", blob_buffer(&x)); |
| 357 | blob_reset(&x); |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 |
+2
-2
| --- src/undo.c | ||
| +++ src/undo.c | ||
| @@ -215,11 +215,11 @@ | ||
| 215 | 215 | fossil_fatal("no update or merge operation is available to undo"); |
| 216 | 216 | } |
| 217 | 217 | for(i=2; i<g.argc; i++){ |
| 218 | 218 | const char *zFile = g.argv[i]; |
| 219 | 219 | Blob path; |
| 220 | - file_tree_name(zFile, &path); | |
| 220 | + file_tree_name(zFile, &path, 1); | |
| 221 | 221 | undo_one(blob_str(&path), 0); |
| 222 | 222 | blob_reset(&path); |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | db_end_transaction(0); |
| @@ -255,12 +255,12 @@ | ||
| 255 | 255 | fossil_fatal("no update or merge operation is available to redo"); |
| 256 | 256 | } |
| 257 | 257 | for(i=2; i<g.argc; i++){ |
| 258 | 258 | const char *zFile = g.argv[i]; |
| 259 | 259 | Blob path; |
| 260 | - file_tree_name(zFile, &path); | |
| 260 | + file_tree_name(zFile, &path, 1); | |
| 261 | 261 | undo_one(blob_str(&path), 0); |
| 262 | 262 | blob_reset(&path); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | db_end_transaction(0); |
| 266 | 266 | } |
| 267 | 267 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | fossil_fatal("no update or merge operation is available to undo"); |
| 216 | } |
| 217 | for(i=2; i<g.argc; i++){ |
| 218 | const char *zFile = g.argv[i]; |
| 219 | Blob path; |
| 220 | file_tree_name(zFile, &path); |
| 221 | undo_one(blob_str(&path), 0); |
| 222 | blob_reset(&path); |
| 223 | } |
| 224 | } |
| 225 | db_end_transaction(0); |
| @@ -255,12 +255,12 @@ | |
| 255 | fossil_fatal("no update or merge operation is available to redo"); |
| 256 | } |
| 257 | for(i=2; i<g.argc; i++){ |
| 258 | const char *zFile = g.argv[i]; |
| 259 | Blob path; |
| 260 | file_tree_name(zFile, &path); |
| 261 | undo_one(blob_str(&path), 0); |
| 262 | blob_reset(&path); |
| 263 | } |
| 264 | } |
| 265 | db_end_transaction(0); |
| 266 | } |
| 267 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | fossil_fatal("no update or merge operation is available to undo"); |
| 216 | } |
| 217 | for(i=2; i<g.argc; i++){ |
| 218 | const char *zFile = g.argv[i]; |
| 219 | Blob path; |
| 220 | file_tree_name(zFile, &path, 1); |
| 221 | undo_one(blob_str(&path), 0); |
| 222 | blob_reset(&path); |
| 223 | } |
| 224 | } |
| 225 | db_end_transaction(0); |
| @@ -255,12 +255,12 @@ | |
| 255 | fossil_fatal("no update or merge operation is available to redo"); |
| 256 | } |
| 257 | for(i=2; i<g.argc; i++){ |
| 258 | const char *zFile = g.argv[i]; |
| 259 | Blob path; |
| 260 | file_tree_name(zFile, &path, 1); |
| 261 | undo_one(blob_str(&path), 0); |
| 262 | blob_reset(&path); |
| 263 | } |
| 264 | } |
| 265 | db_end_transaction(0); |
| 266 | } |
| 267 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -297,11 +297,11 @@ | ||
| 297 | 297 | } |
| 298 | 298 | db_must_be_within_tree(); |
| 299 | 299 | |
| 300 | 300 | zFile = mprintf("%/", g.argv[g.argc-1]); |
| 301 | 301 | |
| 302 | - file_tree_name(zFile, &fname); | |
| 302 | + file_tree_name(zFile, &fname, 1); | |
| 303 | 303 | |
| 304 | 304 | if( access(zFile, 0) ) yesRevert = 1; |
| 305 | 305 | if( yesRevert==0 ){ |
| 306 | 306 | char *prompt = mprintf("revert file %B? this will" |
| 307 | 307 | " destroy local changes [y/N]? ", |
| 308 | 308 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -297,11 +297,11 @@ | |
| 297 | } |
| 298 | db_must_be_within_tree(); |
| 299 | |
| 300 | zFile = mprintf("%/", g.argv[g.argc-1]); |
| 301 | |
| 302 | file_tree_name(zFile, &fname); |
| 303 | |
| 304 | if( access(zFile, 0) ) yesRevert = 1; |
| 305 | if( yesRevert==0 ){ |
| 306 | char *prompt = mprintf("revert file %B? this will" |
| 307 | " destroy local changes [y/N]? ", |
| 308 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -297,11 +297,11 @@ | |
| 297 | } |
| 298 | db_must_be_within_tree(); |
| 299 | |
| 300 | zFile = mprintf("%/", g.argv[g.argc-1]); |
| 301 | |
| 302 | file_tree_name(zFile, &fname, 1); |
| 303 | |
| 304 | if( access(zFile, 0) ) yesRevert = 1; |
| 305 | if( yesRevert==0 ){ |
| 306 | char *prompt = mprintf("revert file %B? this will" |
| 307 | " destroy local changes [y/N]? ", |
| 308 |