Fossil SCM

Rename sfile x column to pathname to match vfile and to make room for new columns I plan to add

andygoth 2016-11-06 06:39 UTC andygoth-changes
Commit ec9480fcba01677547bb84cd3b0b50f75cdf303d
+6 -6
--- src/add.c
+++ src/add.c
@@ -226,11 +226,11 @@
226226
if( filenames_are_case_sensitive() ){
227227
xCmp = fossil_strcmp;
228228
}else{
229229
xCmp = fossil_stricmp;
230230
}
231
- db_prepare(&loop, "SELECT x FROM sfile ORDER BY x");
231
+ db_prepare(&loop, "SELECT pathname FROM sfile ORDER BY pathname");
232232
while( db_step(&loop)==SQLITE_ROW ){
233233
const char *zToAdd = db_column_text(&loop, 0);
234234
if( fossil_strcmp(zToAdd, zRepo)==0 ) continue;
235235
for(i=0; (zReserved = fossil_reserved_name(i, 0))!=0; i++){
236236
if( xCmp(zToAdd, zReserved)==0 ) break;
@@ -307,11 +307,11 @@
307307
zIgnoreFlag = db_get("ignore-glob", 0);
308308
}
309309
if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
310310
vid = db_lget_int("checkout",0);
311311
db_begin_transaction();
312
- db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
312
+ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
313313
filename_collation());
314314
pClean = glob_create(zCleanFlag);
315315
pIgnore = glob_create(zIgnoreFlag);
316316
nRoot = strlen(g.zLocalRoot);
317317
@@ -349,11 +349,11 @@
349349
blob_reset(&fullName);
350350
continue;
351351
}
352352
}
353353
db_multi_exec(
354
- "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
354
+ "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)",
355355
zTreeName
356356
);
357357
}
358358
blob_reset(&fullName);
359359
}
@@ -474,11 +474,11 @@
474474
removeFiles = db_get_boolean("mv-rm-files",0);
475475
#else
476476
removeFiles = FOSSIL_MV_RM_FILE;
477477
#endif
478478
}
479
- db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
479
+ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
480480
filename_collation());
481481
for(i=2; i<g.argc; i++){
482482
Blob treeName;
483483
char *zTreeName;
484484
@@ -494,11 +494,11 @@
494494
filename_collation(), zTreeName, filename_collation()
495495
);
496496
blob_reset(&treeName);
497497
}
498498
499
- db_prepare(&loop, "SELECT x FROM sfile");
499
+ db_prepare(&loop, "SELECT pathname FROM sfile");
500500
while( db_step(&loop)==SQLITE_ROW ){
501501
fossil_print("DELETED %s\n", db_column_text(&loop, 0));
502502
if( removeFiles ) add_file_to_remove(db_column_text(&loop, 0));
503503
}
504504
db_finalize(&loop);
@@ -670,11 +670,11 @@
670670
** Populate the temp table "sfile" with the names of all unmanaged
671671
** files currently in the check-out, except for files that match the
672672
** --ignore or ignore-glob patterns and dot-files. Then add all of
673673
** the files in the sfile temp table to the set of managed files.
674674
*/
675
- db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
675
+ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
676676
filename_collation());
677677
n = strlen(g.zLocalRoot);
678678
blob_init(&path, g.zLocalRoot, n-1);
679679
/* now we read the complete file structure into a temp table */
680680
pClean = glob_create(zCleanFlag);
681681
--- src/add.c
+++ src/add.c
@@ -226,11 +226,11 @@
226 if( filenames_are_case_sensitive() ){
227 xCmp = fossil_strcmp;
228 }else{
229 xCmp = fossil_stricmp;
230 }
231 db_prepare(&loop, "SELECT x FROM sfile ORDER BY x");
232 while( db_step(&loop)==SQLITE_ROW ){
233 const char *zToAdd = db_column_text(&loop, 0);
234 if( fossil_strcmp(zToAdd, zRepo)==0 ) continue;
235 for(i=0; (zReserved = fossil_reserved_name(i, 0))!=0; i++){
236 if( xCmp(zToAdd, zReserved)==0 ) break;
@@ -307,11 +307,11 @@
307 zIgnoreFlag = db_get("ignore-glob", 0);
308 }
309 if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
310 vid = db_lget_int("checkout",0);
311 db_begin_transaction();
312 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
313 filename_collation());
314 pClean = glob_create(zCleanFlag);
315 pIgnore = glob_create(zIgnoreFlag);
316 nRoot = strlen(g.zLocalRoot);
317
@@ -349,11 +349,11 @@
349 blob_reset(&fullName);
350 continue;
351 }
352 }
353 db_multi_exec(
354 "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
355 zTreeName
356 );
357 }
358 blob_reset(&fullName);
359 }
@@ -474,11 +474,11 @@
474 removeFiles = db_get_boolean("mv-rm-files",0);
475 #else
476 removeFiles = FOSSIL_MV_RM_FILE;
477 #endif
478 }
479 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
480 filename_collation());
481 for(i=2; i<g.argc; i++){
482 Blob treeName;
483 char *zTreeName;
484
@@ -494,11 +494,11 @@
494 filename_collation(), zTreeName, filename_collation()
495 );
496 blob_reset(&treeName);
497 }
498
499 db_prepare(&loop, "SELECT x FROM sfile");
500 while( db_step(&loop)==SQLITE_ROW ){
501 fossil_print("DELETED %s\n", db_column_text(&loop, 0));
502 if( removeFiles ) add_file_to_remove(db_column_text(&loop, 0));
503 }
504 db_finalize(&loop);
@@ -670,11 +670,11 @@
670 ** Populate the temp table "sfile" with the names of all unmanaged
671 ** files currently in the check-out, except for files that match the
672 ** --ignore or ignore-glob patterns and dot-files. Then add all of
673 ** the files in the sfile temp table to the set of managed files.
674 */
675 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
676 filename_collation());
677 n = strlen(g.zLocalRoot);
678 blob_init(&path, g.zLocalRoot, n-1);
679 /* now we read the complete file structure into a temp table */
680 pClean = glob_create(zCleanFlag);
681
--- src/add.c
+++ src/add.c
@@ -226,11 +226,11 @@
226 if( filenames_are_case_sensitive() ){
227 xCmp = fossil_strcmp;
228 }else{
229 xCmp = fossil_stricmp;
230 }
231 db_prepare(&loop, "SELECT pathname FROM sfile ORDER BY pathname");
232 while( db_step(&loop)==SQLITE_ROW ){
233 const char *zToAdd = db_column_text(&loop, 0);
234 if( fossil_strcmp(zToAdd, zRepo)==0 ) continue;
235 for(i=0; (zReserved = fossil_reserved_name(i, 0))!=0; i++){
236 if( xCmp(zToAdd, zReserved)==0 ) break;
@@ -307,11 +307,11 @@
307 zIgnoreFlag = db_get("ignore-glob", 0);
308 }
309 if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
310 vid = db_lget_int("checkout",0);
311 db_begin_transaction();
312 db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
313 filename_collation());
314 pClean = glob_create(zCleanFlag);
315 pIgnore = glob_create(zIgnoreFlag);
316 nRoot = strlen(g.zLocalRoot);
317
@@ -349,11 +349,11 @@
349 blob_reset(&fullName);
350 continue;
351 }
352 }
353 db_multi_exec(
354 "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)",
355 zTreeName
356 );
357 }
358 blob_reset(&fullName);
359 }
@@ -474,11 +474,11 @@
474 removeFiles = db_get_boolean("mv-rm-files",0);
475 #else
476 removeFiles = FOSSIL_MV_RM_FILE;
477 #endif
478 }
479 db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
480 filename_collation());
481 for(i=2; i<g.argc; i++){
482 Blob treeName;
483 char *zTreeName;
484
@@ -494,11 +494,11 @@
494 filename_collation(), zTreeName, filename_collation()
495 );
496 blob_reset(&treeName);
497 }
498
499 db_prepare(&loop, "SELECT pathname FROM sfile");
500 while( db_step(&loop)==SQLITE_ROW ){
501 fossil_print("DELETED %s\n", db_column_text(&loop, 0));
502 if( removeFiles ) add_file_to_remove(db_column_text(&loop, 0));
503 }
504 db_finalize(&loop);
@@ -670,11 +670,11 @@
670 ** Populate the temp table "sfile" with the names of all unmanaged
671 ** files currently in the check-out, except for files that match the
672 ** --ignore or ignore-glob patterns and dot-files. Then add all of
673 ** the files in the sfile temp table to the set of managed files.
674 */
675 db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
676 filename_collation());
677 n = strlen(g.zLocalRoot);
678 blob_init(&path, g.zLocalRoot, n-1);
679 /* now we read the complete file structure into a temp table */
680 pClean = glob_create(zCleanFlag);
681
+8 -7
--- src/checkin.c
+++ src/checkin.c
@@ -73,11 +73,11 @@
7373
char *zName; /* Name of a candidate file or directory */
7474
int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
7575
int i; /* Loop counter */
7676
int nRoot; /* length of g.zLocalRoot */
7777
78
- db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
78
+ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
7979
filename_collation());
8080
nRoot = (int)strlen(g.zLocalRoot);
8181
if( argc==0 ){
8282
blob_init(&name, g.zLocalRoot, nRoot - 1);
8383
vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0);
@@ -93,11 +93,11 @@
9393
fossil_warning("not found: %s", &zName[nRoot]);
9494
}else if( file_access(zName, R_OK) ){
9595
fossil_fatal("cannot open %s", &zName[nRoot]);
9696
}else{
9797
db_multi_exec(
98
- "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
98
+ "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)",
9999
&zName[nRoot]
100100
);
101101
}
102102
blob_reset(&name);
103103
}
@@ -159,11 +159,11 @@
159159
/* If C_EXTRA, add unmanaged files to the query result too. */
160160
if( flags & C_EXTRA ){
161161
if( blob_size(&sql) ){
162162
blob_append_sql(&sql, " UNION ALL");
163163
}
164
- blob_append_sql(&sql, " SELECT x AS pathname, 0, 0, 0, 0, 0, 0"
164
+ blob_append_sql(&sql, " SELECT pathname, 0, 0, 0, 0, 0, 0"
165165
" FROM sfile WHERE pathname NOT IN (%s)%s",
166166
fossil_all_reserved_names(0), blob_sql_text(&where));
167167
}
168168
169169
/* Append an ORDER BY clause then compile the query. */
@@ -971,19 +971,20 @@
971971
Stmt q;
972972
Blob repo;
973973
if( !dryRunFlag && !disableUndo ) undo_begin();
974974
locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
975975
db_prepare(&q,
976
- "SELECT %Q || x FROM sfile"
977
- " WHERE x NOT IN (%s)"
976
+ "SELECT %Q || pathname FROM sfile"
977
+ " WHERE pathname NOT IN (%s)"
978978
" ORDER BY 1",
979979
g.zLocalRoot, fossil_all_reserved_names(0)
980980
);
981981
if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
982
- db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
982
+ db_multi_exec("DELETE FROM sfile WHERE pathname=%B", &repo);
983983
}
984
- db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
984
+ db_multi_exec("DELETE FROM sfile WHERE pathname IN"
985
+ " (SELECT pathname FROM vfile)");
985986
while( db_step(&q)==SQLITE_ROW ){
986987
const char *zName = db_column_text(&q, 0);
987988
if( glob_match(pKeep, zName+nRoot) ){
988989
if( verboseFlag ){
989990
fossil_print("KEPT file \"%s\" not removed (due to --keep"
990991
--- src/checkin.c
+++ src/checkin.c
@@ -73,11 +73,11 @@
73 char *zName; /* Name of a candidate file or directory */
74 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
75 int i; /* Loop counter */
76 int nRoot; /* length of g.zLocalRoot */
77
78 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
79 filename_collation());
80 nRoot = (int)strlen(g.zLocalRoot);
81 if( argc==0 ){
82 blob_init(&name, g.zLocalRoot, nRoot - 1);
83 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0);
@@ -93,11 +93,11 @@
93 fossil_warning("not found: %s", &zName[nRoot]);
94 }else if( file_access(zName, R_OK) ){
95 fossil_fatal("cannot open %s", &zName[nRoot]);
96 }else{
97 db_multi_exec(
98 "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
99 &zName[nRoot]
100 );
101 }
102 blob_reset(&name);
103 }
@@ -159,11 +159,11 @@
159 /* If C_EXTRA, add unmanaged files to the query result too. */
160 if( flags & C_EXTRA ){
161 if( blob_size(&sql) ){
162 blob_append_sql(&sql, " UNION ALL");
163 }
164 blob_append_sql(&sql, " SELECT x AS pathname, 0, 0, 0, 0, 0, 0"
165 " FROM sfile WHERE pathname NOT IN (%s)%s",
166 fossil_all_reserved_names(0), blob_sql_text(&where));
167 }
168
169 /* Append an ORDER BY clause then compile the query. */
@@ -971,19 +971,20 @@
971 Stmt q;
972 Blob repo;
973 if( !dryRunFlag && !disableUndo ) undo_begin();
974 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
975 db_prepare(&q,
976 "SELECT %Q || x FROM sfile"
977 " WHERE x NOT IN (%s)"
978 " ORDER BY 1",
979 g.zLocalRoot, fossil_all_reserved_names(0)
980 );
981 if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
982 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
983 }
984 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
 
