Fossil SCM

"fossil chan" will recognize addition of exe-bit

bharder 2011-04-04 01:14 UTC betterExeHandling
Commit d55e797ac0d94334b6e69029d36c5bb719c737da

No diff available

+22
--- src/vfile.c
+++ src/vfile.c
@@ -117,10 +117,30 @@
117117
db_finalize(&ins);
118118
manifest_destroy(p);
119119
db_end_transaction(0);
120120
}
121121
122
+
123
+/*
124
+** Poll db for current exe-status of a file.
125
+*/
126
+static int test_isexe(const char *zFilename, int vid){
127
+ static Stmt s;
128
+ int isexe;
129
+ db_static_prepare(&s,
130
+ "UPDATE vfile SET isexe=:isexe"
131
+ " WHERE vid=:vid AND pathname=:path AND isexe!=:isexe"
132
+ );
133
+ db_bind_int(&s, ":vid", vid);
134
+ db_bind_text(&s, ":path", zFilename);
135
+ db_step(&s);
136
+ isexe = db_column_int(&s, 0);
137
+ db_reset(&s);
138
+
139
+ return isexe;
140
+}
141
+
122142
/*
123143
** Check the file signature of the disk image for every VFILE of vid.
124144
**
125145
** Set the VFILE.CHNGED field on every file that has changed. Also
126146
** set VFILE.CHNGED on every folder that contains a file or folder
@@ -169,10 +189,12 @@
169189
}
170190
chnged = 1;
171191
}else if( oldChnged>=2 ){
172192
chnged = oldChnged;
173193
}else if( rid==0 ){
194
+ chnged = 1;
195
+ }else if(file_isexe(zName)!=test_isexe(zName,vid)){
174196
chnged = 1;
175197
}
176198
if( chnged!=1 ){
177199
i64 origSize = db_column_int64(&q, 6);
178200
currentMtime = file_mtime(0);
179201
--- src/vfile.c
+++ src/vfile.c
@@ -117,10 +117,30 @@
117 db_finalize(&ins);
118 manifest_destroy(p);
119 db_end_transaction(0);
120 }
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122 /*
123 ** Check the file signature of the disk image for every VFILE of vid.
124 **
125 ** Set the VFILE.CHNGED field on every file that has changed. Also
126 ** set VFILE.CHNGED on every folder that contains a file or folder
@@ -169,10 +189,12 @@
169 }
170 chnged = 1;
171 }else if( oldChnged>=2 ){
172 chnged = oldChnged;
173 }else if( rid==0 ){
 
 
174 chnged = 1;
175 }
176 if( chnged!=1 ){
177 i64 origSize = db_column_int64(&q, 6);
178 currentMtime = file_mtime(0);
179
--- src/vfile.c
+++ src/vfile.c
@@ -117,10 +117,30 @@
117 db_finalize(&ins);
118 manifest_destroy(p);
119 db_end_transaction(0);
120 }
121
122
123 /*
124 ** Poll db for current exe-status of a file.
125 */
126 static int test_isexe(const char *zFilename, int vid){
127 static Stmt s;
128 int isexe;
129 db_static_prepare(&s,
130 "UPDATE vfile SET isexe=:isexe"
131 " WHERE vid=:vid AND pathname=:path AND isexe!=:isexe"
132 );
133 db_bind_int(&s, ":vid", vid);
134 db_bind_text(&s, ":path", zFilename);
135 db_step(&s);
136 isexe = db_column_int(&s, 0);
137 db_reset(&s);
138
139 return isexe;
140 }
141
142 /*
143 ** Check the file signature of the disk image for every VFILE of vid.
144 **
145 ** Set the VFILE.CHNGED field on every file that has changed. Also
146 ** set VFILE.CHNGED on every folder that contains a file or folder
@@ -169,10 +189,12 @@
189 }
190 chnged = 1;
191 }else if( oldChnged>=2 ){
192 chnged = oldChnged;
193 }else if( rid==0 ){
194 chnged = 1;
195 }else if(file_isexe(zName)!=test_isexe(zName,vid)){
196 chnged = 1;
197 }
198 if( chnged!=1 ){
199 i64 origSize = db_column_int64(&q, 6);
200 currentMtime = file_mtime(0);
201

Keyboard Shortcuts

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