Fossil SCM

In import --svn, do not give a copied file the executable permission of its source when the copy's property delta deletes svn:executable, as --deltas and svnrdump dumps record it. A revision whose only change is such a copy now gets a check-in, as with a full dump.

dmestas 2026-11-23 00:11 UTC small-fixes
Commit d3c5c08fd841fde968ee7acbf1c31644e789339e9c6706da32fc0e64cee3d838
1 file changed +9
--- src/import.c
+++ src/import.c
@@ -869,10 +869,11 @@
869869
KeyVal *aHeaders;
870870
int nHeaders;
871871
char *pRawProps;
872872
KeyVal *aProps;
873873
int nProps;
874
+ int deletesExec; /* A property delta deletes svn:executable */
874875
Blob content;
875876
int contentFlag;
876877
} SvnRecord;
877878
878879
#define svn_find_header(rec, zHeader) \
@@ -966,10 +967,11 @@
966967
const char *zLen;
967968
968969
rec->pRawProps = 0;
969970
rec->aProps = 0;
970971
rec->nProps = 0;
972
+ rec->deletesExec = 0;
971973
zLen = svn_find_header(*rec, "Prop-content-length");
972974
if( zLen ){
973975
nRawProps = svn_number(zLen, 0);
974976
}
975977
if( nRawProps ){
@@ -992,10 +994,13 @@
992994
if( zLine[0]=='D' ){
993995
propLen = svn_number(&zLine[2], '\n');
994996
eol = strchr(zLine, '\n');
995997
if( eol==0 || eol>=zEnd || propLen>zEnd-eol ){
996998
fossil_fatal("svn-dump data format broken");
999
+ }
1000
+ if( propLen==14 && strncmp(eol+1, "svn:executable", 14)==0 ){
1001
+ rec->deletesExec = 1;
9971002
}
9981003
zLine = eol+1+propLen+1;
9991004
}else{
10001005
if( zLine[0]!='K' ){
10011006
fossil_fatal("svn-dump data format broken");
@@ -1666,10 +1671,14 @@
16661671
|| (zTemp && strncmp(zTemp, "true", 4)==0)) ){
16671672
zPerm = db_text(0, "SELECT perm FROM xfoci"
16681673
" WHERE checkinID=%d AND filename=%Q"
16691674
" AND perm<>''",
16701675
srcRid, zSrcFile);
1676
+ if( zPerm && rec.deletesExec && strcmp(zPerm, "x")==0 ){
1677
+ fossil_free(zPerm);
1678
+ zPerm = 0;
1679
+ }
16711680
}
16721681
}
16731682
if( deltaFlag ){
16741683
Blob deltaSrc;
16751684
Blob target;
16761685
--- src/import.c
+++ src/import.c
@@ -869,10 +869,11 @@
869 KeyVal *aHeaders;
870 int nHeaders;
871 char *pRawProps;
872 KeyVal *aProps;
873 int nProps;
 
874 Blob content;
875 int contentFlag;
876 } SvnRecord;
877
878 #define svn_find_header(rec, zHeader) \
@@ -966,10 +967,11 @@
966 const char *zLen;
967
968 rec->pRawProps = 0;
969 rec->aProps = 0;
970 rec->nProps = 0;
 
971 zLen = svn_find_header(*rec, "Prop-content-length");
972 if( zLen ){
973 nRawProps = svn_number(zLen, 0);
974 }
975 if( nRawProps ){
@@ -992,10 +994,13 @@
992 if( zLine[0]=='D' ){
993 propLen = svn_number(&zLine[2], '\n');
994 eol = strchr(zLine, '\n');
995 if( eol==0 || eol>=zEnd || propLen>zEnd-eol ){
996 fossil_fatal("svn-dump data format broken");
 
 
 
997 }
998 zLine = eol+1+propLen+1;
999 }else{
1000 if( zLine[0]!='K' ){
1001 fossil_fatal("svn-dump data format broken");
@@ -1666,10 +1671,14 @@
1666 || (zTemp && strncmp(zTemp, "true", 4)==0)) ){
1667 zPerm = db_text(0, "SELECT perm FROM xfoci"
1668 " WHERE checkinID=%d AND filename=%Q"
1669 " AND perm<>''",
1670 srcRid, zSrcFile);
 
 
 
 
1671 }
1672 }
1673 if( deltaFlag ){
1674 Blob deltaSrc;
1675 Blob target;
1676
--- src/import.c
+++ src/import.c
@@ -869,10 +869,11 @@
869 KeyVal *aHeaders;
870 int nHeaders;
871 char *pRawProps;
872 KeyVal *aProps;
873 int nProps;
874 int deletesExec; /* A property delta deletes svn:executable */
875 Blob content;
876 int contentFlag;
877 } SvnRecord;
878
879 #define svn_find_header(rec, zHeader) \
@@ -966,10 +967,11 @@
967 const char *zLen;
968
969 rec->pRawProps = 0;
970 rec->aProps = 0;
971 rec->nProps = 0;
972 rec->deletesExec = 0;
973 zLen = svn_find_header(*rec, "Prop-content-length");
974 if( zLen ){
975 nRawProps = svn_number(zLen, 0);
976 }
977 if( nRawProps ){
@@ -992,10 +994,13 @@
994 if( zLine[0]=='D' ){
995 propLen = svn_number(&zLine[2], '\n');
996 eol = strchr(zLine, '\n');
997 if( eol==0 || eol>=zEnd || propLen>zEnd-eol ){
998 fossil_fatal("svn-dump data format broken");
999 }
1000 if( propLen==14 && strncmp(eol+1, "svn:executable", 14)==0 ){
1001 rec->deletesExec = 1;
1002 }
1003 zLine = eol+1+propLen+1;
1004 }else{
1005 if( zLine[0]!='K' ){
1006 fossil_fatal("svn-dump data format broken");
@@ -1666,10 +1671,14 @@
1671 || (zTemp && strncmp(zTemp, "true", 4)==0)) ){
1672 zPerm = db_text(0, "SELECT perm FROM xfoci"
1673 " WHERE checkinID=%d AND filename=%Q"
1674 " AND perm<>''",
1675 srcRid, zSrcFile);
1676 if( zPerm && rec.deletesExec && strcmp(zPerm, "x")==0 ){
1677 fossil_free(zPerm);
1678 zPerm = 0;
1679 }
1680 }
1681 }
1682 if( deltaFlag ){
1683 Blob deltaSrc;
1684 Blob target;
1685

Keyboard Shortcuts

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