Fossil SCM
"fossil chan" will recognize addition of exe-bit
Commit
d55e797ac0d94334b6e69029d36c5bb719c737da
Parent
85c6c1d7ebfb6b9…
2 files changed
+22
No diff available
+22
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -117,10 +117,30 @@ | ||
| 117 | 117 | db_finalize(&ins); |
| 118 | 118 | manifest_destroy(p); |
| 119 | 119 | db_end_transaction(0); |
| 120 | 120 | } |
| 121 | 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 | + | |
| 122 | 142 | /* |
| 123 | 143 | ** Check the file signature of the disk image for every VFILE of vid. |
| 124 | 144 | ** |
| 125 | 145 | ** Set the VFILE.CHNGED field on every file that has changed. Also |
| 126 | 146 | ** set VFILE.CHNGED on every folder that contains a file or folder |
| @@ -169,10 +189,12 @@ | ||
| 169 | 189 | } |
| 170 | 190 | chnged = 1; |
| 171 | 191 | }else if( oldChnged>=2 ){ |
| 172 | 192 | chnged = oldChnged; |
| 173 | 193 | }else if( rid==0 ){ |
| 194 | + chnged = 1; | |
| 195 | + }else if(file_isexe(zName)!=test_isexe(zName,vid)){ | |
| 174 | 196 | chnged = 1; |
| 175 | 197 | } |
| 176 | 198 | if( chnged!=1 ){ |
| 177 | 199 | i64 origSize = db_column_int64(&q, 6); |
| 178 | 200 | currentMtime = file_mtime(0); |
| 179 | 201 |
| --- 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 |