Fossil SCM

Add the "FossilOrigin-Name:" footer on all exported comments.

drh 2019-03-15 20:01 mirror-cmd
Commit 051cd3825ed507b2498e2e7e626bda6eea15d3b8ab3918ac2e19521735b1c7b5
1 file changed +8 -4
+8 -4
--- src/export.c
+++ src/export.c
@@ -1010,11 +1010,11 @@
10101010
int iParent; /* Which immediate ancestor is primary. -1 for none */
10111011
Stmt q; /* An SQL query */
10121012
char *zBranch; /* The branch of the check-in */
10131013
int iMark; /* The mark for the check-in */
10141014
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 */
10161016
10171017
pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
10181018
if( pMan==0 ){
10191019
/* Must be a phantom. Return without doing anything, and in particular
10201020
** without creating a mark for this check-in. */
@@ -1069,13 +1069,17 @@
10691069
fprintf(xCmd, "mark :%d\n", iMark);
10701070
fprintf(xCmd, "committer %s <%[email protected]> %lld +0000\n",
10711071
pMan->zUser, pMan->zUser,
10721072
(sqlite3_int64)((pMan->rDate-2440587.5)*86400.0)
10731073
);
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);
10771081
iParent = -1; /* Which ancestor is the primary parent */
10781082
for(i=0; i<pMan->nParent; i++){
10791083
int iOther = gitmirror_find_mark(pMan->azParent[i], 0);
10801084
if( iOther==0 ) continue;
10811085
if( iParent<0 ){
10821086
--- 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

Keyboard Shortcuts

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