140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
** Set the VFILE.CHNGED field on every file that has changed. Also
** set VFILE.CHNGED on every folder that contains a file or folder
** that has changed.
**
** If VFILE.DELETED is null or if VFILE.RID is zero, then we can assume
** the file has changed without having the check the on-disk image.
*/
void vfile_check_signature(int vid){
int nErr = 0;
Stmt q;
Blob fileCksum, origCksum;
int checkMtime = db_get_boolean("mtime-changes", 0);
db_begin_transaction();
db_prepare(&q, "SELECT id, %Q || pathname,"
|
|
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
** Set the VFILE.CHNGED field on every file that has changed. Also
** set VFILE.CHNGED on every folder that contains a file or folder
** that has changed.
**
** If VFILE.DELETED is null or if VFILE.RID is zero, then we can assume
** the file has changed without having the check the on-disk image.
*/
void vfile_check_signature(int vid, int notFileIsFatal){
int nErr = 0;
Stmt q;
Blob fileCksum, origCksum;
int checkMtime = db_get_boolean("mtime-changes", 0);
db_begin_transaction();
db_prepare(&q, "SELECT id, %Q || pathname,"
|
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
id = db_column_int(&q, 0);
zName = db_column_text(&q, 1);
rid = db_column_int(&q, 2);
isDeleted = db_column_int(&q, 3);
oldChnged = db_column_int(&q, 4);
oldMtime = db_column_int64(&q, 6);
if( !file_isfile(zName) && file_size(zName)>=0 ){
fossil_warning("not a ordinary file: %s", zName);
nErr++;
continue;
}
if( oldChnged>=2 ){
chnged = oldChnged;
}else if( isDeleted || rid==0 ){
chnged = 1;
}
if( chnged!=1 ){
currentMtime = file_mtime(zName);
}
|
>
|
|
<
|
>
|
|
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
id = db_column_int(&q, 0);
zName = db_column_text(&q, 1);
rid = db_column_int(&q, 2);
isDeleted = db_column_int(&q, 3);
oldChnged = db_column_int(&q, 4);
oldMtime = db_column_int64(&q, 6);
if( !file_isfile(zName) && file_size(zName)>=0 ){
if( notFileIsFatal ){
fossil_warning("not a ordinary file: %s", zName);
nErr++;
}
chnged = 1;
}else if( oldChnged>=2 ){
chnged = oldChnged;
}else if( isDeleted || rid==0 ){
chnged = 1;
}
if( chnged!=1 ){
currentMtime = file_mtime(zName);
}
|