Fossil SCM
Fix operation of [/help?cmd=ls | fossil ls] when local files/directories are missing.
Commit
c0b98195f9c7dcb22e2a1a23c4c67050bc985df4
Parent
f89a32d7820a13b…
2 files changed
+7
-17
+5
+7
-17
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -258,28 +258,18 @@ | ||
| 258 | 258 | verify_all_options(); |
| 259 | 259 | blob_zero(&where); |
| 260 | 260 | nRoot = (int)strlen(g.zLocalRoot); |
| 261 | 261 | for(i=2; i<g.argc; i++){ |
| 262 | 262 | Blob fname; |
| 263 | + const char *zTreeName; | |
| 263 | 264 | file_canonical_name(g.argv[i], &fname, 0); |
| 264 | - if( blob_size(&where)>0 ){ | |
| 265 | - blob_append(&where, " OR ", -1); | |
| 266 | - }else{ | |
| 267 | - blob_append(&where, " WHERE ", -1); | |
| 268 | - } | |
| 269 | - if( file_wd_isdir(blob_str(&fname))==1 ){ | |
| 270 | - const char *zFormat; | |
| 271 | - if( filenames_are_case_sensitive() ){ | |
| 272 | - zFormat = "(pathname GLOB '%q/*')"; | |
| 273 | - }else{ | |
| 274 | - zFormat = "(pathname LIKE '%q/%%')"; | |
| 275 | - } | |
| 276 | - blob_appendf(&where, zFormat, blob_str(&fname)+nRoot); | |
| 277 | - }else{ | |
| 278 | - blob_appendf(&where, "(pathname=%Q %s)", | |
| 279 | - blob_str(&fname)+nRoot, filename_collation()); | |
| 280 | - } | |
| 265 | + zTreeName = blob_str(&fname)+nRoot; | |
| 266 | + blob_appendf(&where, " %s (pathname=%Q %s) " | |
| 267 | + "OR (pathname>'%q/' %s AND pathname<'%q0' %s)", | |
| 268 | + (blob_size(&where)>0) ? "OR" : "WHERE", zTreeName, | |
| 269 | + filename_collation(), zTreeName, filename_collation(), | |
| 270 | + zTreeName, filename_collation()); | |
| 281 | 271 | } |
| 282 | 272 | vfile_check_signature(vid, 0); |
| 283 | 273 | if( showAge ){ |
| 284 | 274 | db_prepare(&q, |
| 285 | 275 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)," |
| 286 | 276 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -258,28 +258,18 @@ | |
| 258 | verify_all_options(); |
| 259 | blob_zero(&where); |
| 260 | nRoot = (int)strlen(g.zLocalRoot); |
| 261 | for(i=2; i<g.argc; i++){ |
| 262 | Blob fname; |
| 263 | file_canonical_name(g.argv[i], &fname, 0); |
| 264 | if( blob_size(&where)>0 ){ |
| 265 | blob_append(&where, " OR ", -1); |
| 266 | }else{ |
| 267 | blob_append(&where, " WHERE ", -1); |
| 268 | } |
| 269 | if( file_wd_isdir(blob_str(&fname))==1 ){ |
| 270 | const char *zFormat; |
| 271 | if( filenames_are_case_sensitive() ){ |
| 272 | zFormat = "(pathname GLOB '%q/*')"; |
| 273 | }else{ |
| 274 | zFormat = "(pathname LIKE '%q/%%')"; |
| 275 | } |
| 276 | blob_appendf(&where, zFormat, blob_str(&fname)+nRoot); |
| 277 | }else{ |
| 278 | blob_appendf(&where, "(pathname=%Q %s)", |
| 279 | blob_str(&fname)+nRoot, filename_collation()); |
| 280 | } |
| 281 | } |
| 282 | vfile_check_signature(vid, 0); |
| 283 | if( showAge ){ |
| 284 | db_prepare(&q, |
| 285 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)," |
| 286 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -258,28 +258,18 @@ | |
| 258 | verify_all_options(); |
| 259 | blob_zero(&where); |
| 260 | nRoot = (int)strlen(g.zLocalRoot); |
| 261 | for(i=2; i<g.argc; i++){ |
| 262 | Blob fname; |
| 263 | const char *zTreeName; |
| 264 | file_canonical_name(g.argv[i], &fname, 0); |
| 265 | zTreeName = blob_str(&fname)+nRoot; |
| 266 | blob_appendf(&where, " %s (pathname=%Q %s) " |
| 267 | "OR (pathname>'%q/' %s AND pathname<'%q0' %s)", |
| 268 | (blob_size(&where)>0) ? "OR" : "WHERE", zTreeName, |
| 269 | filename_collation(), zTreeName, filename_collation(), |
| 270 | zTreeName, filename_collation()); |
| 271 | } |
| 272 | vfile_check_signature(vid, 0); |
| 273 | if( showAge ){ |
| 274 | db_prepare(&q, |
| 275 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)," |
| 276 |
+5
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -1,7 +1,12 @@ | ||
| 1 | 1 | <title>Change Log</title> |
| 2 | 2 | |
| 3 | +<h2>Changes For Version 1.27 (as yet unreleased)</h2> | |
| 4 | + * Enhance the [/help?cmd=clean | fossil clean], | |
| 5 | + [/help?cmd=extras | fossil extras] and [/help?cmd=ls | fossil ls] commands to | |
| 6 | + restrict operation to files and directories named on the command-line. | |
| 7 | + | |
| 3 | 8 | <h2>Changes For Version 1.26 (2013-06-18)</h2> |
| 4 | 9 | * The argument to the --port option for the [/help?cmd=ui | fossil ui] and |
| 5 | 10 | [/help?cmd=server | fossil server] commands can take an IP address in addition |
| 6 | 11 | to the port number, causing Fossil to bind to just that one IP address. |
| 7 | 12 | * After prompting for a password, also ask if that password should be |
| 8 | 13 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -1,7 +1,12 @@ | |
| 1 | <title>Change Log</title> |
| 2 | |
| 3 | <h2>Changes For Version 1.26 (2013-06-18)</h2> |
| 4 | * The argument to the --port option for the [/help?cmd=ui | fossil ui] and |
| 5 | [/help?cmd=server | fossil server] commands can take an IP address in addition |
| 6 | to the port number, causing Fossil to bind to just that one IP address. |
| 7 | * After prompting for a password, also ask if that password should be |
| 8 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -1,7 +1,12 @@ | |
| 1 | <title>Change Log</title> |
| 2 | |
| 3 | <h2>Changes For Version 1.27 (as yet unreleased)</h2> |
| 4 | * Enhance the [/help?cmd=clean | fossil clean], |
| 5 | [/help?cmd=extras | fossil extras] and [/help?cmd=ls | fossil ls] commands to |
| 6 | restrict operation to files and directories named on the command-line. |
| 7 | |
| 8 | <h2>Changes For Version 1.26 (2013-06-18)</h2> |
| 9 | * The argument to the --port option for the [/help?cmd=ui | fossil ui] and |
| 10 | [/help?cmd=server | fossil server] commands can take an IP address in addition |
| 11 | to the port number, causing Fossil to bind to just that one IP address. |
| 12 | * After prompting for a password, also ask if that password should be |
| 13 |