Fossil SCM

Fix operation of [/help?cmd=ls | fossil ls] when local files/directories are missing.

jan.nijtmans 2013-06-21 08:31 trunk
Commit c0b98195f9c7dcb22e2a1a23c4c67050bc985df4
2 files changed +7 -17 +5
+7 -17
--- src/checkin.c
+++ src/checkin.c
@@ -258,28 +258,18 @@
258258
verify_all_options();
259259
blob_zero(&where);
260260
nRoot = (int)strlen(g.zLocalRoot);
261261
for(i=2; i<g.argc; i++){
262262
Blob fname;
263
+ const char *zTreeName;
263264
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());
281271
}
282272
vfile_check_signature(vid, 0);
283273
if( showAge ){
284274
db_prepare(&q,
285275
"SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0),"
286276
--- 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
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,7 +1,12 @@
11
<title>Change Log</title>
22
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
+
38
<h2>Changes For Version 1.26 (2013-06-18)</h2>
49
* The argument to the --port option for the [/help?cmd=ui | fossil ui] and
510
[/help?cmd=server | fossil server] commands can take an IP address in addition
611
to the port number, causing Fossil to bind to just that one IP address.
712
* After prompting for a password, also ask if that password should be
813
--- 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

Keyboard Shortcuts

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