Fossil SCM
Don't use a separate Control artifact for "merge --integrate" any more
Commit
daa8eb95e4b13169b0125715df0142293525199d
Parent
12c30d33d477c81…
2 files changed
+15
-25
+11
-3
+15
-25
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1049,10 +1049,22 @@ | ||
| 1049 | 1049 | } |
| 1050 | 1050 | if( zColor && zColor[0] ){ |
| 1051 | 1051 | /* One-time background color */ |
| 1052 | 1052 | blob_appendf(pOut, "T +bgcolor * %F\n", zColor); |
| 1053 | 1053 | } |
| 1054 | + db_prepare(&q2, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" | |
| 1055 | + " WHERE id=-4 ORDER BY 1"); | |
| 1056 | + while( db_step(&q2)==SQLITE_ROW ){ | |
| 1057 | + const char *zIntegrateUuid = db_column_text(&q2, 0); | |
| 1058 | + int rid = db_column_int(&q2, 1); | |
| 1059 | + if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref " | |
| 1060 | + " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){ | |
| 1061 | + blob_appendf(pOut, "T +closed %s\n", zIntegrateUuid); | |
| 1062 | + } | |
| 1063 | + } | |
| 1064 | + db_finalize(&q2); | |
| 1065 | + | |
| 1054 | 1066 | if( p->azTag ){ |
| 1055 | 1067 | for(i=0; p->azTag[i]; i++){ |
| 1056 | 1068 | /* Add a symbolic tag to this check-in. The tag names have already |
| 1057 | 1069 | ** been sorted and converted using the %F format */ |
| 1058 | 1070 | assert( i==0 || strcmp(p->azTag[i-1], p->azTag[i])<=0 ); |
| @@ -1714,36 +1726,14 @@ | ||
| 1714 | 1726 | |
| 1715 | 1727 | db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1716 | 1728 | " WHERE id=-4"); |
| 1717 | 1729 | while( db_step(&q)==SQLITE_ROW ){ |
| 1718 | 1730 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1719 | - int rid = db_column_int(&q, 1); | |
| 1720 | - if( !is_a_leaf(rid) ){ | |
| 1721 | - fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid); | |
| 1731 | + if( is_a_leaf(db_column_int(&q, 1)) ){ | |
| 1732 | + fossil_print("Closed: %s\n", zIntegrateUuid); | |
| 1722 | 1733 | }else{ |
| 1723 | - if (!db_exists("SELECT 1 FROM tagxref " | |
| 1724 | - " WHERE tagid=%d AND rid=%d AND tagtype>0", | |
| 1725 | - TAG_CLOSED, rid) | |
| 1726 | - ){ | |
| 1727 | - Blob ctrl; | |
| 1728 | - Blob cksum; | |
| 1729 | - char *zDate; | |
| 1730 | - int nrid; | |
| 1731 | - | |
| 1732 | - blob_zero(&ctrl); | |
| 1733 | - zDate = date_in_standard_format(sCiInfo.zDateOvrd ? sCiInfo.zDateOvrd : "now"); | |
| 1734 | - blob_appendf(&ctrl, "C Merge\\s--integrate\\sinto\\s[%S]\n", zUuid); | |
| 1735 | - blob_appendf(&ctrl, "D %s\n", zDate); | |
| 1736 | - blob_appendf(&ctrl, "T +closed %s\n", zIntegrateUuid); | |
| 1737 | - blob_appendf(&ctrl, "U %F\n", sCiInfo.zUserOvrd ? sCiInfo.zUserOvrd : g.zLogin); | |
| 1738 | - md5sum_blob(&ctrl, &cksum); | |
| 1739 | - blob_appendf(&ctrl, "Z %b\n", &cksum); | |
| 1740 | - nrid = content_put(&ctrl); | |
| 1741 | - manifest_crosslink(nrid, &ctrl); | |
| 1742 | - assert( blob_is_reset(&ctrl) ); | |
| 1743 | - } | |
| 1744 | - fossil_print("Closed: %s\n", zIntegrateUuid); | |
| 1734 | + fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid); | |
| 1745 | 1735 | } |
| 1746 | 1736 | } |
| 1747 | 1737 | db_finalize(&q); |
| 1748 | 1738 | |
| 1749 | 1739 | fossil_print("New_Version: %s\n", zUuid); |
| 1750 | 1740 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1049,10 +1049,22 @@ | |
| 1049 | } |
| 1050 | if( zColor && zColor[0] ){ |
| 1051 | /* One-time background color */ |
| 1052 | blob_appendf(pOut, "T +bgcolor * %F\n", zColor); |
| 1053 | } |
| 1054 | if( p->azTag ){ |
| 1055 | for(i=0; p->azTag[i]; i++){ |
| 1056 | /* Add a symbolic tag to this check-in. The tag names have already |
| 1057 | ** been sorted and converted using the %F format */ |
| 1058 | assert( i==0 || strcmp(p->azTag[i-1], p->azTag[i])<=0 ); |
| @@ -1714,36 +1726,14 @@ | |
| 1714 | |
| 1715 | db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1716 | " WHERE id=-4"); |
| 1717 | while( db_step(&q)==SQLITE_ROW ){ |
| 1718 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1719 | int rid = db_column_int(&q, 1); |
| 1720 | if( !is_a_leaf(rid) ){ |
| 1721 | fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid); |
| 1722 | }else{ |
| 1723 | if (!db_exists("SELECT 1 FROM tagxref " |
| 1724 | " WHERE tagid=%d AND rid=%d AND tagtype>0", |
| 1725 | TAG_CLOSED, rid) |
| 1726 | ){ |
| 1727 | Blob ctrl; |
| 1728 | Blob cksum; |
| 1729 | char *zDate; |
| 1730 | int nrid; |
| 1731 | |
| 1732 | blob_zero(&ctrl); |
| 1733 | zDate = date_in_standard_format(sCiInfo.zDateOvrd ? sCiInfo.zDateOvrd : "now"); |
| 1734 | blob_appendf(&ctrl, "C Merge\\s--integrate\\sinto\\s[%S]\n", zUuid); |
| 1735 | blob_appendf(&ctrl, "D %s\n", zDate); |
| 1736 | blob_appendf(&ctrl, "T +closed %s\n", zIntegrateUuid); |
| 1737 | blob_appendf(&ctrl, "U %F\n", sCiInfo.zUserOvrd ? sCiInfo.zUserOvrd : g.zLogin); |
| 1738 | md5sum_blob(&ctrl, &cksum); |
| 1739 | blob_appendf(&ctrl, "Z %b\n", &cksum); |
| 1740 | nrid = content_put(&ctrl); |
| 1741 | manifest_crosslink(nrid, &ctrl); |
| 1742 | assert( blob_is_reset(&ctrl) ); |
| 1743 | } |
| 1744 | fossil_print("Closed: %s\n", zIntegrateUuid); |
| 1745 | } |
| 1746 | } |
| 1747 | db_finalize(&q); |
| 1748 | |
| 1749 | fossil_print("New_Version: %s\n", zUuid); |
| 1750 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1049,10 +1049,22 @@ | |
| 1049 | } |
| 1050 | if( zColor && zColor[0] ){ |
| 1051 | /* One-time background color */ |
| 1052 | blob_appendf(pOut, "T +bgcolor * %F\n", zColor); |
| 1053 | } |
| 1054 | db_prepare(&q2, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1055 | " WHERE id=-4 ORDER BY 1"); |
| 1056 | while( db_step(&q2)==SQLITE_ROW ){ |
| 1057 | const char *zIntegrateUuid = db_column_text(&q2, 0); |
| 1058 | int rid = db_column_int(&q2, 1); |
| 1059 | if( is_a_leaf(rid) && !db_exists("SELECT 1 FROM tagxref " |
| 1060 | " WHERE tagid=%d AND rid=%d AND tagtype>0", TAG_CLOSED, rid)){ |
| 1061 | blob_appendf(pOut, "T +closed %s\n", zIntegrateUuid); |
| 1062 | } |
| 1063 | } |
| 1064 | db_finalize(&q2); |
| 1065 | |
| 1066 | if( p->azTag ){ |
| 1067 | for(i=0; p->azTag[i]; i++){ |
| 1068 | /* Add a symbolic tag to this check-in. The tag names have already |
| 1069 | ** been sorted and converted using the %F format */ |
| 1070 | assert( i==0 || strcmp(p->azTag[i-1], p->azTag[i])<=0 ); |
| @@ -1714,36 +1726,14 @@ | |
| 1726 | |
| 1727 | db_prepare(&q, "SELECT uuid,merge FROM vmerge JOIN blob ON merge=rid" |
| 1728 | " WHERE id=-4"); |
| 1729 | while( db_step(&q)==SQLITE_ROW ){ |
| 1730 | const char *zIntegrateUuid = db_column_text(&q, 0); |
| 1731 | if( is_a_leaf(db_column_int(&q, 1)) ){ |
| 1732 | fossil_print("Closed: %s\n", zIntegrateUuid); |
| 1733 | }else{ |
| 1734 | fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid); |
| 1735 | } |
| 1736 | } |
| 1737 | db_finalize(&q); |
| 1738 | |
| 1739 | fossil_print("New_Version: %s\n", zUuid); |
| 1740 |
+11
-3
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -258,13 +258,21 @@ | ||
| 258 | 258 | if( !forceFlag && mid==pid ){ |
| 259 | 259 | fossil_print("Merge skipped because it is a no-op. " |
| 260 | 260 | " Use --force to override.\n"); |
| 261 | 261 | return; |
| 262 | 262 | } |
| 263 | - if( integrateFlag && !is_a_leaf(mid) ){ | |
| 264 | - fossil_warning("ignoring --integrate: %s is not a leaf", g.argv[2]); | |
| 265 | - integrateFlag = 0; | |
| 263 | + if( integrateFlag ){ | |
| 264 | + if( db_exists("SELECT 1 FROM vmerge WHERE id=-4")) { | |
| 265 | + /* Fossil earlier than [55cacfcace] cannot handle this, | |
| 266 | + * therefore disallow it. */ | |
| 267 | + fossil_fatal("Integration of another branch already in progress." | |
| 268 | + " Commit or Undo needed first", g.argv[2]); | |
| 269 | + } | |
| 270 | + if( !is_a_leaf(mid) ){ | |
| 271 | + fossil_warning("ignoring --integrate: %s is not a leaf", g.argv[2]); | |
| 272 | + integrateFlag = 0; | |
| 273 | + } | |
| 266 | 274 | } |
| 267 | 275 | if( verboseFlag ){ |
| 268 | 276 | print_checkin_description(mid, 12, integrateFlag?"integrate:":"merge-from:"); |
| 269 | 277 | print_checkin_description(pid, 12, "baseline:"); |
| 270 | 278 | } |
| 271 | 279 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -258,13 +258,21 @@ | |
| 258 | if( !forceFlag && mid==pid ){ |
| 259 | fossil_print("Merge skipped because it is a no-op. " |
| 260 | " Use --force to override.\n"); |
| 261 | return; |
| 262 | } |
| 263 | if( integrateFlag && !is_a_leaf(mid) ){ |
| 264 | fossil_warning("ignoring --integrate: %s is not a leaf", g.argv[2]); |
| 265 | integrateFlag = 0; |
| 266 | } |
| 267 | if( verboseFlag ){ |
| 268 | print_checkin_description(mid, 12, integrateFlag?"integrate:":"merge-from:"); |
| 269 | print_checkin_description(pid, 12, "baseline:"); |
| 270 | } |
| 271 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -258,13 +258,21 @@ | |
| 258 | if( !forceFlag && mid==pid ){ |
| 259 | fossil_print("Merge skipped because it is a no-op. " |
| 260 | " Use --force to override.\n"); |
| 261 | return; |
| 262 | } |
| 263 | if( integrateFlag ){ |
| 264 | if( db_exists("SELECT 1 FROM vmerge WHERE id=-4")) { |
| 265 | /* Fossil earlier than [55cacfcace] cannot handle this, |
| 266 | * therefore disallow it. */ |
| 267 | fossil_fatal("Integration of another branch already in progress." |
| 268 | " Commit or Undo needed first", g.argv[2]); |
| 269 | } |
| 270 | if( !is_a_leaf(mid) ){ |
| 271 | fossil_warning("ignoring --integrate: %s is not a leaf", g.argv[2]); |
| 272 | integrateFlag = 0; |
| 273 | } |
| 274 | } |
| 275 | if( verboseFlag ){ |
| 276 | print_checkin_description(mid, 12, integrateFlag?"integrate:":"merge-from:"); |
| 277 | print_checkin_description(pid, 12, "baseline:"); |
| 278 | } |
| 279 |