Fossil SCM
Removed the hard-coded restriction against using /fileedit on the main fossil repo and tweaked an error message.
Commit
3c795e877c90c2c631b8851dc5c5ff7610528048d599f49396a30aaafebf0287
Parent
8573443f32b446b…
2 files changed
-15
+3
-1
-15
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -446,25 +446,11 @@ | ||
| 446 | 446 | or not */ |
| 447 | 447 | ManifestFile * zFilePrev; /* file entry from pCI->pParent */ |
| 448 | 448 | int prevFRid = 0; /* RID of file's prev. version */ |
| 449 | 449 | #define ci_err(EXPR) if(pErr!=0){blob_appendf EXPR;} goto ci_error |
| 450 | 450 | |
| 451 | - if(!(pCI->flags & CIMINI_DRY_RUN)){ | |
| 452 | - /* Until this feature is fully vetted, disallow it in the main | |
| 453 | - ** fossil repo unless dry-run mode is being used. */ | |
| 454 | - char * zProjCode = db_get("project-code",0); | |
| 455 | - assert(zProjCode); | |
| 456 | - if(0==fossil_stricmp("CE59BB9F186226D80E49D1FA2DB29F935CCA0333", | |
| 457 | - zProjCode)){ | |
| 458 | - fossil_fatal("Never, ever run this in/on the core fossil repo " | |
| 459 | - "in non-dry-run mode until it's been well-vetted. " | |
| 460 | - "Use a temp/test repo."); | |
| 461 | - } | |
| 462 | - fossil_free(zProjCode); | |
| 463 | - } | |
| 464 | 451 | db_begin_transaction(); |
| 465 | - | |
| 466 | 452 | if(pCI->pParent==0 && pCI->zParentUuid==0){ |
| 467 | 453 | ci_err((pErr, "Cannot determine parent version.")); |
| 468 | 454 | } |
| 469 | 455 | else if(pCI->pParent==0){ |
| 470 | 456 | pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0); |
| @@ -473,11 +459,10 @@ | ||
| 473 | 459 | } |
| 474 | 460 | }else if(pCI->zParentUuid==0){ |
| 475 | 461 | pCI->zParentUuid = rid_to_uuid(pCI->pParent->rid); |
| 476 | 462 | assert(pCI->zParentUuid); |
| 477 | 463 | } |
| 478 | - | |
| 479 | 464 | assert(pCI->pParent->rid>0); |
| 480 | 465 | if(leaf_is_closed(pCI->pParent->rid)){ |
| 481 | 466 | ci_err((pErr,"Cannot commit to a closed leaf.")); |
| 482 | 467 | /* Remember that in order to override this we'd also need to |
| 483 | 468 | ** cancel TAG_CLOSED on pCI->pParent. There would seem to be no |
| 484 | 469 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -446,25 +446,11 @@ | |
| 446 | or not */ |
| 447 | ManifestFile * zFilePrev; /* file entry from pCI->pParent */ |
| 448 | int prevFRid = 0; /* RID of file's prev. version */ |
| 449 | #define ci_err(EXPR) if(pErr!=0){blob_appendf EXPR;} goto ci_error |
| 450 | |
| 451 | if(!(pCI->flags & CIMINI_DRY_RUN)){ |
| 452 | /* Until this feature is fully vetted, disallow it in the main |
| 453 | ** fossil repo unless dry-run mode is being used. */ |
| 454 | char * zProjCode = db_get("project-code",0); |
| 455 | assert(zProjCode); |
| 456 | if(0==fossil_stricmp("CE59BB9F186226D80E49D1FA2DB29F935CCA0333", |
| 457 | zProjCode)){ |
| 458 | fossil_fatal("Never, ever run this in/on the core fossil repo " |
| 459 | "in non-dry-run mode until it's been well-vetted. " |
| 460 | "Use a temp/test repo."); |
| 461 | } |
| 462 | fossil_free(zProjCode); |
| 463 | } |
| 464 | db_begin_transaction(); |
| 465 | |
| 466 | if(pCI->pParent==0 && pCI->zParentUuid==0){ |
| 467 | ci_err((pErr, "Cannot determine parent version.")); |
| 468 | } |
| 469 | else if(pCI->pParent==0){ |
| 470 | pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0); |
| @@ -473,11 +459,10 @@ | |
| 473 | } |
| 474 | }else if(pCI->zParentUuid==0){ |
| 475 | pCI->zParentUuid = rid_to_uuid(pCI->pParent->rid); |
| 476 | assert(pCI->zParentUuid); |
| 477 | } |
| 478 | |
| 479 | assert(pCI->pParent->rid>0); |
| 480 | if(leaf_is_closed(pCI->pParent->rid)){ |
| 481 | ci_err((pErr,"Cannot commit to a closed leaf.")); |
| 482 | /* Remember that in order to override this we'd also need to |
| 483 | ** cancel TAG_CLOSED on pCI->pParent. There would seem to be no |
| 484 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -446,25 +446,11 @@ | |
| 446 | or not */ |
| 447 | ManifestFile * zFilePrev; /* file entry from pCI->pParent */ |
| 448 | int prevFRid = 0; /* RID of file's prev. version */ |
| 449 | #define ci_err(EXPR) if(pErr!=0){blob_appendf EXPR;} goto ci_error |
| 450 | |
| 451 | db_begin_transaction(); |
| 452 | if(pCI->pParent==0 && pCI->zParentUuid==0){ |
| 453 | ci_err((pErr, "Cannot determine parent version.")); |
| 454 | } |
| 455 | else if(pCI->pParent==0){ |
| 456 | pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0); |
| @@ -473,11 +459,10 @@ | |
| 459 | } |
| 460 | }else if(pCI->zParentUuid==0){ |
| 461 | pCI->zParentUuid = rid_to_uuid(pCI->pParent->rid); |
| 462 | assert(pCI->zParentUuid); |
| 463 | } |
| 464 | assert(pCI->pParent->rid>0); |
| 465 | if(leaf_is_closed(pCI->pParent->rid)){ |
| 466 | ci_err((pErr,"Cannot commit to a closed leaf.")); |
| 467 | /* Remember that in order to override this we'd also need to |
| 468 | ** cancel TAG_CLOSED on pCI->pParent. There would seem to be no |
| 469 |
+3
-1
| --- src/fossil.page.fileedit.js | ||
| +++ src/fossil.page.fileedit.js | ||
| @@ -258,11 +258,11 @@ | ||
| 258 | 258 | while(li.length>maxCount){ |
| 259 | 259 | ++n; |
| 260 | 260 | const e = li.shift(); |
| 261 | 261 | this._disableNextEvent = true; |
| 262 | 262 | this.unstash(e); |
| 263 | - console.warn("Pruned oldest stash entry:",e); | |
| 263 | + console.warn("Pruned oldest local file edit entry:",e); | |
| 264 | 264 | } |
| 265 | 265 | if(n) this._fireStashEvent(); |
| 266 | 266 | } |
| 267 | 267 | }; |
| 268 | 268 | $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize; |
| @@ -1214,7 +1214,9 @@ | ||
| 1214 | 1214 | filename/checkin values), return it, else return undefined. |
| 1215 | 1215 | */ |
| 1216 | 1216 | P.getStashedFinfo = function(finfo){ |
| 1217 | 1217 | return $stash.getFinfo(finfo); |
| 1218 | 1218 | }; |
| 1219 | + | |
| 1220 | + P.$stash = $stash /*only for testing/debugging - not part of the API.*/; | |
| 1219 | 1221 | |
| 1220 | 1222 | })(window.fossil); |
| 1221 | 1223 |
| --- src/fossil.page.fileedit.js | |
| +++ src/fossil.page.fileedit.js | |
| @@ -258,11 +258,11 @@ | |
| 258 | while(li.length>maxCount){ |
| 259 | ++n; |
| 260 | const e = li.shift(); |
| 261 | this._disableNextEvent = true; |
| 262 | this.unstash(e); |
| 263 | console.warn("Pruned oldest stash entry:",e); |
| 264 | } |
| 265 | if(n) this._fireStashEvent(); |
| 266 | } |
| 267 | }; |
| 268 | $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize; |
| @@ -1214,7 +1214,9 @@ | |
| 1214 | filename/checkin values), return it, else return undefined. |
| 1215 | */ |
| 1216 | P.getStashedFinfo = function(finfo){ |
| 1217 | return $stash.getFinfo(finfo); |
| 1218 | }; |
| 1219 | |
| 1220 | })(window.fossil); |
| 1221 |
| --- src/fossil.page.fileedit.js | |
| +++ src/fossil.page.fileedit.js | |
| @@ -258,11 +258,11 @@ | |
| 258 | while(li.length>maxCount){ |
| 259 | ++n; |
| 260 | const e = li.shift(); |
| 261 | this._disableNextEvent = true; |
| 262 | this.unstash(e); |
| 263 | console.warn("Pruned oldest local file edit entry:",e); |
| 264 | } |
| 265 | if(n) this._fireStashEvent(); |
| 266 | } |
| 267 | }; |
| 268 | $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize; |
| @@ -1214,7 +1214,9 @@ | |
| 1214 | filename/checkin values), return it, else return undefined. |
| 1215 | */ |
| 1216 | P.getStashedFinfo = function(finfo){ |
| 1217 | return $stash.getFinfo(finfo); |
| 1218 | }; |
| 1219 | |
| 1220 | P.$stash = $stash /*only for testing/debugging - not part of the API.*/; |
| 1221 | |
| 1222 | })(window.fossil); |
| 1223 |