Fossil SCM

fix import handling of git repositories with renamed files Reported by James Cook in [forum:2b857ded1b]: renamed files were shown as a deletion and an addition. This was because the optional 3rd and 4th field in the manifest's F card to indicate renames were omitted, despite having parsed these data from the git fast-export marks.

mark 2023-06-18 03:12 trunk
Commit 7ab1e118503110495ff73f02163d3ffe1ab091bc40ad0292f0ffa53de62851d3
1 file changed +7 -3
+7 -3
--- src/import.c
+++ src/import.c
@@ -296,16 +296,20 @@
296296
for(i=0; i<gg.nFile; i++){
297297
const char *zUuid = gg.aFile[i].zUuid;
298298
if( zUuid==0 ) continue;
299299
blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid);
300300
if( gg.aFile[i].isExe ){
301
- blob_append(&record, " x\n", 3);
301
+ blob_append(&record, " x", 2);
302302
}else if( gg.aFile[i].isLink ){
303
- blob_append(&record, " l\n", 3);
303
+ blob_append(&record, " l", 2);
304304
}else{
305
- blob_append(&record, "\n", 1);
305
+ blob_append(&record, " w", 2);
306
+ }
307
+ if( gg.aFile[i].zPrior!=0 ){
308
+ blob_appendf(&record, " %F", gg.aFile[i].zPrior);
306309
}
310
+ blob_append(&record, "\n", 1);
307311
}
308312
if( gg.zFrom ){
309313
blob_appendf(&record, "P %s", gg.zFrom);
310314
for(i=0; i<gg.nMerge; i++){
311315
blob_appendf(&record, " %s", gg.azMerge[i]);
312316
--- src/import.c
+++ src/import.c
@@ -296,16 +296,20 @@
296 for(i=0; i<gg.nFile; i++){
297 const char *zUuid = gg.aFile[i].zUuid;
298 if( zUuid==0 ) continue;
299 blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid);
300 if( gg.aFile[i].isExe ){
301 blob_append(&record, " x\n", 3);
302 }else if( gg.aFile[i].isLink ){
303 blob_append(&record, " l\n", 3);
304 }else{
305 blob_append(&record, "\n", 1);
 
 
 
306 }
 
307 }
308 if( gg.zFrom ){
309 blob_appendf(&record, "P %s", gg.zFrom);
310 for(i=0; i<gg.nMerge; i++){
311 blob_appendf(&record, " %s", gg.azMerge[i]);
312
--- src/import.c
+++ src/import.c
@@ -296,16 +296,20 @@
296 for(i=0; i<gg.nFile; i++){
297 const char *zUuid = gg.aFile[i].zUuid;
298 if( zUuid==0 ) continue;
299 blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid);
300 if( gg.aFile[i].isExe ){
301 blob_append(&record, " x", 2);
302 }else if( gg.aFile[i].isLink ){
303 blob_append(&record, " l", 2);
304 }else{
305 blob_append(&record, " w", 2);
306 }
307 if( gg.aFile[i].zPrior!=0 ){
308 blob_appendf(&record, " %F", gg.aFile[i].zPrior);
309 }
310 blob_append(&record, "\n", 1);
311 }
312 if( gg.zFrom ){
313 blob_appendf(&record, "P %s", gg.zFrom);
314 for(i=0; i<gg.nMerge; i++){
315 blob_appendf(&record, " %s", gg.azMerge[i]);
316

Keyboard Shortcuts

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