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.

andygoth 2015-05-15 17:51 UTC andygoth-metadata-changes
Commit 9e52251e6e884a970798bd375903db469a450d3b
1 file changed +20 -2
+20 -2
--- src/checkin.c
+++ src/checkin.c
@@ -1641,10 +1641,12 @@
16411641
int dryRunFlag; /* True for a test run. Debugging only */
16421642
CheckinInfo sCiInfo; /* Information about this check-in */
16431643
const char *zComFile; /* Read commit message from this file */
16441644
int nTag = 0; /* Number of --tag arguments */
16451645
const char *zTag; /* A single --tag argument */
1646
+ ManifestFile *pFile; /* File structure in the manifest */
1647
+ Manifest *pManifest; /* Manifest structure */
16461648
Blob manifest; /* Manifest in baseline form */
16471649
Blob muuid; /* Manifest uuid */
16481650
Blob cksum1, cksum2; /* Before and after commit checksums */
16491651
Blob cksum1b; /* Checksum recorded in the manifest */
16501652
int szD; /* Size of the delta manifest */
@@ -2078,11 +2080,10 @@
20782080
blob_write_to_file(&muuid, zManifestFile);
20792081
free(zManifestFile);
20802082
blob_reset(&muuid);
20812083
}
20822084
2083
-
20842085
/* Update the vfile and vmerge tables */
20852086
db_multi_exec(
20862087
"DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
20872088
"DELETE FROM vmerge;"
20882089
"UPDATE vfile SET vid=%d;"
@@ -2089,11 +2090,28 @@
20892090
"UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL"
20902091
" WHERE is_selected(id);"
20912092
, vid, nvid
20922093
);
20932094
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);
20952113
20962114
if( useCksum ){
20972115
/* Verify that the repository checksum matches the expected checksum
20982116
** calculated before the check-in started (and stored as the R record
20992117
** of the manifest file).
21002118
--- 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

Keyboard Shortcuts

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