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.
Commit
dfd8962ff260c63b98b252d7da260e8c4136c824
Parent
52bf9059350b597…
1 file changed
+12
-12
+12
-12
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -920,11 +920,15 @@ | ||
| 920 | 920 | pFile = manifest_file_next(pBaseline, 0); |
| 921 | 921 | nFBcard++; |
| 922 | 922 | }else{ |
| 923 | 923 | pFile = 0; |
| 924 | 924 | } |
| 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 | + } | |
| 926 | 930 | zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now"); |
| 927 | 931 | blob_appendf(pOut, "D %s\n", zDate); |
| 928 | 932 | zDate[10] = ' '; |
| 929 | 933 | db_prepare(&q, |
| 930 | 934 | "SELECT pathname, uuid, origname, blob.rid, isexe, islink," |
| @@ -1537,13 +1541,10 @@ | ||
| 1537 | 1541 | blob_zero(&comment); |
| 1538 | 1542 | blob_read_from_file(&comment, zComFile); |
| 1539 | 1543 | blob_to_utf8_no_bom(&comment, 1); |
| 1540 | 1544 | }else if(dryRunFlag){ |
| 1541 | 1545 | blob_zero(&comment); |
| 1542 | - blob_append(&comment, "Dry-run mode - no comment provided.", -1) | |
| 1543 | - /* Comment needed to avoid downstream assertion. */ | |
| 1544 | - ; | |
| 1545 | 1546 | }else{ |
| 1546 | 1547 | char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'"); |
| 1547 | 1548 | prepare_commit_comment(&comment, zInit, &sCiInfo, vid); |
| 1548 | 1549 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 1549 | 1550 | blob_zero(&ans); |
| @@ -1552,15 +1553,17 @@ | ||
| 1552 | 1553 | if( cReply!='y' && cReply!='Y' ) fossil_exit(1);; |
| 1553 | 1554 | } |
| 1554 | 1555 | free(zInit); |
| 1555 | 1556 | } |
| 1556 | 1557 | 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 | + } | |
| 1562 | 1565 | } |
| 1563 | 1566 | }else{ |
| 1564 | 1567 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 1565 | 1568 | db_end_transaction(0); |
| 1566 | 1569 | db_begin_transaction(); |
| @@ -1629,13 +1632,10 @@ | ||
| 1629 | 1632 | fossil_fatal("one or more files were converted on your request; " |
| 1630 | 1633 | "please re-test before committing"); |
| 1631 | 1634 | } |
| 1632 | 1635 | |
| 1633 | 1636 | /* Create the new manifest */ |
| 1634 | - if( blob_size(&comment)==0 ){ | |
| 1635 | - blob_append(&comment, "(no comment)", -1); | |
| 1636 | - } | |
| 1637 | 1637 | sCiInfo.pComment = &comment; |
| 1638 | 1638 | sCiInfo.pCksum = useCksum ? &cksum1 : 0; |
| 1639 | 1639 | sCiInfo.verifyDate = !allowOlder && !forceFlag; |
| 1640 | 1640 | if( forceDelta ){ |
| 1641 | 1641 | blob_zero(&manifest); |
| 1642 | 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 | 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 |