Fossil SCM

Avoid entering a ticket-change artifact that does not specify any changes.

drh 2012-10-15 15:10 trunk
Commit 7097562813f763f475fe1c7d7f7687a82221aba2
1 file changed +6
+6
--- src/tkt.c
+++ src/tkt.c
@@ -433,10 +433,11 @@
433433
){
434434
char *zDate;
435435
const char *zUuid;
436436
int i;
437437
int rid;
438
+ int nJ = 0;
438439
Blob tktchng, cksum;
439440
440441
login_verify_csrf_secret();
441442
zUuid = (const char *)pUuid;
442443
blob_zero(&tktchng);
@@ -461,10 +462,11 @@
461462
zValue = db_conceal(zValue, nValue);
462463
blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue);
463464
}else{
464465
blob_appendf(&tktchng, "J %s %#F\n", azField[i], nValue, zValue);
465466
}
467
+ nJ++;
466468
}
467469
}
468470
}
469471
if( *(char**)pUuid ){
470472
zUuid = db_text(0,
@@ -476,10 +478,14 @@
476478
*(const char**)pUuid = zUuid;
477479
blob_appendf(&tktchng, "K %s\n", zUuid);
478480
blob_appendf(&tktchng, "U %F\n", g.zLogin ? g.zLogin : "");
479481
md5sum_blob(&tktchng, &cksum);
480482
blob_appendf(&tktchng, "Z %b\n", &cksum);
483
+ if( nJ==0 ){
484
+ blob_reset(&tktchng);
485
+ return TH_OK;
486
+ }
481487
if( g.zPath[0]=='d' ){
482488
/* If called from /debug_tktnew or /debug_tktedit... */
483489
@ <font color="blue">
484490
@ <p>Ticket artifact that would have been submitted:</p>
485491
@ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote>
486492
--- src/tkt.c
+++ src/tkt.c
@@ -433,10 +433,11 @@
433 ){
434 char *zDate;
435 const char *zUuid;
436 int i;
437 int rid;
 
438 Blob tktchng, cksum;
439
440 login_verify_csrf_secret();
441 zUuid = (const char *)pUuid;
442 blob_zero(&tktchng);
@@ -461,10 +462,11 @@
461 zValue = db_conceal(zValue, nValue);
462 blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue);
463 }else{
464 blob_appendf(&tktchng, "J %s %#F\n", azField[i], nValue, zValue);
465 }
 
466 }
467 }
468 }
469 if( *(char**)pUuid ){
470 zUuid = db_text(0,
@@ -476,10 +478,14 @@
476 *(const char**)pUuid = zUuid;
477 blob_appendf(&tktchng, "K %s\n", zUuid);
478 blob_appendf(&tktchng, "U %F\n", g.zLogin ? g.zLogin : "");
479 md5sum_blob(&tktchng, &cksum);
480 blob_appendf(&tktchng, "Z %b\n", &cksum);
 
 
 
 
481 if( g.zPath[0]=='d' ){
482 /* If called from /debug_tktnew or /debug_tktedit... */
483 @ <font color="blue">
484 @ <p>Ticket artifact that would have been submitted:</p>
485 @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote>
486
--- src/tkt.c
+++ src/tkt.c
@@ -433,10 +433,11 @@
433 ){
434 char *zDate;
435 const char *zUuid;
436 int i;
437 int rid;
438 int nJ = 0;
439 Blob tktchng, cksum;
440
441 login_verify_csrf_secret();
442 zUuid = (const char *)pUuid;
443 blob_zero(&tktchng);
@@ -461,10 +462,11 @@
462 zValue = db_conceal(zValue, nValue);
463 blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue);
464 }else{
465 blob_appendf(&tktchng, "J %s %#F\n", azField[i], nValue, zValue);
466 }
467 nJ++;
468 }
469 }
470 }
471 if( *(char**)pUuid ){
472 zUuid = db_text(0,
@@ -476,10 +478,14 @@
478 *(const char**)pUuid = zUuid;
479 blob_appendf(&tktchng, "K %s\n", zUuid);
480 blob_appendf(&tktchng, "U %F\n", g.zLogin ? g.zLogin : "");
481 md5sum_blob(&tktchng, &cksum);
482 blob_appendf(&tktchng, "Z %b\n", &cksum);
483 if( nJ==0 ){
484 blob_reset(&tktchng);
485 return TH_OK;
486 }
487 if( g.zPath[0]=='d' ){
488 /* If called from /debug_tktnew or /debug_tktedit... */
489 @ <font color="blue">
490 @ <p>Ticket artifact that would have been submitted:</p>
491 @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote>
492

Keyboard Shortcuts

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