Fossil SCM
In import --svn, take the permission of a copied file from its source whenever the node gives no properties of its own, also when the copy is edited in the same revision, and give an ordinary file no permission field.
Commit
19a209aa8bd717a6142c7c83752badf6fe2b9b422c97f7a728142e10d5198639
Parent
c4761f82db6deef…
1 file changed
+6
-6
+6
-6
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1658,10 +1658,16 @@ | ||
| 1658 | 1658 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1659 | 1659 | " SELECT uuid FROM xfoci" |
| 1660 | 1660 | " WHERE checkinID=%d AND filename=%Q" |
| 1661 | 1661 | ")", |
| 1662 | 1662 | srcRid, zSrcFile); |
| 1663 | + if( zPerm==0 && svn_find_header(rec, "Prop-content-length")==0 ){ | |
| 1664 | + zPerm = db_text(0, "SELECT perm FROM xfoci" | |
| 1665 | + " WHERE checkinID=%d AND filename=%Q" | |
| 1666 | + " AND perm<>''", | |
| 1667 | + srcRid, zSrcFile); | |
| 1668 | + } | |
| 1663 | 1669 | } |
| 1664 | 1670 | if( deltaFlag ){ |
| 1665 | 1671 | Blob deltaSrc; |
| 1666 | 1672 | Blob target; |
| 1667 | 1673 | if( rid!=0 ){ |
| @@ -1673,16 +1679,10 @@ | ||
| 1673 | 1679 | rid = svn_handle_symlinks(zPerm, &target); |
| 1674 | 1680 | blob_reset(&deltaSrc); |
| 1675 | 1681 | blob_reset(&target); |
| 1676 | 1682 | }else if( rec.contentFlag ){ |
| 1677 | 1683 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1678 | - }else if( zSrcPath ){ | |
| 1679 | - if ( zPerm==0 ){ | |
| 1680 | - zPerm = db_text(0, "SELECT perm FROM xfoci" | |
| 1681 | - " WHERE checkinID=%d AND filename=%Q", | |
| 1682 | - srcRid, zSrcFile); | |
| 1683 | - } | |
| 1684 | 1684 | } |
| 1685 | 1685 | if( rid==0 ){ |
| 1686 | 1686 | fossil_fatal("svn file has no content and no source: %s", zFile); |
| 1687 | 1687 | } |
| 1688 | 1688 | db_bind_text(&addFile, ":path", zFile); |
| 1689 | 1689 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1658,10 +1658,16 @@ | |
| 1658 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1659 | " SELECT uuid FROM xfoci" |
| 1660 | " WHERE checkinID=%d AND filename=%Q" |
| 1661 | ")", |
| 1662 | srcRid, zSrcFile); |
| 1663 | } |
| 1664 | if( deltaFlag ){ |
| 1665 | Blob deltaSrc; |
| 1666 | Blob target; |
| 1667 | if( rid!=0 ){ |
| @@ -1673,16 +1679,10 @@ | |
| 1673 | rid = svn_handle_symlinks(zPerm, &target); |
| 1674 | blob_reset(&deltaSrc); |
| 1675 | blob_reset(&target); |
| 1676 | }else if( rec.contentFlag ){ |
| 1677 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1678 | }else if( zSrcPath ){ |
| 1679 | if ( zPerm==0 ){ |
| 1680 | zPerm = db_text(0, "SELECT perm FROM xfoci" |
| 1681 | " WHERE checkinID=%d AND filename=%Q", |
| 1682 | srcRid, zSrcFile); |
| 1683 | } |
| 1684 | } |
| 1685 | if( rid==0 ){ |
| 1686 | fossil_fatal("svn file has no content and no source: %s", zFile); |
| 1687 | } |
| 1688 | db_bind_text(&addFile, ":path", zFile); |
| 1689 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1658,10 +1658,16 @@ | |
| 1658 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1659 | " SELECT uuid FROM xfoci" |
| 1660 | " WHERE checkinID=%d AND filename=%Q" |
| 1661 | ")", |
| 1662 | srcRid, zSrcFile); |
| 1663 | if( zPerm==0 && svn_find_header(rec, "Prop-content-length")==0 ){ |
| 1664 | zPerm = db_text(0, "SELECT perm FROM xfoci" |
| 1665 | " WHERE checkinID=%d AND filename=%Q" |
| 1666 | " AND perm<>''", |
| 1667 | srcRid, zSrcFile); |
| 1668 | } |
| 1669 | } |
| 1670 | if( deltaFlag ){ |
| 1671 | Blob deltaSrc; |
| 1672 | Blob target; |
| 1673 | if( rid!=0 ){ |
| @@ -1673,16 +1679,10 @@ | |
| 1679 | rid = svn_handle_symlinks(zPerm, &target); |
| 1680 | blob_reset(&deltaSrc); |
| 1681 | blob_reset(&target); |
| 1682 | }else if( rec.contentFlag ){ |
| 1683 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1684 | } |
| 1685 | if( rid==0 ){ |
| 1686 | fossil_fatal("svn file has no content and no source: %s", zFile); |
| 1687 | } |
| 1688 | db_bind_text(&addFile, ":path", zFile); |
| 1689 |