Fossil SCM
Let "fossil purge checkins" run on a repository named with -R. It read the check-out database to protect the current check-out even when none was open, and failed with a database error.
Commit
2aee44af8e2b7fedb3be6d7d7ef806b806f1428a879425709b71947574121b20
Parent
7bb98c70346efc8…
1 file changed
+1
-1
+1
-1
| --- src/purge.c | ||
| +++ src/purge.c | ||
| @@ -558,11 +558,11 @@ | ||
| 558 | 558 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 559 | 559 | for(i=3; i<g.argc; i++){ |
| 560 | 560 | int r = name_to_typed_rid(g.argv[i], "br"); |
| 561 | 561 | compute_descendants(r, 1000000000); |
| 562 | 562 | } |
| 563 | - vid = db_lget_int("checkout",0); | |
| 563 | + vid = g.localOpen ? db_lget_int("checkout",0) : 0; | |
| 564 | 564 | if( db_exists("SELECT 1 FROM ok WHERE rid=%d",vid) ){ |
| 565 | 565 | fossil_fatal("cannot purge the current check-out"); |
| 566 | 566 | } |
| 567 | 567 | find_checkin_associates("ok", 1); |
| 568 | 568 | purge_artifact_list("ok", "", purgeFlags); |
| 569 | 569 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -558,11 +558,11 @@ | |
| 558 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 559 | for(i=3; i<g.argc; i++){ |
| 560 | int r = name_to_typed_rid(g.argv[i], "br"); |
| 561 | compute_descendants(r, 1000000000); |
| 562 | } |
| 563 | vid = db_lget_int("checkout",0); |
| 564 | if( db_exists("SELECT 1 FROM ok WHERE rid=%d",vid) ){ |
| 565 | fossil_fatal("cannot purge the current check-out"); |
| 566 | } |
| 567 | find_checkin_associates("ok", 1); |
| 568 | purge_artifact_list("ok", "", purgeFlags); |
| 569 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -558,11 +558,11 @@ | |
| 558 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 559 | for(i=3; i<g.argc; i++){ |
| 560 | int r = name_to_typed_rid(g.argv[i], "br"); |
| 561 | compute_descendants(r, 1000000000); |
| 562 | } |
| 563 | vid = g.localOpen ? db_lget_int("checkout",0) : 0; |
| 564 | if( db_exists("SELECT 1 FROM ok WHERE rid=%d",vid) ){ |
| 565 | fossil_fatal("cannot purge the current check-out"); |
| 566 | } |
| 567 | find_checkin_associates("ok", 1); |
| 568 | purge_artifact_list("ok", "", purgeFlags); |
| 569 |