Fossil SCM

Detect when the check-out contains missing files and filesystem objects that ought to be files but are not. Issue reasonable warnings.

drh 2009-12-18 00:29 trunk
Commit 76f169fca6c040496b14bd37a9e2c5e00f0a797b
+46 -19
--- src/checkin.c
+++ src/checkin.c
@@ -31,14 +31,22 @@
3131
/*
3232
** Generate text describing all changes. Prepend zPrefix to each line
3333
** of output.
3434
**
3535
** We assume that vfile_check_signature has been run.
36
+**
37
+** If missingIsFatal is true, then any files that are missing or which
38
+** are not true files results in a fatal error.
3639
*/
37
-static void status_report(Blob *report, const char *zPrefix){
40
+static void status_report(
41
+ Blob *report, /* Append the status report here */
42
+ const char *zPrefix, /* Prefix on each line of the report */
43
+ int missingIsFatal /* MISSING and NOT_A_FILE are fatal errors */
44
+){
3845
Stmt q;
3946
int nPrefix = strlen(zPrefix);
47
+ int nErr = 0;
4048
db_prepare(&q,
4149
"SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
4250
" FROM vfile "
4351
" WHERE file_is_selected(id)"
4452
" AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
@@ -50,25 +58,37 @@
5058
int isNew = db_column_int(&q,3)==0;
5159
int isRenamed = db_column_int(&q,4);
5260
char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
5361
blob_append(report, zPrefix, nPrefix);
5462
if( isDeleted ){
55
- blob_appendf(report, "DELETED %s\n", zPathname);
56
- }else if( access(zFullName, 0) ){
57
- blob_appendf(report, "MISSING %s\n", zPathname);
63
+ blob_appendf(report, "DELETED %s\n", zPathname);
64
+ }else if( !file_isfile(zFullName) ){
65
+ if( access(zFullName, 0)==0 ){
66
+ blob_appendf(report, "NOT_A_FILE %s\n", zPathname);
67
+ if( missingIsFatal ){
68
+ fossil_warning("not a file: %s", zPathname);
69
+ nErr++;
70
+ }
71
+ }else{
72
+ blob_appendf(report, "MISSING %s\n", zPathname);
73
+ if( missingIsFatal ){
74
+ fossil_warning("missing file: %s", zPathname);
75
+ nErr++;
76
+ }
77
+ }
5878
}else if( isNew ){
59
- blob_appendf(report, "ADDED %s\n", zPathname);
79
+ blob_appendf(report, "ADDED %s\n", zPathname);
6080
}else if( isDeleted ){
61
- blob_appendf(report, "DELETED %s\n", zPathname);
81
+ blob_appendf(report, "DELETED %s\n", zPathname);
6282
}else if( isChnged==2 ){
6383
blob_appendf(report, "UPDATED_BY_MERGE %s\n", zPathname);
6484
}else if( isChnged==3 ){
6585
blob_appendf(report, "ADDED_BY_MERGE %s\n", zPathname);
6686
}else if( isChnged==1 ){
67
- blob_appendf(report, "EDITED %s\n", zPathname);
87
+ blob_appendf(report, "EDITED %s\n", zPathname);
6888
}else if( isRenamed ){
69
- blob_appendf(report, "RENAMED %s\n", zPathname);
89
+ blob_appendf(report, "RENAMED %s\n", zPathname);
7090
}
7191
free(zFullName);
7292
}
7393
db_finalize(&q);
7494
db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid"
@@ -76,10 +96,13 @@
7696
while( db_step(&q)==SQLITE_ROW ){
7797
blob_append(report, zPrefix, nPrefix);
7898
blob_appendf(report, "MERGED_WITH %s\n", db_column_text(&q, 0));
7999
}
80100
db_finalize(&q);
101
+ if( nErr ){
102
+ fossil_fatal("aborting due to prior errors");
103
+ }
81104
}
82105
83106
/*
84107
** COMMAND: changes
85108
**
@@ -92,12 +115,12 @@
92115
Blob report;
93116
int vid;
94117
db_must_be_within_tree();
95118
blob_zero(&report);
96119
vid = db_lget_int("checkout", 0);
97
- vfile_check_signature(vid);
98
- status_report(&report, "");
120
+ vfile_check_signature(vid, 0);
121
+ status_report(&report, "", 0);
99122
blob_write_to_file(&report, "-");
100123
}
101124
102125
/*
103126
** COMMAND: status
@@ -134,11 +157,11 @@
134157
int isBrief;
135158
136159
isBrief = find_option("l","l", 0)==0;
137160
db_must_be_within_tree();
138161
vid = db_lget_int("checkout", 0);
139
- vfile_check_signature(vid);
162
+ vfile_check_signature(vid, 0);
140163
db_prepare(&q,
141164
"SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
142165
" FROM vfile"
143166
" ORDER BY 1"
144167
);
@@ -150,21 +173,25 @@
150173
int renamed = db_column_int(&q,4);
151174
char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
152175
if( isBrief ){
153176
printf("%s\n", zPathname);
154177
}else if( isNew ){
155
- printf("ADDED %s\n", zPathname);
156
- }else if( access(zFullName, 0) ){
157
- printf("MISSING %s\n", zPathname);
178
+ printf("ADDED %s\n", zPathname);
179
+ }else if( !file_isfile(zFullName) ){
180
+ if( access(zFullName, 0)==0 ){
181
+ printf("NOT_A_FILE %s\n", zPathname);
182
+ }else{
183
+ printf("MISSING %s\n", zPathname);
184
+ }
158185
}else if( isDeleted ){
159
- printf("DELETED %s\n", zPathname);
186
+ printf("DELETED %s\n", zPathname);
160187
}else if( chnged ){
161
- printf("EDITED %s\n", zPathname);
188
+ printf("EDITED %s\n", zPathname);
162189
}else if( renamed ){
163
- printf("RENAMED %s\n", zPathname);
190
+ printf("RENAMED %s\n", zPathname);
164191
}else{
165
- printf("UNCHANGED %s\n", zPathname);
192
+ printf("UNCHANGED %s\n", zPathname);
166193
}
167194
free(zFullName);
168195
}
169196
db_finalize(&q);
170197
}
@@ -303,11 +330,11 @@
303330
"# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
304331
"# repositories.\n"
305332
"#\n", -1
306333
);
307334
}
308
- status_report(&text, "# ");
335
+ status_report(&text, "# ", 1);
309336
zEditor = db_get("editor", 0);
310337
if( zEditor==0 ){
311338
zEditor = getenv("VISUAL");
312339
}
313340
if( zEditor==0 ){
314341
--- src/checkin.c
+++ src/checkin.c
@@ -31,14 +31,22 @@
31 /*
32 ** Generate text describing all changes. Prepend zPrefix to each line
33 ** of output.
34 **
35 ** We assume that vfile_check_signature has been run.
 
 
 
36 */
37 static void status_report(Blob *report, const char *zPrefix){
 
 
 
 
38 Stmt q;
39 int nPrefix = strlen(zPrefix);
 
40 db_prepare(&q,
41 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
42 " FROM vfile "
43 " WHERE file_is_selected(id)"
44 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
@@ -50,25 +58,37 @@
50 int isNew = db_column_int(&q,3)==0;
51 int isRenamed = db_column_int(&q,4);
52 char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
53 blob_append(report, zPrefix, nPrefix);
54 if( isDeleted ){
55 blob_appendf(report, "DELETED %s\n", zPathname);
56 }else if( access(zFullName, 0) ){
57 blob_appendf(report, "MISSING %s\n", zPathname);
 
 
 
 
 
 
 
 
 
 
 
 
58 }else if( isNew ){
59 blob_appendf(report, "ADDED %s\n", zPathname);
60 }else if( isDeleted ){
61 blob_appendf(report, "DELETED %s\n", zPathname);
62 }else if( isChnged==2 ){
63 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zPathname);
64 }else if( isChnged==3 ){
65 blob_appendf(report, "ADDED_BY_MERGE %s\n", zPathname);
66 }else if( isChnged==1 ){
67 blob_appendf(report, "EDITED %s\n", zPathname);
68 }else if( isRenamed ){
69 blob_appendf(report, "RENAMED %s\n", zPathname);
70 }
71 free(zFullName);
72 }
73 db_finalize(&q);
74 db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid"
@@ -76,10 +96,13 @@
76 while( db_step(&q)==SQLITE_ROW ){
77 blob_append(report, zPrefix, nPrefix);
78 blob_appendf(report, "MERGED_WITH %s\n", db_column_text(&q, 0));
79 }
80 db_finalize(&q);
 
 
 
81 }
82
83 /*
84 ** COMMAND: changes
85 **
@@ -92,12 +115,12 @@
92 Blob report;
93 int vid;
94 db_must_be_within_tree();
95 blob_zero(&report);
96 vid = db_lget_int("checkout", 0);
97 vfile_check_signature(vid);
98 status_report(&report, "");
99 blob_write_to_file(&report, "-");
100 }
101
102 /*
103 ** COMMAND: status
@@ -134,11 +157,11 @@
134 int isBrief;
135
136 isBrief = find_option("l","l", 0)==0;
137 db_must_be_within_tree();
138 vid = db_lget_int("checkout", 0);
139 vfile_check_signature(vid);
140 db_prepare(&q,
141 "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
142 " FROM vfile"
143 " ORDER BY 1"
144 );
@@ -150,21 +173,25 @@
150 int renamed = db_column_int(&q,4);
151 char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
152 if( isBrief ){
153 printf("%s\n", zPathname);
154 }else if( isNew ){
155 printf("ADDED %s\n", zPathname);
156 }else if( access(zFullName, 0) ){
157 printf("MISSING %s\n", zPathname);
 
 
 
 
158 }else if( isDeleted ){
159 printf("DELETED %s\n", zPathname);
160 }else if( chnged ){
161 printf("EDITED %s\n", zPathname);
162 }else if( renamed ){
163 printf("RENAMED %s\n", zPathname);
164 }else{
165 printf("UNCHANGED %s\n", zPathname);
166 }
167 free(zFullName);
168 }
169 db_finalize(&q);
170 }
@@ -303,11 +330,11 @@
303 "# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
304 "# repositories.\n"
305 "#\n", -1
306 );
307 }
308 status_report(&text, "# ");
309 zEditor = db_get("editor", 0);
310 if( zEditor==0 ){
311 zEditor = getenv("VISUAL");
312 }
313 if( zEditor==0 ){
314
--- src/checkin.c
+++ src/checkin.c
@@ -31,14 +31,22 @@
31 /*
32 ** Generate text describing all changes. Prepend zPrefix to each line
33 ** of output.
34 **
35 ** We assume that vfile_check_signature has been run.
36 **
37 ** If missingIsFatal is true, then any files that are missing or which
38 ** are not true files results in a fatal error.
39 */
40 static void status_report(
41 Blob *report, /* Append the status report here */
42 const char *zPrefix, /* Prefix on each line of the report */
43 int missingIsFatal /* MISSING and NOT_A_FILE are fatal errors */
44 ){
45 Stmt q;
46 int nPrefix = strlen(zPrefix);
47 int nErr = 0;
48 db_prepare(&q,
49 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
50 " FROM vfile "
51 " WHERE file_is_selected(id)"
52 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
@@ -50,25 +58,37 @@
58 int isNew = db_column_int(&q,3)==0;
59 int isRenamed = db_column_int(&q,4);
60 char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
61 blob_append(report, zPrefix, nPrefix);
62 if( isDeleted ){
63 blob_appendf(report, "DELETED %s\n", zPathname);
64 }else if( !file_isfile(zFullName) ){
65 if( access(zFullName, 0)==0 ){
66 blob_appendf(report, "NOT_A_FILE %s\n", zPathname);
67 if( missingIsFatal ){
68 fossil_warning("not a file: %s", zPathname);
69 nErr++;
70 }
71 }else{
72 blob_appendf(report, "MISSING %s\n", zPathname);
73 if( missingIsFatal ){
74 fossil_warning("missing file: %s", zPathname);
75 nErr++;
76 }
77 }
78 }else if( isNew ){
79 blob_appendf(report, "ADDED %s\n", zPathname);
80 }else if( isDeleted ){
81 blob_appendf(report, "DELETED %s\n", zPathname);
82 }else if( isChnged==2 ){
83 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zPathname);
84 }else if( isChnged==3 ){
85 blob_appendf(report, "ADDED_BY_MERGE %s\n", zPathname);
86 }else if( isChnged==1 ){
87 blob_appendf(report, "EDITED %s\n", zPathname);
88 }else if( isRenamed ){
89 blob_appendf(report, "RENAMED %s\n", zPathname);
90 }
91 free(zFullName);
92 }
93 db_finalize(&q);
94 db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid"
@@ -76,10 +96,13 @@
96 while( db_step(&q)==SQLITE_ROW ){
97 blob_append(report, zPrefix, nPrefix);
98 blob_appendf(report, "MERGED_WITH %s\n", db_column_text(&q, 0));
99 }
100 db_finalize(&q);
101 if( nErr ){
102 fossil_fatal("aborting due to prior errors");
103 }
104 }
105
106 /*
107 ** COMMAND: changes
108 **
@@ -92,12 +115,12 @@
115 Blob report;
116 int vid;
117 db_must_be_within_tree();
118 blob_zero(&report);
119 vid = db_lget_int("checkout", 0);
120 vfile_check_signature(vid, 0);
121 status_report(&report, "", 0);
122 blob_write_to_file(&report, "-");
123 }
124
125 /*
126 ** COMMAND: status
@@ -134,11 +157,11 @@
157 int isBrief;
158
159 isBrief = find_option("l","l", 0)==0;
160 db_must_be_within_tree();
161 vid = db_lget_int("checkout", 0);
162 vfile_check_signature(vid, 0);
163 db_prepare(&q,
164 "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
165 " FROM vfile"
166 " ORDER BY 1"
167 );
@@ -150,21 +173,25 @@
173 int renamed = db_column_int(&q,4);
174 char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
175 if( isBrief ){
176 printf("%s\n", zPathname);
177 }else if( isNew ){
178 printf("ADDED %s\n", zPathname);
179 }else if( !file_isfile(zFullName) ){
180 if( access(zFullName, 0)==0 ){
181 printf("NOT_A_FILE %s\n", zPathname);
182 }else{
183 printf("MISSING %s\n", zPathname);
184 }
185 }else if( isDeleted ){
186 printf("DELETED %s\n", zPathname);
187 }else if( chnged ){
188 printf("EDITED %s\n", zPathname);
189 }else if( renamed ){
190 printf("RENAMED %s\n", zPathname);
191 }else{
192 printf("UNCHANGED %s\n", zPathname);
193 }
194 free(zFullName);
195 }
196 db_finalize(&q);
197 }
@@ -303,11 +330,11 @@
330 "# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
331 "# repositories.\n"
332 "#\n", -1
333 );
334 }
335 status_report(&text, "# ", 1);
336 zEditor = db_get("editor", 0);
337 if( zEditor==0 ){
338 zEditor = getenv("VISUAL");
339 }
340 if( zEditor==0 ){
341
+1 -1
--- src/checkout.c
+++ src/checkout.c
@@ -39,11 +39,11 @@
3939
int unsaved_changes(void){
4040
int vid;
4141
db_must_be_within_tree();
4242
vid = db_lget_int("checkout",0);
4343
if( vid==0 ) return 2;
44
- vfile_check_signature(vid);
44
+ vfile_check_signature(vid, 1);
4545
return db_exists("SELECT 1 FROM vfile WHERE chnged"
4646
" OR coalesce(origname!=pathname,0)");
4747
}
4848
4949
/*
5050
--- src/checkout.c
+++ src/checkout.c
@@ -39,11 +39,11 @@
39 int unsaved_changes(void){
40 int vid;
41 db_must_be_within_tree();
42 vid = db_lget_int("checkout",0);
43 if( vid==0 ) return 2;
44 vfile_check_signature(vid);
45 return db_exists("SELECT 1 FROM vfile WHERE chnged"
46 " OR coalesce(origname!=pathname,0)");
47 }
48
49 /*
50
--- src/checkout.c
+++ src/checkout.c
@@ -39,11 +39,11 @@
39 int unsaved_changes(void){
40 int vid;
41 db_must_be_within_tree();
42 vid = db_lget_int("checkout",0);
43 if( vid==0 ) return 2;
44 vfile_check_signature(vid, 1);
45 return db_exists("SELECT 1 FROM vfile WHERE chnged"
46 " OR coalesce(origname!=pathname,0)");
47 }
48
49 /*
50
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -207,11 +207,11 @@
207207
int vid;
208208
Blob sql;
209209
Stmt q;
210210
211211
vid = db_lget_int("checkout", 0);
212
- vfile_check_signature(vid);
212
+ vfile_check_signature(vid, 1);
213213
blob_zero(&sql);
214214
db_begin_transaction();
215215
if( zFrom ){
216216
int rid = name_to_rid(zFrom);
217217
if( !is_a_version(rid) ){
218218
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -207,11 +207,11 @@
207 int vid;
208 Blob sql;
209 Stmt q;
210
211 vid = db_lget_int("checkout", 0);
212 vfile_check_signature(vid);
213 blob_zero(&sql);
214 db_begin_transaction();
215 if( zFrom ){
216 int rid = name_to_rid(zFrom);
217 if( !is_a_version(rid) ){
218
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -207,11 +207,11 @@
207 int vid;
208 Blob sql;
209 Stmt q;
210
211 vid = db_lget_int("checkout", 0);
212 vfile_check_signature(vid, 1);
213 blob_zero(&sql);
214 db_begin_transaction();
215 if( zFrom ){
216 int rid = name_to_rid(zFrom);
217 if( !is_a_version(rid) ){
218
+1 -1
--- src/merge.c
+++ src/merge.c
@@ -77,11 +77,11 @@
7777
"checkout and %s", g.argv[2]);
7878
}
7979
if( pid>1 && !db_exists("SELECT 1 FROM plink WHERE cid=%d", pid) ){
8080
fossil_panic("not a version: record #%d", mid);
8181
}
82
- vfile_check_signature(vid);
82
+ vfile_check_signature(vid, 1);
8383
db_begin_transaction();
8484
undo_begin();
8585
load_vfile_from_rid(mid);
8686
load_vfile_from_rid(pid);
8787
8888
--- src/merge.c
+++ src/merge.c
@@ -77,11 +77,11 @@
77 "checkout and %s", g.argv[2]);
78 }
79 if( pid>1 && !db_exists("SELECT 1 FROM plink WHERE cid=%d", pid) ){
80 fossil_panic("not a version: record #%d", mid);
81 }
82 vfile_check_signature(vid);
83 db_begin_transaction();
84 undo_begin();
85 load_vfile_from_rid(mid);
86 load_vfile_from_rid(pid);
87
88
--- src/merge.c
+++ src/merge.c
@@ -77,11 +77,11 @@
77 "checkout and %s", g.argv[2]);
78 }
79 if( pid>1 && !db_exists("SELECT 1 FROM plink WHERE cid=%d", pid) ){
80 fossil_panic("not a version: record #%d", mid);
81 }
82 vfile_check_signature(vid, 1);
83 db_begin_transaction();
84 undo_begin();
85 load_vfile_from_rid(mid);
86 load_vfile_from_rid(pid);
87
88
+1 -1
--- src/update.c
+++ src/update.c
@@ -118,11 +118,11 @@
118118
" WHERE event.objid=leaves.rid"
119119
" ORDER BY event.mtime DESC");
120120
}
121121
122122
db_begin_transaction();
123
- vfile_check_signature(vid);
123
+ vfile_check_signature(vid, 1);
124124
undo_begin();
125125
load_vfile_from_rid(tid);
126126
127127
/*
128128
** The record.fn field is used to match files against each other. The
129129
--- src/update.c
+++ src/update.c
@@ -118,11 +118,11 @@
118 " WHERE event.objid=leaves.rid"
119 " ORDER BY event.mtime DESC");
120 }
121
122 db_begin_transaction();
123 vfile_check_signature(vid);
124 undo_begin();
125 load_vfile_from_rid(tid);
126
127 /*
128 ** The record.fn field is used to match files against each other. The
129
--- src/update.c
+++ src/update.c
@@ -118,11 +118,11 @@
118 " WHERE event.objid=leaves.rid"
119 " ORDER BY event.mtime DESC");
120 }
121
122 db_begin_transaction();
123 vfile_check_signature(vid, 1);
124 undo_begin();
125 load_vfile_from_rid(tid);
126
127 /*
128 ** The record.fn field is used to match files against each other. The
129
+7 -6
--- src/vfile.c
+++ src/vfile.c
@@ -142,11 +142,11 @@
142142
** that has changed.
143143
**
144144
** If VFILE.DELETED is null or if VFILE.RID is zero, then we can assume
145145
** the file has changed without having the check the on-disk image.
146146
*/
147
-void vfile_check_signature(int vid){
147
+void vfile_check_signature(int vid, int notFileIsFatal){
148148
int nErr = 0;
149149
Stmt q;
150150
Blob fileCksum, origCksum;
151151
int checkMtime = db_get_boolean("mtime-changes", 0);
152152
@@ -168,15 +168,16 @@
168168
rid = db_column_int(&q, 2);
169169
isDeleted = db_column_int(&q, 3);
170170
oldChnged = db_column_int(&q, 4);
171171
oldMtime = db_column_int64(&q, 6);
172172
if( !file_isfile(zName) && file_size(zName)>=0 ){
173
- fossil_warning("not a ordinary file: %s", zName);
174
- nErr++;
175
- continue;
176
- }
177
- if( oldChnged>=2 ){
173
+ if( notFileIsFatal ){
174
+ fossil_warning("not a ordinary file: %s", zName);
175
+ nErr++;
176
+ }
177
+ chnged = 1;
178
+ }else if( oldChnged>=2 ){
178179
chnged = oldChnged;
179180
}else if( isDeleted || rid==0 ){
180181
chnged = 1;
181182
}
182183
if( chnged!=1 ){
183184
--- src/vfile.c
+++ src/vfile.c
@@ -142,11 +142,11 @@
142 ** that has changed.
143 **
144 ** If VFILE.DELETED is null or if VFILE.RID is zero, then we can assume
145 ** the file has changed without having the check the on-disk image.
146 */
147 void vfile_check_signature(int vid){
148 int nErr = 0;
149 Stmt q;
150 Blob fileCksum, origCksum;
151 int checkMtime = db_get_boolean("mtime-changes", 0);
152
@@ -168,15 +168,16 @@
168 rid = db_column_int(&q, 2);
169 isDeleted = db_column_int(&q, 3);
170 oldChnged = db_column_int(&q, 4);
171 oldMtime = db_column_int64(&q, 6);
172 if( !file_isfile(zName) && file_size(zName)>=0 ){
173 fossil_warning("not a ordinary file: %s", zName);
174 nErr++;
175 continue;
176 }
177 if( oldChnged>=2 ){
 
178 chnged = oldChnged;
179 }else if( isDeleted || rid==0 ){
180 chnged = 1;
181 }
182 if( chnged!=1 ){
183
--- src/vfile.c
+++ src/vfile.c
@@ -142,11 +142,11 @@
142 ** that has changed.
143 **
144 ** If VFILE.DELETED is null or if VFILE.RID is zero, then we can assume
145 ** the file has changed without having the check the on-disk image.
146 */
147 void vfile_check_signature(int vid, int notFileIsFatal){
148 int nErr = 0;
149 Stmt q;
150 Blob fileCksum, origCksum;
151 int checkMtime = db_get_boolean("mtime-changes", 0);
152
@@ -168,15 +168,16 @@
168 rid = db_column_int(&q, 2);
169 isDeleted = db_column_int(&q, 3);
170 oldChnged = db_column_int(&q, 4);
171 oldMtime = db_column_int64(&q, 6);
172 if( !file_isfile(zName) && file_size(zName)>=0 ){
173 if( notFileIsFatal ){
174 fossil_warning("not a ordinary file: %s", zName);
175 nErr++;
176 }
177 chnged = 1;
178 }else if( oldChnged>=2 ){
179 chnged = oldChnged;
180 }else if( isDeleted || rid==0 ){
181 chnged = 1;
182 }
183 if( chnged!=1 ){
184

Keyboard Shortcuts

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