Fossil SCM
Add the "FossilOrigin-Name:" footer on all exported comments.
Commit
051cd3825ed507b2498e2e7e626bda6eea15d3b8ab3918ac2e19521735b1c7b5
Parent
2faec6b7481520a…
1 file changed
+8
-4
+8
-4
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1010,11 +1010,11 @@ | ||
| 1010 | 1010 | int iParent; /* Which immediate ancestor is primary. -1 for none */ |
| 1011 | 1011 | Stmt q; /* An SQL query */ |
| 1012 | 1012 | char *zBranch; /* The branch of the check-in */ |
| 1013 | 1013 | int iMark; /* The mark for the check-in */ |
| 1014 | 1014 | Blob sql; /* String of SQL for part of the query */ |
| 1015 | - char *zCom; /* The check-in comment */ | |
| 1015 | + Blob comment; /* The comment text for the check-in */ | |
| 1016 | 1016 | |
| 1017 | 1017 | pMan = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1018 | 1018 | if( pMan==0 ){ |
| 1019 | 1019 | /* Must be a phantom. Return without doing anything, and in particular |
| 1020 | 1020 | ** without creating a mark for this check-in. */ |
| @@ -1069,13 +1069,17 @@ | ||
| 1069 | 1069 | fprintf(xCmd, "mark :%d\n", iMark); |
| 1070 | 1070 | fprintf(xCmd, "committer %s <%[email protected]> %lld +0000\n", |
| 1071 | 1071 | pMan->zUser, pMan->zUser, |
| 1072 | 1072 | (sqlite3_int64)((pMan->rDate-2440587.5)*86400.0) |
| 1073 | 1073 | ); |
| 1074 | - zCom = pMan->zComment; | |
| 1075 | - if( zCom==0 ) zCom = "(no comment)"; | |
| 1076 | - fprintf(xCmd, "data %d\n%s\n", (int)strlen(zCom), zCom); | |
| 1074 | + blob_init(&comment, pMan->zComment, -1); | |
| 1075 | + if( blob_size(&comment)==0 ){ | |
| 1076 | + blob_append(&comment, "(no comment)", -1); | |
| 1077 | + } | |
| 1078 | + blob_appendf(&comment, "\n\nFossilOrigin-Name: %s", zUuid); | |
| 1079 | + fprintf(xCmd, "data %d\n%s\n", blob_size(&comment), blob_str(&comment)); | |
| 1080 | + blob_reset(&comment); | |
| 1077 | 1081 | iParent = -1; /* Which ancestor is the primary parent */ |
| 1078 | 1082 | for(i=0; i<pMan->nParent; i++){ |
| 1079 | 1083 | int iOther = gitmirror_find_mark(pMan->azParent[i], 0); |
| 1080 | 1084 | if( iOther==0 ) continue; |
| 1081 | 1085 | if( iParent<0 ){ |
| 1082 | 1086 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1010,11 +1010,11 @@ | |
| 1010 | int iParent; /* Which immediate ancestor is primary. -1 for none */ |
| 1011 | Stmt q; /* An SQL query */ |
| 1012 | char *zBranch; /* The branch of the check-in */ |
| 1013 | int iMark; /* The mark for the check-in */ |
| 1014 | Blob sql; /* String of SQL for part of the query */ |
| 1015 | char *zCom; /* The check-in comment */ |
| 1016 | |
| 1017 | pMan = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1018 | if( pMan==0 ){ |
| 1019 | /* Must be a phantom. Return without doing anything, and in particular |
| 1020 | ** without creating a mark for this check-in. */ |
| @@ -1069,13 +1069,17 @@ | |
| 1069 | fprintf(xCmd, "mark :%d\n", iMark); |
| 1070 | fprintf(xCmd, "committer %s <%[email protected]> %lld +0000\n", |
| 1071 | pMan->zUser, pMan->zUser, |
| 1072 | (sqlite3_int64)((pMan->rDate-2440587.5)*86400.0) |
| 1073 | ); |
| 1074 | zCom = pMan->zComment; |
| 1075 | if( zCom==0 ) zCom = "(no comment)"; |
| 1076 | fprintf(xCmd, "data %d\n%s\n", (int)strlen(zCom), zCom); |
| 1077 | iParent = -1; /* Which ancestor is the primary parent */ |
| 1078 | for(i=0; i<pMan->nParent; i++){ |
| 1079 | int iOther = gitmirror_find_mark(pMan->azParent[i], 0); |
| 1080 | if( iOther==0 ) continue; |
| 1081 | if( iParent<0 ){ |
| 1082 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1010,11 +1010,11 @@ | |
| 1010 | int iParent; /* Which immediate ancestor is primary. -1 for none */ |
| 1011 | Stmt q; /* An SQL query */ |
| 1012 | char *zBranch; /* The branch of the check-in */ |
| 1013 | int iMark; /* The mark for the check-in */ |
| 1014 | Blob sql; /* String of SQL for part of the query */ |
| 1015 | Blob comment; /* The comment text for the check-in */ |
| 1016 | |
| 1017 | pMan = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1018 | if( pMan==0 ){ |
| 1019 | /* Must be a phantom. Return without doing anything, and in particular |
| 1020 | ** without creating a mark for this check-in. */ |
| @@ -1069,13 +1069,17 @@ | |
| 1069 | fprintf(xCmd, "mark :%d\n", iMark); |
| 1070 | fprintf(xCmd, "committer %s <%[email protected]> %lld +0000\n", |
| 1071 | pMan->zUser, pMan->zUser, |
| 1072 | (sqlite3_int64)((pMan->rDate-2440587.5)*86400.0) |
| 1073 | ); |
| 1074 | blob_init(&comment, pMan->zComment, -1); |
| 1075 | if( blob_size(&comment)==0 ){ |
| 1076 | blob_append(&comment, "(no comment)", -1); |
| 1077 | } |
| 1078 | blob_appendf(&comment, "\n\nFossilOrigin-Name: %s", zUuid); |
| 1079 | fprintf(xCmd, "data %d\n%s\n", blob_size(&comment), blob_str(&comment)); |
| 1080 | blob_reset(&comment); |
| 1081 | iParent = -1; /* Which ancestor is the primary parent */ |
| 1082 | for(i=0; i<pMan->nParent; i++){ |
| 1083 | int iOther = gitmirror_find_mark(pMan->azParent[i], 0); |
| 1084 | if( iOther==0 ) continue; |
| 1085 | if( iParent<0 ){ |
| 1086 |