Fossil SCM

Turn ignore-glob, crnl-glob, binary-glob and manifest settings into versionable settings.

ben 2011-05-22 09:50 versionable-settings
Commit 43b0d795e50bc0f53743bd80bbbbac054200c0ef
+3 -3
--- src/add.c
+++ src/add.c
@@ -60,11 +60,11 @@
6060
"manifest.uuid",
6161
};
6262
6363
if( N>=0 && N<count(azName) ) return azName[N];
6464
if( N>=count(azName) && N<count(azName)+count(azManifest)
65
- && db_get_boolean("manifest",0) ){
65
+ && db_get_versionable_setting_boolean("manifest",0) ){
6666
return azManifest[N-count(azName)];
6767
}
6868
return 0;
6969
}
7070
@@ -185,11 +185,11 @@
185185
186186
zIgnoreFlag = find_option("ignore",0,1);
187187
includeDotFiles = find_option("dotfiles",0,0)!=0;
188188
db_must_be_within_tree();
189189
if( zIgnoreFlag==0 ){
190
- zIgnoreFlag = db_get("ignore-glob", 0);
190
+ zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
191191
}
192192
vid = db_lget_int("checkout",0);
193193
if( vid==0 ){
194194
fossil_panic("no checkout to add to");
195195
}
@@ -337,11 +337,11 @@
337337
int nDelete = 0;
338338
Glob *pIgnore;
339339
340340
db_must_be_within_tree();
341341
if( zIgnoreFlag==0 ){
342
- zIgnoreFlag = db_get("ignore-glob", 0);
342
+ zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
343343
}
344344
vid = db_lget_int("checkout",0);
345345
if( vid==0 ){
346346
fossil_panic("no checkout to add to");
347347
}
348348
--- src/add.c
+++ src/add.c
@@ -60,11 +60,11 @@
60 "manifest.uuid",
61 };
62
63 if( N>=0 && N<count(azName) ) return azName[N];
64 if( N>=count(azName) && N<count(azName)+count(azManifest)
65 && db_get_boolean("manifest",0) ){
66 return azManifest[N-count(azName)];
67 }
68 return 0;
69 }
70
@@ -185,11 +185,11 @@
185
186 zIgnoreFlag = find_option("ignore",0,1);
187 includeDotFiles = find_option("dotfiles",0,0)!=0;
188 db_must_be_within_tree();
189 if( zIgnoreFlag==0 ){
190 zIgnoreFlag = db_get("ignore-glob", 0);
191 }
192 vid = db_lget_int("checkout",0);
193 if( vid==0 ){
194 fossil_panic("no checkout to add to");
195 }
@@ -337,11 +337,11 @@
337 int nDelete = 0;
338 Glob *pIgnore;
339
340 db_must_be_within_tree();
341 if( zIgnoreFlag==0 ){
342 zIgnoreFlag = db_get("ignore-glob", 0);
343 }
344 vid = db_lget_int("checkout",0);
345 if( vid==0 ){
346 fossil_panic("no checkout to add to");
347 }
348
--- src/add.c
+++ src/add.c
@@ -60,11 +60,11 @@
60 "manifest.uuid",
61 };
62
63 if( N>=0 && N<count(azName) ) return azName[N];
64 if( N>=count(azName) && N<count(azName)+count(azManifest)
65 && db_get_versionable_setting_boolean("manifest",0) ){
66 return azManifest[N-count(azName)];
67 }
68 return 0;
69 }
70
@@ -185,11 +185,11 @@
185
186 zIgnoreFlag = find_option("ignore",0,1);
187 includeDotFiles = find_option("dotfiles",0,0)!=0;
188 db_must_be_within_tree();
189 if( zIgnoreFlag==0 ){
190 zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
191 }
192 vid = db_lget_int("checkout",0);
193 if( vid==0 ){
194 fossil_panic("no checkout to add to");
195 }
@@ -337,11 +337,11 @@
337 int nDelete = 0;
338 Glob *pIgnore;
339
340 db_must_be_within_tree();
341 if( zIgnoreFlag==0 ){
342 zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
343 }
344 vid = db_lget_int("checkout",0);
345 if( vid==0 ){
346 fossil_panic("no checkout to add to");
347 }
348
+5 -5
--- src/checkin.c
+++ src/checkin.c
@@ -224,16 +224,16 @@
224224
int allFlag = find_option("dotfiles",0,0)!=0;
225225
int outputManifest;
226226
Glob *pIgnore;
227227
228228
db_must_be_within_tree();
229
- outputManifest = db_get_boolean("manifest",0);
229
+ outputManifest = db_get_versionable_setting_boolean("manifest",0);
230230
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
231231
n = strlen(g.zLocalRoot);
232232
blob_init(&path, g.zLocalRoot, n-1);
233233
if( zIgnoreFlag==0 ){
234
- zIgnoreFlag = db_get("ignore-glob", 0);
234
+ zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
235235
}
236236
pIgnore = glob_create(zIgnoreFlag);
237237
vfile_scan(&path, blob_size(&path), allFlag, pIgnore);
238238
glob_free(pIgnore);
239239
db_prepare(&q,
@@ -283,11 +283,11 @@
283283
allFlag = find_option("force","f",0)!=0;
284284
dotfilesFlag = find_option("dotfiles",0,0)!=0;
285285
zIgnoreFlag = find_option("ignore",0,1);
286286
db_must_be_within_tree();
287287
if( zIgnoreFlag==0 ){
288
- zIgnoreFlag = db_get("ignore-glob", 0);
288
+ zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
289289
}
290290
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
291291
n = strlen(g.zLocalRoot);
292292
blob_init(&path, g.zLocalRoot, n-1);
293293
pIgnore = glob_create(zIgnoreFlag);
@@ -831,11 +831,11 @@
831831
zUserOvrd = find_option("user-override",0,1);
832832
db_must_be_within_tree();
833833
noSign = db_get_boolean("omitsign", 0)|noSign;
834834
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
835835
useCksum = db_get_boolean("repo-cksum", 1);
836
- outputManifest = db_get_boolean("manifest", 0);
836
+ outputManifest = db_get_versionable_setting_boolean("manifest", 0);
837837
verify_all_options();
838838
839839
/* So that older versions of Fossil (that do not understand delta-
840840
** manifest) can continue to use this repository, do not create a new
841841
** delta-manifest unless this repository already contains one or more
@@ -972,11 +972,11 @@
972972
** the identified fils are inserted (if they have been modified).
973973
*/
974974
db_prepare(&q,
975975
"SELECT id, %Q || pathname, mrid, %s FROM vfile "
976976
"WHERE chnged==1 AND NOT deleted AND file_is_selected(id)",
977
- g.zLocalRoot, glob_expr("pathname", db_get("crnl-glob",""))
977
+ g.zLocalRoot, glob_expr("pathname", db_get_versionable_setting("crnl-glob",""))
978978
);
979979
while( db_step(&q)==SQLITE_ROW ){
980980
int id, rid;
981981
const char *zFullname;
982982
Blob content;
983983
--- src/checkin.c
+++ src/checkin.c
@@ -224,16 +224,16 @@
224 int allFlag = find_option("dotfiles",0,0)!=0;
225 int outputManifest;
226 Glob *pIgnore;
227
228 db_must_be_within_tree();
229 outputManifest = db_get_boolean("manifest",0);
230 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
231 n = strlen(g.zLocalRoot);
232 blob_init(&path, g.zLocalRoot, n-1);
233 if( zIgnoreFlag==0 ){
234 zIgnoreFlag = db_get("ignore-glob", 0);
235 }
236 pIgnore = glob_create(zIgnoreFlag);
237 vfile_scan(&path, blob_size(&path), allFlag, pIgnore);
238 glob_free(pIgnore);
239 db_prepare(&q,
@@ -283,11 +283,11 @@
283 allFlag = find_option("force","f",0)!=0;
284 dotfilesFlag = find_option("dotfiles",0,0)!=0;
285 zIgnoreFlag = find_option("ignore",0,1);
286 db_must_be_within_tree();
287 if( zIgnoreFlag==0 ){
288 zIgnoreFlag = db_get("ignore-glob", 0);
289 }
290 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
291 n = strlen(g.zLocalRoot);
292 blob_init(&path, g.zLocalRoot, n-1);
293 pIgnore = glob_create(zIgnoreFlag);
@@ -831,11 +831,11 @@
831 zUserOvrd = find_option("user-override",0,1);
832 db_must_be_within_tree();
833 noSign = db_get_boolean("omitsign", 0)|noSign;
834 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
835 useCksum = db_get_boolean("repo-cksum", 1);
836 outputManifest = db_get_boolean("manifest", 0);
837 verify_all_options();
838
839 /* So that older versions of Fossil (that do not understand delta-
840 ** manifest) can continue to use this repository, do not create a new
841 ** delta-manifest unless this repository already contains one or more
@@ -972,11 +972,11 @@
972 ** the identified fils are inserted (if they have been modified).
973 */
974 db_prepare(&q,
975 "SELECT id, %Q || pathname, mrid, %s FROM vfile "
976 "WHERE chnged==1 AND NOT deleted AND file_is_selected(id)",
977 g.zLocalRoot, glob_expr("pathname", db_get("crnl-glob",""))
978 );
979 while( db_step(&q)==SQLITE_ROW ){
980 int id, rid;
981 const char *zFullname;
982 Blob content;
983
--- src/checkin.c
+++ src/checkin.c
@@ -224,16 +224,16 @@
224 int allFlag = find_option("dotfiles",0,0)!=0;
225 int outputManifest;
226 Glob *pIgnore;
227
228 db_must_be_within_tree();
229 outputManifest = db_get_versionable_setting_boolean("manifest",0);
230 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
231 n = strlen(g.zLocalRoot);
232 blob_init(&path, g.zLocalRoot, n-1);
233 if( zIgnoreFlag==0 ){
234 zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
235 }
236 pIgnore = glob_create(zIgnoreFlag);
237 vfile_scan(&path, blob_size(&path), allFlag, pIgnore);
238 glob_free(pIgnore);
239 db_prepare(&q,
@@ -283,11 +283,11 @@
283 allFlag = find_option("force","f",0)!=0;
284 dotfilesFlag = find_option("dotfiles",0,0)!=0;
285 zIgnoreFlag = find_option("ignore",0,1);
286 db_must_be_within_tree();
287 if( zIgnoreFlag==0 ){
288 zIgnoreFlag = db_get_versionable_setting("ignore-glob", 0);
289 }
290 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
291 n = strlen(g.zLocalRoot);
292 blob_init(&path, g.zLocalRoot, n-1);
293 pIgnore = glob_create(zIgnoreFlag);
@@ -831,11 +831,11 @@
831 zUserOvrd = find_option("user-override",0,1);
832 db_must_be_within_tree();
833 noSign = db_get_boolean("omitsign", 0)|noSign;
834 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
835 useCksum = db_get_boolean("repo-cksum", 1);
836 outputManifest = db_get_versionable_setting_boolean("manifest", 0);
837 verify_all_options();
838
839 /* So that older versions of Fossil (that do not understand delta-
840 ** manifest) can continue to use this repository, do not create a new
841 ** delta-manifest unless this repository already contains one or more
@@ -972,11 +972,11 @@
972 ** the identified fils are inserted (if they have been modified).
973 */
974 db_prepare(&q,
975 "SELECT id, %Q || pathname, mrid, %s FROM vfile "
976 "WHERE chnged==1 AND NOT deleted AND file_is_selected(id)",
977 g.zLocalRoot, glob_expr("pathname", db_get_versionable_setting("crnl-glob",""))
978 );
979 while( db_step(&q)==SQLITE_ROW ){
980 int id, rid;
981 const char *zFullname;
982 Blob content;
983
+1 -1
--- src/checkout.c
+++ src/checkout.c
@@ -141,11 +141,11 @@
141141
void manifest_to_disk(int vid){
142142
char *zManFile;
143143
Blob manifest;
144144
Blob hash;
145145
146
- if( db_get_boolean("manifest",0) ){
146
+ if( db_get_versionable_setting_boolean("manifest",0) ){
147147
blob_zero(&manifest);
148148
content_get(vid, &manifest);
149149
zManFile = mprintf("%smanifest", g.zLocalRoot);
150150
blob_write_to_file(&manifest, zManFile);
151151
free(zManFile);
152152
--- src/checkout.c
+++ src/checkout.c
@@ -141,11 +141,11 @@
141 void manifest_to_disk(int vid){
142 char *zManFile;
143 Blob manifest;
144 Blob hash;
145
146 if( db_get_boolean("manifest",0) ){
147 blob_zero(&manifest);
148 content_get(vid, &manifest);
149 zManFile = mprintf("%smanifest", g.zLocalRoot);
150 blob_write_to_file(&manifest, zManFile);
151 free(zManFile);
152
--- src/checkout.c
+++ src/checkout.c
@@ -141,11 +141,11 @@
141 void manifest_to_disk(int vid){
142 char *zManFile;
143 Blob manifest;
144 Blob hash;
145
146 if( db_get_versionable_setting_boolean("manifest",0) ){
147 blob_zero(&manifest);
148 content_get(vid, &manifest);
149 zManFile = mprintf("%smanifest", g.zLocalRoot);
150 blob_write_to_file(&manifest, zManFile);
151 free(zManFile);
152
+1 -1
--- src/merge.c
+++ src/merge.c
@@ -91,11 +91,11 @@
9191
zPivot = find_option("baseline",0,1);
9292
if( g.argc!=3 ){
9393
usage("VERSION");
9494
}
9595
db_must_be_within_tree();
96
- if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0);
96
+ if( zBinGlob==0 ) zBinGlob = db_get_versionable_setting("binary-glob",0);
9797
vid = db_lget_int("checkout", 0);
9898
if( vid==0 ){
9999
fossil_fatal("nothing is checked out");
100100
}
101101
mid = name_to_rid(g.argv[2]);
102102
--- src/merge.c
+++ src/merge.c
@@ -91,11 +91,11 @@
91 zPivot = find_option("baseline",0,1);
92 if( g.argc!=3 ){
93 usage("VERSION");
94 }
95 db_must_be_within_tree();
96 if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0);
97 vid = db_lget_int("checkout", 0);
98 if( vid==0 ){
99 fossil_fatal("nothing is checked out");
100 }
101 mid = name_to_rid(g.argv[2]);
102
--- src/merge.c
+++ src/merge.c
@@ -91,11 +91,11 @@
91 zPivot = find_option("baseline",0,1);
92 if( g.argc!=3 ){
93 usage("VERSION");
94 }
95 db_must_be_within_tree();
96 if( zBinGlob==0 ) zBinGlob = db_get_versionable_setting("binary-glob",0);
97 vid = db_lget_int("checkout", 0);
98 if( vid==0 ){
99 fossil_fatal("nothing is checked out");
100 }
101 mid = name_to_rid(g.argv[2]);
102
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -215,11 +215,11 @@
215215
nPrefix = blob_size(&filename);
216216
217217
pManifest = manifest_get(rid, CFTYPE_MANIFEST);
218218
if( pManifest ){
219219
mTime = (pManifest->rDate - 2440587.5)*86400.0;
220
- if( db_get_boolean("manifest", 0) ){
220
+ if( db_get_versionable_setting_boolean("manifest", 0) ){
221221
blob_append(&filename, "manifest", -1);
222222
zName = blob_str(&filename);
223223
tar_add_file(zName, &mfile, 0, mTime);
224224
sha1sum_blob(&mfile, &hash);
225225
blob_reset(&mfile);
226226
--- src/tar.c
+++ src/tar.c
@@ -215,11 +215,11 @@
215 nPrefix = blob_size(&filename);
216
217 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
218 if( pManifest ){
219 mTime = (pManifest->rDate - 2440587.5)*86400.0;
220 if( db_get_boolean("manifest", 0) ){
221 blob_append(&filename, "manifest", -1);
222 zName = blob_str(&filename);
223 tar_add_file(zName, &mfile, 0, mTime);
224 sha1sum_blob(&mfile, &hash);
225 blob_reset(&mfile);
226
--- src/tar.c
+++ src/tar.c
@@ -215,11 +215,11 @@
215 nPrefix = blob_size(&filename);
216
217 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
218 if( pManifest ){
219 mTime = (pManifest->rDate - 2440587.5)*86400.0;
220 if( db_get_versionable_setting_boolean("manifest", 0) ){
221 blob_append(&filename, "manifest", -1);
222 zName = blob_str(&filename);
223 tar_add_file(zName, &mfile, 0, mTime);
224 sha1sum_blob(&mfile, &hash);
225 blob_reset(&mfile);
226
+1 -1
--- src/zip.c
+++ src/zip.c
@@ -337,11 +337,11 @@
337337
338338
pManifest = manifest_get(rid, CFTYPE_MANIFEST);
339339
if( pManifest ){
340340
char *zName;
341341
zip_set_timedate(pManifest->rDate);
342
- if( db_get_boolean("manifest", 0) ){
342
+ if( db_get_versionable_setting_boolean("manifest", 0) ){
343343
blob_append(&filename, "manifest", -1);
344344
zName = blob_str(&filename);
345345
zip_add_folders(zName);
346346
zip_add_file(zName, &mfile, 0);
347347
sha1sum_blob(&mfile, &hash);
348348
--- src/zip.c
+++ src/zip.c
@@ -337,11 +337,11 @@
337
338 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
339 if( pManifest ){
340 char *zName;
341 zip_set_timedate(pManifest->rDate);
342 if( db_get_boolean("manifest", 0) ){
343 blob_append(&filename, "manifest", -1);
344 zName = blob_str(&filename);
345 zip_add_folders(zName);
346 zip_add_file(zName, &mfile, 0);
347 sha1sum_blob(&mfile, &hash);
348
--- src/zip.c
+++ src/zip.c
@@ -337,11 +337,11 @@
337
338 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
339 if( pManifest ){
340 char *zName;
341 zip_set_timedate(pManifest->rDate);
342 if( db_get_versionable_setting_boolean("manifest", 0) ){
343 blob_append(&filename, "manifest", -1);
344 zName = blob_str(&filename);
345 zip_add_folders(zName);
346 zip_add_file(zName, &mfile, 0);
347 sha1sum_blob(&mfile, &hash);
348

Keyboard Shortcuts

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