Fossil SCM
Replace call to checkout_set_all_exe() which only works on the execute bit with inline code that updates both the isexe and islink columns of the vfile table for all files in the checkout.
Commit
9e52251e6e884a970798bd375903db469a450d3b
Parent
076c854482b5715…
1 file changed
+20
-2
+20
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1641,10 +1641,12 @@ | ||
| 1641 | 1641 | int dryRunFlag; /* True for a test run. Debugging only */ |
| 1642 | 1642 | CheckinInfo sCiInfo; /* Information about this check-in */ |
| 1643 | 1643 | const char *zComFile; /* Read commit message from this file */ |
| 1644 | 1644 | int nTag = 0; /* Number of --tag arguments */ |
| 1645 | 1645 | const char *zTag; /* A single --tag argument */ |
| 1646 | + ManifestFile *pFile; /* File structure in the manifest */ | |
| 1647 | + Manifest *pManifest; /* Manifest structure */ | |
| 1646 | 1648 | Blob manifest; /* Manifest in baseline form */ |
| 1647 | 1649 | Blob muuid; /* Manifest uuid */ |
| 1648 | 1650 | Blob cksum1, cksum2; /* Before and after commit checksums */ |
| 1649 | 1651 | Blob cksum1b; /* Checksum recorded in the manifest */ |
| 1650 | 1652 | int szD; /* Size of the delta manifest */ |
| @@ -2078,11 +2080,10 @@ | ||
| 2078 | 2080 | blob_write_to_file(&muuid, zManifestFile); |
| 2079 | 2081 | free(zManifestFile); |
| 2080 | 2082 | blob_reset(&muuid); |
| 2081 | 2083 | } |
| 2082 | 2084 | |
| 2083 | - | |
| 2084 | 2085 | /* Update the vfile and vmerge tables */ |
| 2085 | 2086 | db_multi_exec( |
| 2086 | 2087 | "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);" |
| 2087 | 2088 | "DELETE FROM vmerge;" |
| 2088 | 2089 | "UPDATE vfile SET vid=%d;" |
| @@ -2089,11 +2090,28 @@ | ||
| 2089 | 2090 | "UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL" |
| 2090 | 2091 | " WHERE is_selected(id);" |
| 2091 | 2092 | , vid, nvid |
| 2092 | 2093 | ); |
| 2093 | 2094 | db_lset_int("checkout", nvid); |
| 2094 | - checkout_set_all_exe(nvid); | |
| 2095 | + | |
| 2096 | + /* Update the isexe and islink columns of the vfile table */ | |
| 2097 | + db_prepare(&q, | |
| 2098 | + "UPDATE vfile SET isexe=:exec, islink=:link" | |
| 2099 | + " WHERE vid=:vid AND pathname=:path AND (isexe!=:exec OR islink!=:link)" | |
| 2100 | + ); | |
| 2101 | + db_bind_int(&q, ":vid", nvid); | |
| 2102 | + pManifest = manifest_get(nvid, CFTYPE_MANIFEST, 0); | |
| 2103 | + manifest_file_rewind(pManifest); | |
| 2104 | + while( (pFile = manifest_file_next(pManifest, 0)) ){ | |
| 2105 | + db_bind_int(&q, ":exec", pFile->zPerm && strstr(pFile->zPerm, "x")); | |
| 2106 | + db_bind_int(&q, ":link", pFile->zPerm && strstr(pFile->zPerm, "l")); | |
| 2107 | + db_bind_text(&q, ":path", pFile->zName); | |
| 2108 | + db_step(&q); | |
| 2109 | + db_reset(&q); | |
| 2110 | + } | |
| 2111 | + db_finalize(&q); | |
| 2112 | + manifest_destroy(pManifest); | |
| 2095 | 2113 | |
| 2096 | 2114 | if( useCksum ){ |
| 2097 | 2115 | /* Verify that the repository checksum matches the expected checksum |
| 2098 | 2116 | ** calculated before the check-in started (and stored as the R record |
| 2099 | 2117 | ** of the manifest file). |
| 2100 | 2118 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1641,10 +1641,12 @@ | |
| 1641 | int dryRunFlag; /* True for a test run. Debugging only */ |
| 1642 | CheckinInfo sCiInfo; /* Information about this check-in */ |
| 1643 | const char *zComFile; /* Read commit message from this file */ |
| 1644 | int nTag = 0; /* Number of --tag arguments */ |
| 1645 | const char *zTag; /* A single --tag argument */ |
| 1646 | Blob manifest; /* Manifest in baseline form */ |
| 1647 | Blob muuid; /* Manifest uuid */ |
| 1648 | Blob cksum1, cksum2; /* Before and after commit checksums */ |
| 1649 | Blob cksum1b; /* Checksum recorded in the manifest */ |
| 1650 | int szD; /* Size of the delta manifest */ |
| @@ -2078,11 +2080,10 @@ | |
| 2078 | blob_write_to_file(&muuid, zManifestFile); |
| 2079 | free(zManifestFile); |
| 2080 | blob_reset(&muuid); |
| 2081 | } |
| 2082 | |
| 2083 | |
| 2084 | /* Update the vfile and vmerge tables */ |
| 2085 | db_multi_exec( |
| 2086 | "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);" |
| 2087 | "DELETE FROM vmerge;" |
| 2088 | "UPDATE vfile SET vid=%d;" |
| @@ -2089,11 +2090,28 @@ | |
| 2089 | "UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL" |
| 2090 | " WHERE is_selected(id);" |
| 2091 | , vid, nvid |
| 2092 | ); |
| 2093 | db_lset_int("checkout", nvid); |
| 2094 | checkout_set_all_exe(nvid); |
| 2095 | |
| 2096 | if( useCksum ){ |
| 2097 | /* Verify that the repository checksum matches the expected checksum |
| 2098 | ** calculated before the check-in started (and stored as the R record |
| 2099 | ** of the manifest file). |
| 2100 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1641,10 +1641,12 @@ | |
| 1641 | int dryRunFlag; /* True for a test run. Debugging only */ |
| 1642 | CheckinInfo sCiInfo; /* Information about this check-in */ |
| 1643 | const char *zComFile; /* Read commit message from this file */ |
| 1644 | int nTag = 0; /* Number of --tag arguments */ |
| 1645 | const char *zTag; /* A single --tag argument */ |
| 1646 | ManifestFile *pFile; /* File structure in the manifest */ |
| 1647 | Manifest *pManifest; /* Manifest structure */ |
| 1648 | Blob manifest; /* Manifest in baseline form */ |
| 1649 | Blob muuid; /* Manifest uuid */ |
| 1650 | Blob cksum1, cksum2; /* Before and after commit checksums */ |
| 1651 | Blob cksum1b; /* Checksum recorded in the manifest */ |
| 1652 | int szD; /* Size of the delta manifest */ |
| @@ -2078,11 +2080,10 @@ | |
| 2080 | blob_write_to_file(&muuid, zManifestFile); |
| 2081 | free(zManifestFile); |
| 2082 | blob_reset(&muuid); |
| 2083 | } |
| 2084 | |
| 2085 | /* Update the vfile and vmerge tables */ |
| 2086 | db_multi_exec( |
| 2087 | "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);" |
| 2088 | "DELETE FROM vmerge;" |
| 2089 | "UPDATE vfile SET vid=%d;" |
| @@ -2089,11 +2090,28 @@ | |
| 2090 | "UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL" |
| 2091 | " WHERE is_selected(id);" |
| 2092 | , vid, nvid |
| 2093 | ); |
| 2094 | db_lset_int("checkout", nvid); |
| 2095 | |
| 2096 | /* Update the isexe and islink columns of the vfile table */ |
| 2097 | db_prepare(&q, |
| 2098 | "UPDATE vfile SET isexe=:exec, islink=:link" |
| 2099 | " WHERE vid=:vid AND pathname=:path AND (isexe!=:exec OR islink!=:link)" |
| 2100 | ); |
| 2101 | db_bind_int(&q, ":vid", nvid); |
| 2102 | pManifest = manifest_get(nvid, CFTYPE_MANIFEST, 0); |
| 2103 | manifest_file_rewind(pManifest); |
| 2104 | while( (pFile = manifest_file_next(pManifest, 0)) ){ |
| 2105 | db_bind_int(&q, ":exec", pFile->zPerm && strstr(pFile->zPerm, "x")); |
| 2106 | db_bind_int(&q, ":link", pFile->zPerm && strstr(pFile->zPerm, "l")); |
| 2107 | db_bind_text(&q, ":path", pFile->zName); |
| 2108 | db_step(&q); |
| 2109 | db_reset(&q); |
| 2110 | } |
| 2111 | db_finalize(&q); |
| 2112 | manifest_destroy(pManifest); |
| 2113 | |
| 2114 | if( useCksum ){ |
| 2115 | /* Verify that the repository checksum matches the expected checksum |
| 2116 | ** calculated before the check-in started (and stored as the R record |
| 2117 | ** of the manifest file). |
| 2118 |