Fossil SCM
Add the --integrate option to the "commit" command.
Commit
82f69aa9bfde2d70cd4a8a25267fce27cac62c45
Parent
c6f32a262d590d3…
1 file changed
+12
-1
+12
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -817,10 +817,17 @@ | ||
| 817 | 817 | blob_append(&prompt, |
| 818 | 818 | "# PRIVATE BRANCH: This check-in will be private and will not sync to\n" |
| 819 | 819 | "# repositories.\n" |
| 820 | 820 | "#\n", -1 |
| 821 | 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 | + ); | |
| 822 | 829 | } |
| 823 | 830 | prompt_for_user_comment(pComment, &prompt); |
| 824 | 831 | blob_reset(&prompt); |
| 825 | 832 | } |
| 826 | 833 | |
| @@ -955,10 +962,11 @@ | ||
| 955 | 962 | struct CheckinInfo { |
| 956 | 963 | Blob *pComment; /* Check-in comment text */ |
| 957 | 964 | const char *zMimetype; /* Mimetype of check-in command. May be NULL */ |
| 958 | 965 | int verifyDate; /* Verify that child is younger */ |
| 959 | 966 | int closeFlag; /* Close the branch being committed */ |
| 967 | + int integrateFlag; /* Close merged-in branches */ | |
| 960 | 968 | Blob *pCksum; /* Repository checksum. May be 0 */ |
| 961 | 969 | const char *zDateOvrd; /* Date override. If 0 then use 'now' */ |
| 962 | 970 | const char *zUserOvrd; /* User override. If 0 then use g.zLogin */ |
| 963 | 971 | const char *zBranch; /* Branch name. May be 0 */ |
| 964 | 972 | const char *zColor; /* One-time background color. May be 0 */ |
| @@ -1148,11 +1156,12 @@ | ||
| 1148 | 1156 | } |
| 1149 | 1157 | if( p->closeFlag ){ |
| 1150 | 1158 | blob_appendf(pOut, "T +closed *\n"); |
| 1151 | 1159 | } |
| 1152 | 1160 | 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)"); | |
| 1154 | 1163 | while( db_step(&q)==SQLITE_ROW ){ |
| 1155 | 1164 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1156 | 1165 | int rid = db_column_int(&q, 1); |
| 1157 | 1166 | if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref " |
| 1158 | 1167 | " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){ |
| @@ -1393,10 +1402,11 @@ | ||
| 1393 | 1402 | ** --bgcolor COLOR apply COLOR to this one check-in only |
| 1394 | 1403 | ** --branch NEW-BRANCH-NAME check in to this new branch |
| 1395 | 1404 | ** --branchcolor COLOR apply given COLOR to the branch |
| 1396 | 1405 | ** --close close the branch being committed |
| 1397 | 1406 | ** --delta use a delta manifest in the commit process |
| 1407 | +** --integrate close all merged-in branches | |
| 1398 | 1408 | ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment |
| 1399 | 1409 | ** -M|--message-file FILE read the commit comment from given file |
| 1400 | 1410 | ** --mimetype MIMETYPE mimetype of check-in comment |
| 1401 | 1411 | ** -n|--dry-run If given, display instead of run actions |
| 1402 | 1412 | ** --no-warnings omit all warnings about file contents |
| @@ -1469,10 +1479,11 @@ | ||
| 1469 | 1479 | noWarningFlag = find_option("no-warnings", 0, 0)!=0; |
| 1470 | 1480 | sCiInfo.zBranch = find_option("branch","b",1); |
| 1471 | 1481 | sCiInfo.zColor = find_option("bgcolor",0,1); |
| 1472 | 1482 | sCiInfo.zBrClr = find_option("branchcolor",0,1); |
| 1473 | 1483 | sCiInfo.closeFlag = find_option("close",0,0)!=0; |
| 1484 | + sCiInfo.integrateFlag = find_option("integrate",0,0)!=0; | |
| 1474 | 1485 | sCiInfo.zMimetype = find_option("mimetype",0,1); |
| 1475 | 1486 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1476 | 1487 | if( zTag[0]==0 ) continue; |
| 1477 | 1488 | sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2)); |
| 1478 | 1489 | sCiInfo.azTag[nTag++] = zTag; |
| 1479 | 1490 |
| --- 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 |