Differences From:
File
src/allrepo.c
part of check-in
[7a2c37063a]
- merge trunk into creole branch
by
bob on
2009-09-22 07:49:39.
Also file
src/allrepo.c
part of check-in
[0eb08b860c]
- Change more system() calls into portable_system() in an effort to fix
path quoting problems on windows.
by
drh on
2009-09-16 21:29:18.
[view]
To:
File
src/allrepo.c
part of check-in
[d5695157d0]
- Deal with windows filename aliasing in the "all" command.
Ticket 974618fe5a8. Also display the home directory for windows
users with the "info" command since the home directory is non-obvious
in windows.
by
drh on
2009-11-11 16:21:19.
[view]
@@ -112,16 +112,20 @@
"list ls push pull rebuild sync");
}
zFossil = quoteFilename(g.argv[0]);
nMissing = 0;
- db_prepare(&q, "SELECT substr(name, 6) FROM global_config"
- " WHERE substr(name, 1, 5)=='repo:' ORDER BY 1");
+ db_prepare(&q,
+ "SELECT DISTINCT substr(name, 6) COLLATE nocase"
+ " FROM global_config"
+ " WHERE substr(name, 1, 5)=='repo:' ORDER BY 1"
+ );
while( db_step(&q)==SQLITE_ROW ){
const char *zFilename = db_column_text(&q, 0);
if( access(zFilename, 0) ){
nMissing++;
continue;
}
+ if( !file_is_canonical(zFilename) ) nMissing++;
if( zCmd[0]=='l' ){
printf("%s\n", zFilename);
continue;
}
@@ -133,9 +137,9 @@
free(zSyscmd);
free(zQFilename);
}
- /* If any repositories hows names appear in the ~/.fossil file could not
+ /* If any repositories whose names appear in the ~/.fossil file could not
** be found, remove those names from the ~/.fossil file.
*/
if( nMissing ){
db_begin_transaction();
@@ -144,8 +148,17 @@
const char *zFilename = db_column_text(&q, 0);
if( access(zFilename, 0) ){
char *zRepo = mprintf("repo:%s", zFilename);
db_unset(zRepo, 1);
+ free(zRepo);
+ }else if( !file_is_canonical(zFilename) ){
+ Blob cname;
+ char *zRepo = mprintf("repo:%s", zFilename);
+ db_unset(zRepo, 1);
+ free(zRepo);
+ file_canonical_name(zFilename, &cname);
+ zRepo = mprintf("repo:%s", blob_str(&cname));
+ db_set(zRepo, "1", 1);
free(zRepo);
}
}
db_reset(&q);