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.
Commit
d3c5c08fd841fde968ee7acbf1c31644e789339e9c6706da32fc0e64cee3d838
Parent
f0abcad3b95ecdf…
1 file changed
+9
+9
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -869,10 +869,11 @@ | ||
| 869 | 869 | KeyVal *aHeaders; |
| 870 | 870 | int nHeaders; |
| 871 | 871 | char *pRawProps; |
| 872 | 872 | KeyVal *aProps; |
| 873 | 873 | int nProps; |
| 874 | + int deletesExec; /* A property delta deletes svn:executable */ | |
| 874 | 875 | Blob content; |
| 875 | 876 | int contentFlag; |
| 876 | 877 | } SvnRecord; |
| 877 | 878 | |
| 878 | 879 | #define svn_find_header(rec, zHeader) \ |
| @@ -966,10 +967,11 @@ | ||
| 966 | 967 | const char *zLen; |
| 967 | 968 | |
| 968 | 969 | rec->pRawProps = 0; |
| 969 | 970 | rec->aProps = 0; |
| 970 | 971 | rec->nProps = 0; |
| 972 | + rec->deletesExec = 0; | |
| 971 | 973 | zLen = svn_find_header(*rec, "Prop-content-length"); |
| 972 | 974 | if( zLen ){ |
| 973 | 975 | nRawProps = svn_number(zLen, 0); |
| 974 | 976 | } |
| 975 | 977 | if( nRawProps ){ |
| @@ -992,10 +994,13 @@ | ||
| 992 | 994 | if( zLine[0]=='D' ){ |
| 993 | 995 | propLen = svn_number(&zLine[2], '\n'); |
| 994 | 996 | eol = strchr(zLine, '\n'); |
| 995 | 997 | if( eol==0 || eol>=zEnd || propLen>zEnd-eol ){ |
| 996 | 998 | fossil_fatal("svn-dump data format broken"); |
| 999 | + } | |
| 1000 | + if( propLen==14 && strncmp(eol+1, "svn:executable", 14)==0 ){ | |
| 1001 | + rec->deletesExec = 1; | |
| 997 | 1002 | } |
| 998 | 1003 | zLine = eol+1+propLen+1; |
| 999 | 1004 | }else{ |
| 1000 | 1005 | if( zLine[0]!='K' ){ |
| 1001 | 1006 | fossil_fatal("svn-dump data format broken"); |
| @@ -1666,10 +1671,14 @@ | ||
| 1666 | 1671 | || (zTemp && strncmp(zTemp, "true", 4)==0)) ){ |
| 1667 | 1672 | zPerm = db_text(0, "SELECT perm FROM xfoci" |
| 1668 | 1673 | " WHERE checkinID=%d AND filename=%Q" |
| 1669 | 1674 | " AND perm<>''", |
| 1670 | 1675 | srcRid, zSrcFile); |
| 1676 | + if( zPerm && rec.deletesExec && strcmp(zPerm, "x")==0 ){ | |
| 1677 | + fossil_free(zPerm); | |
| 1678 | + zPerm = 0; | |
| 1679 | + } | |
| 1671 | 1680 | } |
| 1672 | 1681 | } |
| 1673 | 1682 | if( deltaFlag ){ |
| 1674 | 1683 | Blob deltaSrc; |
| 1675 | 1684 | Blob target; |
| 1676 | 1685 |
| --- 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 |