Fossil SCM

Add the --integrate option to the "commit" command.

drh 2014-01-09 14:27 trunk
Commit 82f69aa9bfde2d70cd4a8a25267fce27cac62c45
1 file changed +12 -1
+12 -1
--- src/checkin.c
+++ src/checkin.c
@@ -817,10 +817,17 @@
817817
blob_append(&prompt,
818818
"# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
819819
"# repositories.\n"
820820
"#\n", -1
821821
);
822
+ }
823
+ if( p->integrateFlag ){
824
+ blob_append(&prompt,
825
+ "#\n"
826
+ "# All merged-in branches will be closed due to the --integrate flag\n"
827
+ "#\n", -1
828
+ );
822829
}
823830
prompt_for_user_comment(pComment, &prompt);
824831
blob_reset(&prompt);
825832
}
826833
@@ -955,10 +962,11 @@
955962
struct CheckinInfo {
956963
Blob *pComment; /* Check-in comment text */
957964
const char *zMimetype; /* Mimetype of check-in command. May be NULL */
958965
int verifyDate; /* Verify that child is younger */
959966
int closeFlag; /* Close the branch being committed */
967
+ int integrateFlag; /* Close merged-in branches */
960968
Blob *pCksum; /* Repository checksum. May be 0 */
961969
const char *zDateOvrd; /* Date override. If 0 then use 'now' */
962970
const char *zUserOvrd; /* User override. If 0 then use g.zLogin */
963971
const char *zBranch; /* Branch name. May be 0 */
964972
const char *zColor; /* One-time background color. May be 0 */
@@ -1148,11 +1156,12 @@
11481156
}
11491157
if( p->closeFlag ){
11501158
blob_appendf(pOut, "T +closed *\n");
11511159
}
11521160
db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1153
- " WHERE id=-4 ORDER BY 1");
1161
+ " WHERE id %s ORDER BY 1",
1162
+ p->integrateFlag ? "IN(0,-4)" : "=(-4)");
11541163
while( db_step(&q)==SQLITE_ROW ){
11551164
const char *zIntegrateUuid = db_column_text(&q, 0);
11561165
int rid = db_column_int(&q, 1);
11571166
if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref "
11581167
" WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){
@@ -1393,10 +1402,11 @@
13931402
** --bgcolor COLOR apply COLOR to this one check-in only
13941403
** --branch NEW-BRANCH-NAME check in to this new branch
13951404
** --branchcolor COLOR apply given COLOR to the branch
13961405
** --close close the branch being committed
13971406
** --delta use a delta manifest in the commit process
1407
+** --integrate close all merged-in branches
13981408
** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment
13991409
** -M|--message-file FILE read the commit comment from given file
14001410
** --mimetype MIMETYPE mimetype of check-in comment
14011411
** -n|--dry-run If given, display instead of run actions
14021412
** --no-warnings omit all warnings about file contents
@@ -1469,10 +1479,11 @@
14691479
noWarningFlag = find_option("no-warnings", 0, 0)!=0;
14701480
sCiInfo.zBranch = find_option("branch","b",1);
14711481
sCiInfo.zColor = find_option("bgcolor",0,1);
14721482
sCiInfo.zBrClr = find_option("branchcolor",0,1);
14731483
sCiInfo.closeFlag = find_option("close",0,0)!=0;
1484
+ sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
14741485
sCiInfo.zMimetype = find_option("mimetype",0,1);
14751486
while( (zTag = find_option("tag",0,1))!=0 ){
14761487
if( zTag[0]==0 ) continue;
14771488
sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
14781489
sCiInfo.azTag[nTag++] = zTag;
14791490
--- src/checkin.c
+++ src/checkin.c
@@ -817,10 +817,17 @@
817 blob_append(&prompt,
818 "# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
819 "# repositories.\n"
820 "#\n", -1
821 );
 
 
 
 
 
 
 
822 }
823 prompt_for_user_comment(pComment, &prompt);
824 blob_reset(&prompt);
825 }
826
@@ -955,10 +962,11 @@
955 struct CheckinInfo {
956 Blob *pComment; /* Check-in comment text */
957 const char *zMimetype; /* Mimetype of check-in command. May be NULL */
958 int verifyDate; /* Verify that child is younger */
959 int closeFlag; /* Close the branch being committed */
 
960 Blob *pCksum; /* Repository checksum. May be 0 */
961 const char *zDateOvrd; /* Date override. If 0 then use 'now' */
962 const char *zUserOvrd; /* User override. If 0 then use g.zLogin */
963 const char *zBranch; /* Branch name. May be 0 */
964 const char *zColor; /* One-time background color. May be 0 */
@@ -1148,11 +1156,12 @@
1148 }
1149 if( p->closeFlag ){
1150 blob_appendf(pOut, "T +closed *\n");
1151 }
1152 db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1153 " WHERE id=-4 ORDER BY 1");
 
