Fossil SCM

Removed the hard-coded restriction against using /fileedit on the main fossil repo and tweaked an error message.

stephan 2020-05-16 06:34 fileedit-ajaxify
Commit 3c795e877c90c2c631b8851dc5c5ff7610528048d599f49396a30aaafebf0287
--- src/fileedit.c
+++ src/fileedit.c
@@ -446,25 +446,11 @@
446446
or not */
447447
ManifestFile * zFilePrev; /* file entry from pCI->pParent */
448448
int prevFRid = 0; /* RID of file's prev. version */
449449
#define ci_err(EXPR) if(pErr!=0){blob_appendf EXPR;} goto ci_error
450450
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
- }
464451
db_begin_transaction();
465
-
466452
if(pCI->pParent==0 && pCI->zParentUuid==0){
467453
ci_err((pErr, "Cannot determine parent version."));
468454
}
469455
else if(pCI->pParent==0){
470456
pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0);
@@ -473,11 +459,10 @@
473459
}
474460
}else if(pCI->zParentUuid==0){
475461
pCI->zParentUuid = rid_to_uuid(pCI->pParent->rid);
476462
assert(pCI->zParentUuid);
477463
}
478
-
479464
assert(pCI->pParent->rid>0);
480465
if(leaf_is_closed(pCI->pParent->rid)){
481466
ci_err((pErr,"Cannot commit to a closed leaf."));
482467
/* Remember that in order to override this we'd also need to
483468
** cancel TAG_CLOSED on pCI->pParent. There would seem to be no
484469
--- 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
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -258,11 +258,11 @@
258258
while(li.length>maxCount){
259259
++n;
260260
const e = li.shift();
261261
this._disableNextEvent = true;
262262
this.unstash(e);
263
- console.warn("Pruned oldest stash entry:",e);
263
+ console.warn("Pruned oldest local file edit entry:",e);
264264
}
265265
if(n) this._fireStashEvent();
266266
}
267267
};
268268
$stash.prune.defaultMaxCount = P.config.defaultMaxStashSize;
@@ -1214,7 +1214,9 @@
12141214
filename/checkin values), return it, else return undefined.
12151215
*/
12161216
P.getStashedFinfo = function(finfo){
12171217
return $stash.getFinfo(finfo);
12181218
};
1219
+
1220
+ P.$stash = $stash /*only for testing/debugging - not part of the API.*/;
12191221
12201222
})(window.fossil);
12211223
--- 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

Keyboard Shortcuts

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