Fossil SCM

Ensure deleted/missing files are not processed as other types of files even if C_DELETED and C_MISSING are not specified

andygoth 2016-11-07 00:48 UTC trunk
Commit e9a43ae0ef5ac20b31041f22e84d090d0258ccfa
1 file changed +14 -8
+14 -8
--- src/checkin.c
+++ src/checkin.c
@@ -52,11 +52,11 @@
5252
C_RELPATH = 1 << CB_RELPATH, /* Show relative paths. */
5353
C_CLASSIFY = 1 << CB_CLASSIFY, /* Show file change types. */
5454
C_DEFAULT = (C_ALL & ~C_UNCHANGED) | C_MERGE | C_CLASSIFY,
5555
C_MTIME = 1 << CB_MTIME, /* Show file modification time. */
5656
C_SIZE = 1 << CB_SIZE, /* Show file size in bytes. */
57
- C_FATAL = (1 << CB_FATAL) | C_MISSING, /* Fail on MISSING/NOT_A_FILE. */
57
+ C_FATAL = 1 << CB_FATAL, /* Fail on MISSING/NOT_A_FILE. */
5858
C_COMMENT = 1 << CB_COMMENT, /* Precede each line with "# ". */
5959
};
6060
6161
/*
6262
** Create a TEMP table named SFILE and add all unmanaged files named on
@@ -213,21 +213,27 @@
213213
int isLink = db_column_int(&q, 7);
214214
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
215215
int isMissing = !file_wd_isfile_or_link(zFullName);
216216
217217
/* Determine the file change classification, if any. */
218
- if( (flags & C_DELETED) && isDeleted ){
219
- zClass = "DELETED";
220
- }else if( (flags & C_MISSING) && isMissing ){
218
+ if( isDeleted ){
219
+ if( flags & C_DELETED ){
220
+ zClass = "DELETED";
221
+ }
222
+ }else if( isMissing ){
221223
if( file_access(zFullName, F_OK)==0 ){
222
- zClass = "NOT_A_FILE";
224
+ if( flags & C_MISSING ){
225
+ zClass = "NOT_A_FILE";
226
+ }
223227
if( flags & C_FATAL ){
224228
fossil_warning("not a file: %s", zFullName);
225229
nErr++;
226230
}
227231
}else{
228
- zClass = "MISSING";
232
+ if( flags & C_MISSING ){
233
+ zClass = "MISSING";
234
+ }
229235
if( flags & C_FATAL ){
230236
fossil_warning("missing file: %s", zFullName);
231237
nErr++;
232238
}
233239
}
@@ -255,12 +261,12 @@
255261
}else if( (flags & (C_EDITED | C_CHANGED)) && isChnged
256262
&& (isChnged<2 || isChnged>9) ){
257263
zClass = "EDITED";
258264
}else if( (flags & C_RENAMED) && isRenamed ){
259265
zClass = "RENAMED";
260
- }else if( (flags & C_UNCHANGED) && isManaged && !isDeleted && !isMissing
261
- && !isNew && !isChnged && !isRenamed ){
266
+ }else if( (flags & C_UNCHANGED) && isManaged && !isNew
267
+ && !isChnged && !isRenamed ){
262268
zClass = "UNCHANGED";
263269
}else if( (flags & C_EXTRA) && !isManaged ){
264270
zClass = "EXTRA";
265271
}
266272
267273
--- src/checkin.c
+++ src/checkin.c
@@ -52,11 +52,11 @@
52 C_RELPATH = 1 << CB_RELPATH, /* Show relative paths. */
53 C_CLASSIFY = 1 << CB_CLASSIFY, /* Show file change types. */
54 C_DEFAULT = (C_ALL & ~C_UNCHANGED) | C_MERGE | C_CLASSIFY,
55 C_MTIME = 1 << CB_MTIME, /* Show file modification time. */
56 C_SIZE = 1 << CB_SIZE, /* Show file size in bytes. */
57 C_FATAL = (1 << CB_FATAL) | C_MISSING, /* Fail on MISSING/NOT_A_FILE. */
58 C_COMMENT = 1 << CB_COMMENT, /* Precede each line with "# ". */
59 };
60
61 /*
62 ** Create a TEMP table named SFILE and add all unmanaged files named on
@@ -213,21 +213,27 @@
213 int isLink = db_column_int(&q, 7);
214 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
215 int isMissing = !file_wd_isfile_or_link(zFullName);
216
217 /* Determine the file change classification, if any. */
218 if( (flags & C_DELETED) && isDeleted ){
219 zClass = "DELETED";
220 }else if( (flags & C_MISSING) && isMissing ){
 
 
221 if( file_access(zFullName, F_OK)==0 ){
222 zClass = "NOT_A_FILE";
 
 
223 if( flags & C_FATAL ){
224 fossil_warning("not a file: %s", zFullName);
225 nErr++;
226 }
227 }else{
228 zClass = "MISSING";
 
 
229 if( flags & C_FATAL ){
230 fossil_warning("missing file: %s", zFullName);
231 nErr++;
232 }
233 }
@@ -255,12 +261,12 @@
255 }else if( (flags & (C_EDITED | C_CHANGED)) && isChnged
256 && (isChnged<2 || isChnged>9) ){
257 zClass = "EDITED";
258 }else if( (flags & C_RENAMED) && isRenamed ){
259 zClass = "RENAMED";
260 }else if( (flags & C_UNCHANGED) && isManaged && !isDeleted && !isMissing
261 && !isNew && !isChnged && !isRenamed ){
262 zClass = "UNCHANGED";
263 }else if( (flags & C_EXTRA) && !isManaged ){
264 zClass = "EXTRA";
265 }
266
267
--- src/checkin.c
+++ src/checkin.c
@@ -52,11 +52,11 @@
52 C_RELPATH = 1 << CB_RELPATH, /* Show relative paths. */
53 C_CLASSIFY = 1 << CB_CLASSIFY, /* Show file change types. */
54 C_DEFAULT = (C_ALL & ~C_UNCHANGED) | C_MERGE | C_CLASSIFY,
55 C_MTIME = 1 << CB_MTIME, /* Show file modification time. */
56 C_SIZE = 1 << CB_SIZE, /* Show file size in bytes. */
57 C_FATAL = 1 << CB_FATAL, /* Fail on MISSING/NOT_A_FILE. */
58 C_COMMENT = 1 << CB_COMMENT, /* Precede each line with "# ". */
59 };
60
61 /*
62 ** Create a TEMP table named SFILE and add all unmanaged files named on
@@ -213,21 +213,27 @@
213 int isLink = db_column_int(&q, 7);
214 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
215 int isMissing = !file_wd_isfile_or_link(zFullName);
216
217 /* Determine the file change classification, if any. */
218 if( isDeleted ){
219 if( flags & C_DELETED ){
220 zClass = "DELETED";
221 }
222 }else if( isMissing ){
223 if( file_access(zFullName, F_OK)==0 ){
224 if( flags & C_MISSING ){
225 zClass = "NOT_A_FILE";
226 }
227 if( flags & C_FATAL ){
228 fossil_warning("not a file: %s", zFullName);
229 nErr++;
230 }
231 }else{
232 if( flags & C_MISSING ){
233 zClass = "MISSING";
234 }
235 if( flags & C_FATAL ){
236 fossil_warning("missing file: %s", zFullName);
237 nErr++;
238 }
239 }
@@ -255,12 +261,12 @@
261 }else if( (flags & (C_EDITED | C_CHANGED)) && isChnged
262 && (isChnged<2 || isChnged>9) ){
263 zClass = "EDITED";
264 }else if( (flags & C_RENAMED) && isRenamed ){
265 zClass = "RENAMED";
266 }else if( (flags & C_UNCHANGED) && isManaged && !isNew
267 && !isChnged && !isRenamed ){
268 zClass = "UNCHANGED";
269 }else if( (flags & C_EXTRA) && !isManaged ){
270 zClass = "EXTRA";
271 }
272
273

Keyboard Shortcuts

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