1154 while( db_step(&q)==SQLITE_ROW ){
1155 const char *zIntegrateUuid = db_column_text(&q, 0);
1156 int rid = db_column_int(&q, 1);
1157 if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref "
1158 " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){
@@ -1393,10 +1402,11 @@
1393 ** --bgcolor COLOR apply COLOR to this one check-in only
1394 ** --branch NEW-BRANCH-NAME check in to this new branch
1395 ** --branchcolor COLOR apply given COLOR to the branch
1396 ** --close close the branch being committed
1397 ** --delta use a delta manifest in the commit process
 
1398 ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment
1399 ** -M|--message-file FILE read the commit comment from given file
1400 ** --mimetype MIMETYPE mimetype of check-in comment
1401 ** -n|--dry-run If given, display instead of run actions
1402 ** --no-warnings omit all warnings about file contents
@@ -1469,10 +1479,11 @@
1469 noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1470 sCiInfo.zBranch = find_option("branch","b",1);
1471 sCiInfo.zColor = find_option("bgcolor",0,1);
1472 sCiInfo.zBrClr = find_option("branchcolor",0,1);
1473 sCiInfo.closeFlag = find_option("close",0,0)!=0;
 
1474 sCiInfo.zMimetype = find_option("mimetype",0,1);
1475 while( (zTag = find_option("tag",0,1))!=0 ){
1476 if( zTag[0]==0 ) continue;
1477 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
1478 sCiInfo.azTag[nTag++] = zTag;
1479
--- src/checkin.c
+++ src/checkin.c
@@ -817,10 +817,17 @@
817 blob_append(&prompt,
818 "# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
819 "# repositories.\n"
820 "#\n", -1
821 );
822 }
823 if( p->integrateFlag ){
824 blob_append(&prompt,
825 "#\n"
826 "# All merged-in branches will be closed due to the --integrate flag\n"
827 "#\n", -1
828 );
829 }
830 prompt_for_user_comment(pComment, &prompt);
831 blob_reset(&prompt);
832 }
833
@@ -955,10 +962,11 @@
962 struct CheckinInfo {
963 Blob *pComment; /* Check-in comment text */
964 const char *zMimetype; /* Mimetype of check-in command. May be NULL */
965 int verifyDate; /* Verify that child is younger */
966 int closeFlag; /* Close the branch being committed */
967 int integrateFlag; /* Close merged-in branches */
968 Blob *pCksum; /* Repository checksum. May be 0 */
969 const char *zDateOvrd; /* Date override. If 0 then use 'now' */
970 const char *zUserOvrd; /* User override. If 0 then use g.zLogin */
971 const char *zBranch; /* Branch name. May be 0 */
972 const char *zColor; /* One-time background color. May be 0 */
@@ -1148,11 +1156,12 @@
1156 }
1157 if( p->closeFlag ){
1158 blob_appendf(pOut, "T +closed *\n");
1159 }
1160 db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid"
1161 " WHERE id %s ORDER BY 1",
1162 p->integrateFlag ? "IN(0,-4)" : "=(-4)");
1163 while( db_step(&q)==SQLITE_ROW ){
1164 const char *zIntegrateUuid = db_column_text(&q, 0);
1165 int rid = db_column_int(&q, 1);
1166 if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref "
1167 " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){
@@ -1393,10 +1402,11 @@
1402 ** --bgcolor COLOR apply COLOR to this one check-in only
1403 ** --branch NEW-BRANCH-NAME check in to this new branch
1404 ** --branchcolor COLOR apply given COLOR to the branch
1405 ** --close close the branch being committed
1406 ** --delta use a delta manifest in the commit process
1407 ** --integrate close all merged-in branches
1408 ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment
1409 ** -M|--message-file FILE read the commit comment from given file
1410 ** --mimetype MIMETYPE mimetype of check-in comment
1411 ** -n|--dry-run If given, display instead of run actions
1412 ** --no-warnings omit all warnings about file contents
@@ -1469,10 +1479,11 @@
1479 noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1480 sCiInfo.zBranch = find_option("branch","b",1);
1481 sCiInfo.zColor = find_option("bgcolor",0,1);
1482 sCiInfo.zBrClr = find_option("branchcolor",0,1);
1483 sCiInfo.closeFlag = find_option("close",0,0)!=0;
1484 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
1485 sCiInfo.zMimetype = find_option("mimetype",0,1);
1486 while( (zTag = find_option("tag",0,1))!=0 ){
1487 if( zTag[0]==0 ) continue;
1488 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
1489 sCiInfo.azTag[nTag++] = zTag;
1490

Keyboard Shortcuts

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