Fossil SCM

In git-export, when the versioned manifest setting changes, be sure to delete manifest files that have become obsolete.

drh 2025-03-13 00:43 versioned-manifest-setting
Commit 175009a5be9e31a0b5b33bb232c446927a15f91941512a21d1f82dcd08ac6726
1 file changed +8
--- src/export.c
+++ src/export.c
@@ -1089,10 +1089,11 @@
10891089
int nErr = 0; /* Number of errors */
10901090
int bPhantomOk; /* True if phantom files should be ignored */
10911091
char buf[24];
10921092
char *zEmail; /* Contact info for Git committer field */
10931093
int fManifest; /* Should the manifest files be included? */
1094
+ int fPManifest = 0; /* OR of the manifest files for all parents */
10941095
10951096
pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
10961097
if( pMan==0 ){
10971098
/* Must be a phantom. Return without doing anything, and in particular
10981099
** without creating a mark for this check-in. */
@@ -1215,10 +1216,11 @@
12151216
blob_reset(&comment);
12161217
iParent = -1; /* Which ancestor is the primary parent */
12171218
for(i=0; i<pMan->nParent; i++){
12181219
char *zOther = gitmirror_find_mark(pMan->azParent[i],0,0);
12191220
if( zOther==0 ) continue;
1221
+ fPManifest |= db_get_manifest_setting(pMan->azParent[i]);
12201222
if( iParent<0 ){
12211223
iParent = i;
12221224
fprintf(xCmd, "from %s\n", zOther);
12231225
}else{
12241226
fprintf(xCmd, "merge %s\n", zOther);
@@ -1279,22 +1281,28 @@
12791281
content_get(rid, &manifest);
12801282
sterilize_manifest(&manifest, CFTYPE_MANIFEST);
12811283
fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
12821284
blob_strlen(&manifest), blob_str(&manifest));
12831285
blob_reset(&manifest);
1286
+ }else if( fPManifest & MFESTFLG_RAW ){
1287
+ fprintf(xCmd, "D manifest\n");
12841288
}
12851289
if( fManifest & MFESTFLG_UUID ){
12861290
int n = (int)strlen(zUuid);
12871291
fprintf(xCmd,"M 100644 inline manifest.uuid\ndata %d\n%s\n\n", n+1, zUuid);
1292
+ }else if( fPManifest & MFESTFLG_UUID ){
1293
+ fprintf(xCmd, "D manifest.uuid\n");
12881294
}
12891295
if( fManifest & MFESTFLG_TAGS ){
12901296
Blob tagslist;
12911297
blob_init(&tagslist, 0, 0);
12921298
get_checkin_taglist(rid, &tagslist);
12931299
fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
12941300
blob_strlen(&tagslist), blob_str(&tagslist));
12951301
blob_reset(&tagslist);
1302
+ }else if( fPManifest & MFESTFLG_TAGS ){
1303
+ fprintf(xCmd, "D manifest.tags\n");
12961304
}
12971305
12981306
/* The check-in is finished, so decrement the counter */
12991307
(*pnLimit)--;
13001308
return 0;
13011309
--- src/export.c
+++ src/export.c
@@ -1089,10 +1089,11 @@
1089 int nErr = 0; /* Number of errors */
1090 int bPhantomOk; /* True if phantom files should be ignored */
1091 char buf[24];
1092 char *zEmail; /* Contact info for Git committer field */
1093 int fManifest; /* Should the manifest files be included? */
 
1094
1095 pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
1096 if( pMan==0 ){
1097 /* Must be a phantom. Return without doing anything, and in particular
1098 ** without creating a mark for this check-in. */
@@ -1215,10 +1216,11 @@
1215 blob_reset(&comment);
1216 iParent = -1; /* Which ancestor is the primary parent */
1217 for(i=0; i<pMan->nParent; i++){
1218 char *zOther = gitmirror_find_mark(pMan->azParent[i],0,0);
1219 if( zOther==0 ) continue;
 
1220 if( iParent<0 ){
1221 iParent = i;
1222 fprintf(xCmd, "from %s\n", zOther);
1223 }else{
1224 fprintf(xCmd, "merge %s\n", zOther);
@@ -1279,22 +1281,28 @@
1279 content_get(rid, &manifest);
1280 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
1281 fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
1282 blob_strlen(&manifest), blob_str(&manifest));
1283 blob_reset(&manifest);
 
 
1284 }
1285 if( fManifest & MFESTFLG_UUID ){
1286 int n = (int)strlen(zUuid);
1287 fprintf(xCmd,"M 100644 inline manifest.uuid\ndata %d\n%s\n\n", n+1, zUuid);
 
 
1288 }
1289 if( fManifest & MFESTFLG_TAGS ){
1290 Blob tagslist;
1291 blob_init(&tagslist, 0, 0);
1292 get_checkin_taglist(rid, &tagslist);
1293 fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
1294 blob_strlen(&tagslist), blob_str(&tagslist));
1295 blob_reset(&tagslist);
 
 
1296 }
1297
1298 /* The check-in is finished, so decrement the counter */
1299 (*pnLimit)--;
1300 return 0;
1301
--- src/export.c
+++ src/export.c
@@ -1089,10 +1089,11 @@
1089 int nErr = 0; /* Number of errors */
1090 int bPhantomOk; /* True if phantom files should be ignored */
1091 char buf[24];
1092 char *zEmail; /* Contact info for Git committer field */
1093 int fManifest; /* Should the manifest files be included? */
1094 int fPManifest = 0; /* OR of the manifest files for all parents */
1095
1096 pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
1097 if( pMan==0 ){
1098 /* Must be a phantom. Return without doing anything, and in particular
1099 ** without creating a mark for this check-in. */
@@ -1215,10 +1216,11 @@
1216 blob_reset(&comment);
1217 iParent = -1; /* Which ancestor is the primary parent */
1218 for(i=0; i<pMan->nParent; i++){
1219 char *zOther = gitmirror_find_mark(pMan->azParent[i],0,0);
1220 if( zOther==0 ) continue;
1221 fPManifest |= db_get_manifest_setting(pMan->azParent[i]);
1222 if( iParent<0 ){
1223 iParent = i;
1224 fprintf(xCmd, "from %s\n", zOther);
1225 }else{
1226 fprintf(xCmd, "merge %s\n", zOther);
@@ -1279,22 +1281,28 @@
1281 content_get(rid, &manifest);
1282 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
1283 fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
1284 blob_strlen(&manifest), blob_str(&manifest));
1285 blob_reset(&manifest);
1286 }else if( fPManifest & MFESTFLG_RAW ){
1287 fprintf(xCmd, "D manifest\n");
1288 }
1289 if( fManifest & MFESTFLG_UUID ){
1290 int n = (int)strlen(zUuid);
1291 fprintf(xCmd,"M 100644 inline manifest.uuid\ndata %d\n%s\n\n", n+1, zUuid);
1292 }else if( fPManifest & MFESTFLG_UUID ){
1293 fprintf(xCmd, "D manifest.uuid\n");
1294 }
1295 if( fManifest & MFESTFLG_TAGS ){
1296 Blob tagslist;
1297 blob_init(&tagslist, 0, 0);
1298 get_checkin_taglist(rid, &tagslist);
1299 fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
1300 blob_strlen(&tagslist), blob_str(&tagslist));
1301 blob_reset(&tagslist);
1302 }else if( fPManifest & MFESTFLG_TAGS ){
1303 fprintf(xCmd, "D manifest.tags\n");
1304 }
1305
1306 /* The check-in is finished, so decrement the counter */
1307 (*pnLimit)--;
1308 return 0;
1309

Keyboard Shortcuts

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