985 while( db_step(&q)==SQLITE_ROW ){
986 const char *zName = db_column_text(&q, 0);
987 if( glob_match(pKeep, zName+nRoot) ){
988 if( verboseFlag ){
989 fossil_print("KEPT file \"%s\" not removed (due to --keep"
990
--- src/checkin.c
+++ src/checkin.c
@@ -73,11 +73,11 @@
73 char *zName; /* Name of a candidate file or directory */
74 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
75 int i; /* Loop counter */
76 int nRoot; /* length of g.zLocalRoot */
77
78 db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
79 filename_collation());
80 nRoot = (int)strlen(g.zLocalRoot);
81 if( argc==0 ){
82 blob_init(&name, g.zLocalRoot, nRoot - 1);
83 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0);
@@ -93,11 +93,11 @@
93 fossil_warning("not found: %s", &zName[nRoot]);
94 }else if( file_access(zName, R_OK) ){
95 fossil_fatal("cannot open %s", &zName[nRoot]);
96 }else{
97 db_multi_exec(
98 "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)",
99 &zName[nRoot]
100 );
101 }
102 blob_reset(&name);
103 }
@@ -159,11 +159,11 @@
159 /* If C_EXTRA, add unmanaged files to the query result too. */
160 if( flags & C_EXTRA ){
161 if( blob_size(&sql) ){
162 blob_append_sql(&sql, " UNION ALL");
163 }
164 blob_append_sql(&sql, " SELECT pathname, 0, 0, 0, 0, 0, 0"
165 " FROM sfile WHERE pathname NOT IN (%s)%s",
166 fossil_all_reserved_names(0), blob_sql_text(&where));
167 }
168
169 /* Append an ORDER BY clause then compile the query. */
@@ -971,19 +971,20 @@
971 Stmt q;
972 Blob repo;
973 if( !dryRunFlag && !disableUndo ) undo_begin();
974 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
975 db_prepare(&q,
976 "SELECT %Q || pathname FROM sfile"
977 " WHERE pathname NOT IN (%s)"
978 " ORDER BY 1",
979 g.zLocalRoot, fossil_all_reserved_names(0)
980 );
981 if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
982 db_multi_exec("DELETE FROM sfile WHERE pathname=%B", &repo);
983 }
984 db_multi_exec("DELETE FROM sfile WHERE pathname IN"
985 " (SELECT pathname FROM vfile)");
986 while( db_step(&q)==SQLITE_ROW ){
987 const char *zName = db_column_text(&q, 0);
988 if( glob_match(pKeep, zName+nRoot) ){
989 if( verboseFlag ){
990 fossil_print("KEPT file \"%s\" not removed (due to --keep"
991
+4 -4
--- src/main.c
+++ src/main.c
@@ -1197,14 +1197,14 @@
11971197
int n = 0;
11981198
11991199
assert( g.db==0 );
12001200
blob_init(&base, g.zRepositoryName, -1);
12011201
sqlite3_open(":memory:", &g.db);
1202
- db_multi_exec("CREATE TABLE sfile(x TEXT);");
1202
+ db_multi_exec("CREATE TABLE sfile(pathname TEXT);");
12031203
db_multi_exec("CREATE TABLE vfile(pathname);");
12041204
vfile_scan(&base, blob_size(&base), 0, 0, 0);
1205
- db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*[^/].fossil'");
1205
+ db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB '*[^/].fossil'");
12061206
n = db_int(0, "SELECT count(*) FROM sfile");
12071207
if( n>0 ){
12081208
Stmt q;
12091209
@ <html>
12101210
@ <head>
@@ -1212,12 +1212,12 @@
12121212
@ <title>Repository List</title>
12131213
@ </head>
12141214
@ <body>
12151215
@ <h1>Available Repositories:</h1>
12161216
@ <ol>
1217
- db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
1218
- " FROM sfile ORDER BY x COLLATE nocase;");
1217
+ db_prepare(&q, "SELECT pathname, substr(pathname,-7,-100000)||'/home'"
1218
+ " FROM sfile ORDER BY pathname COLLATE nocase;");
12191219
while( db_step(&q)==SQLITE_ROW ){
12201220
const char *zName = db_column_text(&q, 0);
12211221
const char *zUrl = db_column_text(&q, 1);
12221222
@ <li><a href="%R/%h(zUrl)" target="_blank">%h(zName)</a></li>
12231223
}
12241224
--- src/main.c
+++ src/main.c
@@ -1197,14 +1197,14 @@
1197 int n = 0;
1198
1199 assert( g.db==0 );
1200 blob_init(&base, g.zRepositoryName, -1);
1201 sqlite3_open(":memory:", &g.db);
1202 db_multi_exec("CREATE TABLE sfile(x TEXT);");
1203 db_multi_exec("CREATE TABLE vfile(pathname);");
1204 vfile_scan(&base, blob_size(&base), 0, 0, 0);
1205 db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*[^/].fossil'");
1206 n = db_int(0, "SELECT count(*) FROM sfile");
1207 if( n>0 ){
1208 Stmt q;
1209 @ <html>
1210 @ <head>
@@ -1212,12 +1212,12 @@
1212 @ <title>Repository List</title>
1213 @ </head>
1214 @ <body>
1215 @ <h1>Available Repositories:</h1>
1216 @ <ol>
1217 db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
1218 " FROM sfile ORDER BY x COLLATE nocase;");
1219 while( db_step(&q)==SQLITE_ROW ){
1220 const char *zName = db_column_text(&q, 0);
1221 const char *zUrl = db_column_text(&q, 1);
1222 @ <li><a href="%R/%h(zUrl)" target="_blank">%h(zName)</a></li>
1223 }
1224
--- src/main.c
+++ src/main.c
@@ -1197,14 +1197,14 @@
1197 int n = 0;
1198
1199 assert( g.db==0 );
1200 blob_init(&base, g.zRepositoryName, -1);
1201 sqlite3_open(":memory:", &g.db);
1202 db_multi_exec("CREATE TABLE sfile(pathname TEXT);");
1203 db_multi_exec("CREATE TABLE vfile(pathname);");
1204 vfile_scan(&base, blob_size(&base), 0, 0, 0);
1205 db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB '*[^/].fossil'");
1206 n = db_int(0, "SELECT count(*) FROM sfile");
1207 if( n>0 ){
1208 Stmt q;
1209 @ <html>
1210 @ <head>
@@ -1212,12 +1212,12 @@
1212 @ <title>Repository List</title>
1213 @ </head>
1214 @ <body>
1215 @ <h1>Available Repositories:</h1>
1216 @ <ol>
1217 db_prepare(&q, "SELECT pathname, substr(pathname,-7,-100000)||'/home'"
1218 " FROM sfile ORDER BY pathname COLLATE nocase;");
1219 while( db_step(&q)==SQLITE_ROW ){
1220 const char *zName = db_column_text(&q, 0);
1221 const char *zUrl = db_column_text(&q, 1);
1222 @ <li><a href="%R/%h(zUrl)" target="_blank">%h(zName)</a></li>
1223 }
1224
+2 -2
--- src/stash.c
+++ src/stash.c
@@ -207,11 +207,11 @@
207207
"SELECT rid, isRemoved, isExec, isLink, origname, newname, delta"
208208
" FROM stashfile WHERE stashid=%d",
209209
stashid
210210
);
211211
vid = db_lget_int("checkout",0);
212
- db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
212
+ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
213213
filename_collation());
214214
while( db_step(&q)==SQLITE_ROW ){
215215
int rid = db_column_int(&q, 0);
216216
int isRemoved = db_column_int(&q, 1);
217217
int isExec = db_column_int(&q, 2);
@@ -222,11 +222,11 @@
222222
char *zNPath = mprintf("%s%s", g.zLocalRoot, zNew);
223223
Blob delta;
224224
undo_save(zNew);
225225
blob_zero(&delta);
226226
if( rid==0 ){
227
- db_multi_exec("INSERT OR IGNORE INTO sfile(x) VALUES(%Q)", zNew);
227
+ db_multi_exec("INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)", zNew);
228228
db_ephemeral_blob(&q, 6, &delta);
229229
blob_write_to_file(&delta, zNPath);
230230
file_wd_setexe(zNPath, isExec);
231231
}else if( isRemoved ){
232232
fossil_print("DELETE %s\n", zOrig);
233233
--- src/stash.c
+++ src/stash.c
@@ -207,11 +207,11 @@
207 "SELECT rid, isRemoved, isExec, isLink, origname, newname, delta"
208 " FROM stashfile WHERE stashid=%d",
209 stashid
210 );
211 vid = db_lget_int("checkout",0);
212 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
213 filename_collation());
214 while( db_step(&q)==SQLITE_ROW ){
215 int rid = db_column_int(&q, 0);
216 int isRemoved = db_column_int(&q, 1);
217 int isExec = db_column_int(&q, 2);
@@ -222,11 +222,11 @@
222 char *zNPath = mprintf("%s%s", g.zLocalRoot, zNew);
223 Blob delta;
224 undo_save(zNew);
225 blob_zero(&delta);
226 if( rid==0 ){
227 db_multi_exec("INSERT OR IGNORE INTO sfile(x) VALUES(%Q)", zNew);
228 db_ephemeral_blob(&q, 6, &delta);
229 blob_write_to_file(&delta, zNPath);
230 file_wd_setexe(zNPath, isExec);
231 }else if( isRemoved ){
232 fossil_print("DELETE %s\n", zOrig);
233
--- src/stash.c
+++ src/stash.c
@@ -207,11 +207,11 @@
207 "SELECT rid, isRemoved, isExec, isLink, origname, newname, delta"
208 " FROM stashfile WHERE stashid=%d",
209 stashid
210 );
211 vid = db_lget_int("checkout",0);
212 db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
213 filename_collation());
214 while( db_step(&q)==SQLITE_ROW ){
215 int rid = db_column_int(&q, 0);
216 int isRemoved = db_column_int(&q, 1);
217 int isExec = db_column_int(&q, 2);
@@ -222,11 +222,11 @@
222 char *zNPath = mprintf("%s%s", g.zLocalRoot, zNew);
223 Blob delta;
224 undo_save(zNew);
225 blob_zero(&delta);
226 if( rid==0 ){
227 db_multi_exec("INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)", zNew);
228 db_ephemeral_blob(&q, 6, &delta);
229 blob_write_to_file(&delta, zNPath);
230 file_wd_setexe(zNPath, isExec);
231 }else if( isRemoved ){
232 fossil_print("DELETE %s\n", zOrig);
233
+1 -1
--- src/vfile.c
+++ src/vfile.c
@@ -498,11 +498,11 @@
498498
}
499499
if( skipAll ) return;
500500
501501
if( depth==0 ){
502502
db_prepare(&ins,
503
- "INSERT OR IGNORE INTO sfile(x) SELECT :file"
503
+ "INSERT OR IGNORE INTO sfile(pathname) SELECT :file"
504504
" WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
505505
" pathname=:file %s)", filename_collation()
506506
);
507507
}
508508
depth++;
509509
--- src/vfile.c
+++ src/vfile.c
@@ -498,11 +498,11 @@
498 }
499 if( skipAll ) return;
500
501 if( depth==0 ){
502 db_prepare(&ins,
503 "INSERT OR IGNORE INTO sfile(x) SELECT :file"
504 " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
505 " pathname=:file %s)", filename_collation()
506 );
507 }
508 depth++;
509
--- src/vfile.c
+++ src/vfile.c
@@ -498,11 +498,11 @@
498 }
499 if( skipAll ) return;
500
501 if( depth==0 ){
502 db_prepare(&ins,
503 "INSERT OR IGNORE INTO sfile(pathname) SELECT :file"
504 " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
505 " pathname=:file %s)", filename_collation()
506 );
507 }
508 depth++;
509

Keyboard Shortcuts

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