Fossil SCM
Ensure deleted/missing files are not processed as other types of files even if C_DELETED and C_MISSING are not specified
Commit
e9a43ae0ef5ac20b31041f22e84d090d0258ccfa
Parent
5e1736971142349…
1 file changed
+14
-8
+14
-8
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -52,11 +52,11 @@ | ||
| 52 | 52 | C_RELPATH = 1 << CB_RELPATH, /* Show relative paths. */ |
| 53 | 53 | C_CLASSIFY = 1 << CB_CLASSIFY, /* Show file change types. */ |
| 54 | 54 | C_DEFAULT = (C_ALL & ~C_UNCHANGED) | C_MERGE | C_CLASSIFY, |
| 55 | 55 | C_MTIME = 1 << CB_MTIME, /* Show file modification time. */ |
| 56 | 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. */ | |
| 57 | + C_FATAL = 1 << CB_FATAL, /* Fail on MISSING/NOT_A_FILE. */ | |
| 58 | 58 | C_COMMENT = 1 << CB_COMMENT, /* Precede each line with "# ". */ |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | 61 | /* |
| 62 | 62 | ** Create a TEMP table named SFILE and add all unmanaged files named on |
| @@ -213,21 +213,27 @@ | ||
| 213 | 213 | int isLink = db_column_int(&q, 7); |
| 214 | 214 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 215 | 215 | int isMissing = !file_wd_isfile_or_link(zFullName); |
| 216 | 216 | |
| 217 | 217 | /* 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 ){ | |
| 221 | 223 | if( file_access(zFullName, F_OK)==0 ){ |
| 222 | - zClass = "NOT_A_FILE"; | |
| 224 | + if( flags & C_MISSING ){ | |
| 225 | + zClass = "NOT_A_FILE"; | |
| 226 | + } | |
| 223 | 227 | if( flags & C_FATAL ){ |
| 224 | 228 | fossil_warning("not a file: %s", zFullName); |
| 225 | 229 | nErr++; |
| 226 | 230 | } |
| 227 | 231 | }else{ |
| 228 | - zClass = "MISSING"; | |
| 232 | + if( flags & C_MISSING ){ | |
| 233 | + zClass = "MISSING"; | |
| 234 | + } | |
| 229 | 235 | if( flags & C_FATAL ){ |
| 230 | 236 | fossil_warning("missing file: %s", zFullName); |
| 231 | 237 | nErr++; |
| 232 | 238 | } |
| 233 | 239 | } |
| @@ -255,12 +261,12 @@ | ||
| 255 | 261 | }else if( (flags & (C_EDITED | C_CHANGED)) && isChnged |
| 256 | 262 | && (isChnged<2 || isChnged>9) ){ |
| 257 | 263 | zClass = "EDITED"; |
| 258 | 264 | }else if( (flags & C_RENAMED) && isRenamed ){ |
| 259 | 265 | 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 ){ | |
| 262 | 268 | zClass = "UNCHANGED"; |
| 263 | 269 | }else if( (flags & C_EXTRA) && !isManaged ){ |
| 264 | 270 | zClass = "EXTRA"; |
| 265 | 271 | } |
| 266 | 272 | |
| 267 | 273 |
| --- 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 |