Fossil SCM

When doing a "fossil commit --dry-run", don't store the text "Dry-run mode - no comment provided." as template for the next commit comment.

jan.nijtmans 2013-08-23 09:27 trunk
Commit dfd8962ff260c63b98b252d7da260e8c4136c824
1 file changed +12 -12
+12 -12
--- src/checkin.c
+++ src/checkin.c
@@ -920,11 +920,15 @@
920920
pFile = manifest_file_next(pBaseline, 0);
921921
nFBcard++;
922922
}else{
923923
pFile = 0;
924924
}
925
- blob_appendf(pOut, "C %F\n", blob_str(p->pComment));
925
+ if( blob_size(p->pComment)!=0 ){
926
+ blob_appendf(pOut, "C %F\n", blob_str(p->pComment));
927
+ }else{
928
+ blob_append(pOut, "C (no\\scomment)\n", 16);
929
+ }
926930
zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now");
927931
blob_appendf(pOut, "D %s\n", zDate);
928932
zDate[10] = ' ';
929933
db_prepare(&q,
930934
"SELECT pathname, uuid, origname, blob.rid, isexe, islink,"
@@ -1537,13 +1541,10 @@
15371541
blob_zero(&comment);
15381542
blob_read_from_file(&comment, zComFile);
15391543
blob_to_utf8_no_bom(&comment, 1);
15401544
}else if(dryRunFlag){
15411545
blob_zero(&comment);
1542
- blob_append(&comment, "Dry-run mode - no comment provided.", -1)
1543
- /* Comment needed to avoid downstream assertion. */
1544
- ;
15451546
}else{
15461547
char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
15471548
prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
15481549
if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
15491550
blob_zero(&ans);
@@ -1552,15 +1553,17 @@
15521553
if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
15531554
}
15541555
free(zInit);
15551556
}
15561557
if( blob_size(&comment)==0 ){
1557
- blob_zero(&ans);
1558
- prompt_user("empty check-in comment. continue (y/N)? ", &ans);
1559
- cReply = blob_str(&ans)[0];
1560
- if( cReply!='y' && cReply!='Y' ){
1561
- fossil_exit(1);
1558
+ if( !dryRunFlag ){
1559
+ blob_zero(&ans);
1560
+ prompt_user("empty check-in comment. continue (y/N)? ", &ans);
1561
+ cReply = blob_str(&ans)[0];
1562
+ if( cReply!='y' && cReply!='Y' ){
1563
+ fossil_exit(1);
1564
+ }
15621565
}
15631566
}else{
15641567
db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
15651568
db_end_transaction(0);
15661569
db_begin_transaction();
@@ -1629,13 +1632,10 @@
16291632
fossil_fatal("one or more files were converted on your request; "
16301633
"please re-test before committing");
16311634
}
16321635
16331636
/* Create the new manifest */
1634
- if( blob_size(&comment)==0 ){
1635
- blob_append(&comment, "(no comment)", -1);
1636
- }
16371637
sCiInfo.pComment = &comment;
16381638
sCiInfo.pCksum = useCksum ? &cksum1 : 0;
16391639
sCiInfo.verifyDate = !allowOlder && !forceFlag;
16401640
if( forceDelta ){
16411641
blob_zero(&manifest);
16421642
--- src/checkin.c
+++ src/checkin.c
@@ -920,11 +920,15 @@
920 pFile = manifest_file_next(pBaseline, 0);
921 nFBcard++;
922 }else{
923 pFile = 0;
924 }
925 blob_appendf(pOut, "C %F\n", blob_str(p->pComment));
 
 
 
 
926 zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now");
927 blob_appendf(pOut, "D %s\n", zDate);
928 zDate[10] = ' ';
929 db_prepare(&q,
930 "SELECT pathname, uuid, origname, blob.rid, isexe, islink,"
@@ -1537,13 +1541,10 @@
1537 blob_zero(&comment);
1538 blob_read_from_file(&comment, zComFile);
1539 blob_to_utf8_no_bom(&comment, 1);
1540 }else if(dryRunFlag){
1541 blob_zero(&comment);
1542 blob_append(&comment, "Dry-run mode - no comment provided.", -1)
1543 /* Comment needed to avoid downstream assertion. */
1544 ;
1545 }else{
1546 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1547 prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
1548 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
1549 blob_zero(&ans);
@@ -1552,15 +1553,17 @@
1552 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
1553 }
1554 free(zInit);
1555 }
1556 if( blob_size(&comment)==0 ){
1557 blob_zero(&ans);
1558 prompt_user("empty check-in comment. continue (y/N)? ", &ans);
1559 cReply = blob_str(&ans)[0];
1560 if( cReply!='y' && cReply!='Y' ){
1561 fossil_exit(1);
 
 
1562 }
1563 }else{
1564 db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
1565 db_end_transaction(0);
1566 db_begin_transaction();
@@ -1629,13 +1632,10 @@
1629 fossil_fatal("one or more files were converted on your request; "
1630 "please re-test before committing");
1631 }
1632
1633 /* Create the new manifest */
1634 if( blob_size(&comment)==0 ){
1635 blob_append(&comment, "(no comment)", -1);
1636 }
1637 sCiInfo.pComment = &comment;
1638 sCiInfo.pCksum = useCksum ? &cksum1 : 0;
1639 sCiInfo.verifyDate = !allowOlder && !forceFlag;
1640 if( forceDelta ){
1641 blob_zero(&manifest);
1642
--- src/checkin.c
+++ src/checkin.c
@@ -920,11 +920,15 @@
920 pFile = manifest_file_next(pBaseline, 0);
921 nFBcard++;
922 }else{
923 pFile = 0;
924 }
925 if( blob_size(p->pComment)!=0 ){
926 blob_appendf(pOut, "C %F\n", blob_str(p->pComment));
927 }else{
928 blob_append(pOut, "C (no\\scomment)\n", 16);
929 }
930 zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now");
931 blob_appendf(pOut, "D %s\n", zDate);
932 zDate[10] = ' ';
933 db_prepare(&q,
934 "SELECT pathname, uuid, origname, blob.rid, isexe, islink,"
@@ -1537,13 +1541,10 @@
1541 blob_zero(&comment);
1542 blob_read_from_file(&comment, zComFile);
1543 blob_to_utf8_no_bom(&comment, 1);
1544 }else if(dryRunFlag){
1545 blob_zero(&comment);
 
 
 
1546 }else{
1547 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1548 prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
1549 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
1550 blob_zero(&ans);
@@ -1552,15 +1553,17 @@
1553 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
1554 }
1555 free(zInit);
1556 }
1557 if( blob_size(&comment)==0 ){
1558 if( !dryRunFlag ){
1559 blob_zero(&ans);
1560 prompt_user("empty check-in comment. continue (y/N)? ", &ans);
1561 cReply = blob_str(&ans)[0];
1562 if( cReply!='y' && cReply!='Y' ){
1563 fossil_exit(1);
1564 }
1565 }
1566 }else{
1567 db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
1568 db_end_transaction(0);
1569 db_begin_transaction();
@@ -1629,13 +1632,10 @@
1632 fossil_fatal("one or more files were converted on your request; "
1633 "please re-test before committing");
1634 }
1635
1636 /* Create the new manifest */
 
 
 
1637 sCiInfo.pComment = &comment;
1638 sCiInfo.pCksum = useCksum ? &cksum1 : 0;
1639 sCiInfo.verifyDate = !allowOlder && !forceFlag;
1640 if( forceDelta ){
1641 blob_zero(&manifest);
1642

Keyboard Shortcuts

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