Fossil SCM

Here is a possible solution to the versioned "manifest" setting. Needs lots of testing.

drh 2025-03-12 21:48 UTC trunk
Commit eb41a9f3c4493eba64e5bd26ad9bd41a5e4b03852ca25bdf3a9a051b8795109b
+1 -1
--- src/add.c
+++ src/add.c
@@ -78,11 +78,11 @@
7878
static int numManifests;
7979
8080
if( cachedManifest == -1 ){
8181
int i;
8282
Blob repo;
83
- cachedManifest = db_get_manifest_setting();
83
+ cachedManifest = db_get_manifest_setting(0);
8484
numManifests = 0;
8585
for(i=0; i<count(aManifestflags); i++){
8686
if( cachedManifest&aManifestflags[i].flg ) {
8787
azManifests[numManifests++] = aManifestflags[i].fname;
8888
}
8989
--- src/add.c
+++ src/add.c
@@ -78,11 +78,11 @@
78 static int numManifests;
79
80 if( cachedManifest == -1 ){
81 int i;
82 Blob repo;
83 cachedManifest = db_get_manifest_setting();
84 numManifests = 0;
85 for(i=0; i<count(aManifestflags); i++){
86 if( cachedManifest&aManifestflags[i].flg ) {
87 azManifests[numManifests++] = aManifestflags[i].fname;
88 }
89
--- src/add.c
+++ src/add.c
@@ -78,11 +78,11 @@
78 static int numManifests;
79
80 if( cachedManifest == -1 ){
81 int i;
82 Blob repo;
83 cachedManifest = db_get_manifest_setting(0);
84 numManifests = 0;
85 for(i=0; i<count(aManifestflags); i++){
86 if( cachedManifest&aManifestflags[i].flg ) {
87 azManifests[numManifests++] = aManifestflags[i].fname;
88 }
89
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -2553,11 +2553,11 @@
25532553
sCiInfo.zUserOvrd = find_option("user-override",0,1);
25542554
noSign = db_get_boolean("omitsign", 0)|noSign;
25552555
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
25562556
useCksum = db_get_boolean("repo-cksum", 1);
25572557
bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0;
2558
- outputManifest = db_get_manifest_setting();
2558
+ outputManifest = db_get_manifest_setting(0);
25592559
mxSize = db_large_file_size();
25602560
if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0;
25612561
verify_all_options();
25622562
25632563
/* Get the ID of the parent manifest artifact */
25642564
--- src/checkin.c
+++ src/checkin.c
@@ -2553,11 +2553,11 @@
2553 sCiInfo.zUserOvrd = find_option("user-override",0,1);
2554 noSign = db_get_boolean("omitsign", 0)|noSign;
2555 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
2556 useCksum = db_get_boolean("repo-cksum", 1);
2557 bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0;
2558 outputManifest = db_get_manifest_setting();
2559 mxSize = db_large_file_size();
2560 if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0;
2561 verify_all_options();
2562
2563 /* Get the ID of the parent manifest artifact */
2564
--- src/checkin.c
+++ src/checkin.c
@@ -2553,11 +2553,11 @@
2553 sCiInfo.zUserOvrd = find_option("user-override",0,1);
2554 noSign = db_get_boolean("omitsign", 0)|noSign;
2555 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
2556 useCksum = db_get_boolean("repo-cksum", 1);
2557 bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0;
2558 outputManifest = db_get_manifest_setting(0);
2559 mxSize = db_large_file_size();
2560 if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0;
2561 verify_all_options();
2562
2563 /* Get the ID of the parent manifest artifact */
2564
+1 -1
--- src/checkout.c
+++ src/checkout.c
@@ -173,11 +173,11 @@
173173
*/
174174
void manifest_to_disk(int vid){
175175
char *zManFile;
176176
int flg;
177177
178
- flg = db_get_manifest_setting();
178
+ flg = db_get_manifest_setting(0);
179179
180180
if( flg & MFESTFLG_RAW ){
181181
Blob manifest = BLOB_INITIALIZER;
182182
content_get(vid, &manifest);
183183
sterilize_manifest(&manifest, CFTYPE_MANIFEST);
184184
--- src/checkout.c
+++ src/checkout.c
@@ -173,11 +173,11 @@
173 */
174 void manifest_to_disk(int vid){
175 char *zManFile;
176 int flg;
177
178 flg = db_get_manifest_setting();
179
180 if( flg & MFESTFLG_RAW ){
181 Blob manifest = BLOB_INITIALIZER;
182 content_get(vid, &manifest);
183 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
184
--- src/checkout.c
+++ src/checkout.c
@@ -173,11 +173,11 @@
173 */
174 void manifest_to_disk(int vid){
175 char *zManFile;
176 int flg;
177
178 flg = db_get_manifest_setting(0);
179
180 if( flg & MFESTFLG_RAW ){
181 Blob manifest = BLOB_INITIALIZER;
182 content_get(vid, &manifest);
183 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
184
+136 -53
--- src/db.c
+++ src/db.c
@@ -3647,66 +3647,79 @@
36473647
**
36483648
** If the zNonVersionedSetting parameter is not NULL then it holds the
36493649
** non-versioned value for this setting. If both a versioned and a
36503650
** non-versioned value exist and are not equal, then a warning message
36513651
** might be generated.
3652
+**
3653
+** zCkin is normally NULL. In that case, the versioned setting is
3654
+** take from the local check-out, if a local checkout exists, or from
3655
+** checkin named by the g.zOpenRevision global variable. If zCkin is
3656
+** not NULL, then zCkin is the name of the specific checkin from which
3657
+** versioned setting value is taken. When zCkin is not NULL, the cache
3658
+** is bypassed.
36523659
*/
3653
-char *db_get_versioned(const char *zName, char *zNonVersionedSetting){
3660
+char *db_get_versioned(
3661
+ const char *zName,
3662
+ char *zNonVersionedSetting,
3663
+ const char *zCkin
3664
+){
36543665
char *zVersionedSetting = 0;
36553666
int noWarn = 0;
36563667
int found = 0;
36573668
struct _cacheEntry {
36583669
struct _cacheEntry *next;
36593670
const char *zName, *zValue;
36603671
} *cacheEntry = 0;
36613672
static struct _cacheEntry *cache = 0;
36623673
3663
- if( !g.localOpen && g.zOpenRevision==0 ) return zNonVersionedSetting;
3674
+ if( !g.localOpen && g.zOpenRevision==0 && zCkin==0 ){
3675
+ return zNonVersionedSetting;
3676
+ }
3677
+
36643678
/* Look up name in cache */
3665
- cacheEntry = cache;
3666
- while( cacheEntry!=0 ){
3667
- if( fossil_strcmp(cacheEntry->zName, zName)==0 ){
3668
- zVersionedSetting = fossil_strdup(cacheEntry->zValue);
3669
- break;
3670
- }
3671
- cacheEntry = cacheEntry->next;
3672
- }
3679
+ if( zCkin==0 ){
3680
+ cacheEntry = cache;
3681
+ while( cacheEntry!=0 ){
3682
+ if( fossil_strcmp(cacheEntry->zName, zName)==0 ){
3683
+ zVersionedSetting = fossil_strdup(cacheEntry->zValue);
3684
+ break;
3685
+ }
3686
+ cacheEntry = cacheEntry->next;
3687
+ }
3688
+ }
3689
+
36733690
/* Attempt to read value from file in check-out if there wasn't a cache hit.*/
36743691
if( cacheEntry==0 ){
36753692
Blob versionedPathname;
36763693
Blob setting;
3677
- blob_zero(&versionedPathname);
3678
- blob_zero(&setting);
3679
- blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
3680
- g.zLocalRoot, zName);
3681
- if( !g.localOpen ){
3682
- /* Repository is in the process of being opened, but files have not been
3683
- * written to disk. Load from the database. */
3684
- Blob noWarnFile;
3685
- if( historical_blob(g.zOpenRevision, blob_str(&versionedPathname),
3686
- &setting, 0) ){
3687
- found = 1;
3688
- }
3689
- /* See if there's a no-warn flag */
3690
- blob_append(&versionedPathname, ".no-warn", -1);
3691
- blob_zero(&noWarnFile);
3692
- if( historical_blob(g.zOpenRevision, blob_str(&versionedPathname),
3693
- &noWarnFile, 0) ){
3694
- noWarn = 1;
3695
- }
3696
- blob_reset(&noWarnFile);
3697
- }else if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3698
- /* File exists, and contains the value for this setting. Load from
3699
- ** the file. */
3700
- const char *zFile = blob_str(&versionedPathname);
3701
- if( blob_read_from_file(&setting, zFile, ExtFILE)>=0 ){
3702
- found = 1;
3703
- }
3704
- /* See if there's a no-warn flag */
3705
- blob_append(&versionedPathname, ".no-warn", -1);
3706
- if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3707
- noWarn = 1;
3694
+ blob_init(&versionedPathname, 0, 0);
3695
+ blob_init(&setting, 0, 0);
3696
+ if( !g.localOpen || zCkin!=0 ){
3697
+ /* Repository is in the process of being opened, but files have not been
3698
+ * written to disk. Load from the database. */
3699
+ blob_appendf(&versionedPathname, ".fossil-settings/%s", zName);
3700
+ if( historical_blob(zCkin ? zCkin : g.zOpenRevision,
3701
+ blob_str(&versionedPathname),
3702
+ &setting, 0)
3703
+ ){
3704
+ found = 1;
3705
+ }
3706
+ }else{
3707
+ blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
3708
+ g.zLocalRoot, zName);
3709
+ if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3710
+ /* File exists, and contains the value for this setting. Load from
3711
+ ** the file. */
3712
+ const char *zFile = blob_str(&versionedPathname);
3713
+ if( blob_read_from_file(&setting, zFile, ExtFILE)>=0 ){
3714
+ found = 1;
3715
+ }
3716
+ /* See if there's a no-warn flag */
3717
+ blob_append(&versionedPathname, ".no-warn", -1);
3718
+ if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3719
+ noWarn = 1;
3720
+ }
37083721
}
37093722
}
37103723
blob_reset(&versionedPathname);
37113724
if( found ){
37123725
blob_strip_comment_lines(&setting, &setting);
@@ -3713,20 +3726,27 @@
37133726
blob_trim(&setting); /* Avoid non-obvious problems with line endings
37143727
** on boolean properties */
37153728
zVersionedSetting = fossil_strdup(blob_str(&setting));
37163729
}
37173730
blob_reset(&setting);
3731
+
37183732
/* Store result in cache, which can be the value or 0 if not found */
3719
- cacheEntry = (struct _cacheEntry*)fossil_malloc(sizeof(struct _cacheEntry));
3720
- cacheEntry->next = cache;
3721
- cacheEntry->zName = zName;
3722
- cacheEntry->zValue = fossil_strdup(zVersionedSetting);
3723
- cache = cacheEntry;
3733
+ if( zCkin==0 ){
3734
+ cacheEntry = (struct _cacheEntry*)fossil_malloc(sizeof(*cacheEntry));
3735
+ cacheEntry->next = cache;
3736
+ cacheEntry->zName = zName;
3737
+ cacheEntry->zValue = fossil_strdup(zVersionedSetting);
3738
+ cache = cacheEntry;
3739
+ }
37243740
}
3741
+
37253742
/* Display a warning? */
3726
- if( zVersionedSetting!=0 && zNonVersionedSetting!=0
3727
- && zNonVersionedSetting[0]!='\0' && !noWarn
3743
+ if( zVersionedSetting!=0
3744
+ && zNonVersionedSetting!=0
3745
+ && zNonVersionedSetting[0]!='\0'
3746
+ && zCkin==0
3747
+ && !noWarn
37283748
){
37293749
/* There's a versioned setting, and a non-versioned setting. Tell
37303750
** the user about the conflict */
37313751
fossil_warning(
37323752
"setting %s has both versioned and non-versioned values: using "
@@ -3735,10 +3755,11 @@
37353755
"\"%/.fossil-settings/%s.no-warn\" in the check-out root, or delete "
37363756
"the non-versioned setting with \"fossil unset %s\")", zName,
37373757
g.zLocalRoot, zName, g.zLocalRoot, zName, zName
37383758
);
37393759
}
3760
+
37403761
/* Prefer the versioned setting */
37413762
return ( zVersionedSetting!=0 ) ? zVersionedSetting : zNonVersionedSetting;
37423763
}
37433764
37443765
@@ -3778,11 +3799,11 @@
37783799
}
37793800
if( pSetting!=0 && pSetting->versionable ){
37803801
/* This is a versionable setting, try and get the info from a
37813802
** checked-out file */
37823803
char * zZ = z;
3783
- z = db_get_versioned(zName, z);
3804
+ z = db_get_versioned(zName, z, 0);
37843805
if(zZ != z){
37853806
fossil_free(zZ);
37863807
}
37873808
}
37883809
if( z==0 ){
@@ -3919,11 +3940,11 @@
39193940
}
39203941
fossil_free(zVal);
39213942
return dflt;
39223943
}
39233944
int db_get_versioned_boolean(const char *zName, int dflt){
3924
- char *zVal = db_get_versioned(zName, 0);
3945
+ char *zVal = db_get_versioned(zName, 0, 0);
39253946
if( zVal==0 ) return dflt;
39263947
if( is_truth(zVal) ) return 1;
39273948
if( is_false(zVal) ) return 0;
39283949
return dflt;
39293950
}
@@ -4048,14 +4069,49 @@
40484069
** Get the manifest setting. For backwards compatibility first check if the
40494070
** value is a boolean. If it's not a boolean, treat each character as a flag
40504071
** to enable a manifest type. This system puts certain boundary conditions on
40514072
** which letters can be used to represent flags (any permutation of flags must
40524073
** not be able to fully form one of the boolean values).
4074
+**
4075
+** "manifest" is a versionable setting. But we do not issue a warning
4076
+** if there is a conflict. Instead, the value returned is the value for
4077
+** the versioned setting if the versioned setting exists, or the ordinary
4078
+** setting otherwise.
4079
+**
4080
+** The argument zCkin is the specific check-in for which we want the
4081
+** manifest setting.
40534082
*/
4054
-int db_get_manifest_setting(void){
4083
+int db_get_manifest_setting(const char *zCkin){
40554084
int flg;
4056
- char *zVal = db_get("manifest", 0);
4085
+ char *zVal;
4086
+
4087
+ /* Look for the versioned setting first */
4088
+ zVal = db_get_versioned("manifest", 0, zCkin);
4089
+
4090
+ if( zVal==0 && g.repositoryOpen ){
4091
+ /* No versioned setting, look for the repository setting second */
4092
+ static char *zCached = 0;
4093
+ if( zCached ){
4094
+ zVal = zCached;
4095
+ }else{
4096
+ zVal = db_text(0, "SELECT value FROM config WHERE name='manifest'");
4097
+ }
4098
+ if( zVal==0 && g.zConfigDbName ){
4099
+ /* No repository setting either, look for a global setting */
4100
+ static Stmt q2;
4101
+ const char *zRes;
4102
+ db_swap_connections();
4103
+ db_static_prepare(&q2,
4104
+ "SELECT value FROM global_config WHERE name='manifest'");
4105
+ db_swap_connections();
4106
+ if( db_step(&q2)==SQLITE_ROW && (zRes = db_column_text(&q2,0))!=0 ){
4107
+ zVal = fossil_strdup(zRes);
4108
+ }
4109
+ db_reset(&q2);
4110
+ }
4111
+ zCached = zVal;
4112
+ }
40574113
if( zVal==0 || is_false(zVal) ){
40584114
return 0;
40594115
}else if( is_truth(zVal) ){
40604116
return MFESTFLG_RAW|MFESTFLG_UUID;
40614117
}
@@ -4068,10 +4124,37 @@
40684124
}
40694125
zVal++;
40704126
}
40714127
return flg;
40724128
}
4129
+
4130
+/*
4131
+** COMMAND: test-manifest-setting
4132
+**
4133
+** Usage: %fossil test-manifest-setting VERSION VERSION ...
4134
+**
4135
+** Display the value for the "manifest" setting for various versions
4136
+** of the repository.
4137
+*/
4138
+void test_manfest_setting_cmd(void){
4139
+ int i;
4140
+ db_find_and_open_repository(0, 0);
4141
+ for(i=2; i<g.argc; i++){
4142
+ int m = db_get_manifest_setting(g.argv[i]);
4143
+ fossil_print("%s:\n", g.argv[i]);
4144
+ fossil_print(" flags = 0x%02x\n", m);
4145
+ if( m & MFESTFLG_RAW ){
4146
+ fossil_print(" manifest\n");
4147
+ }
4148
+ if( m & MFESTFLG_UUID ){
4149
+ fossil_print(" manifest.uuid\n");
4150
+ }
4151
+ if( m & MFESTFLG_TAGS ){
4152
+ fossil_print(" manifest.tags\n");
4153
+ }
4154
+ }
4155
+}
40734156
40744157
40754158
/*
40764159
** Record the name of a local repository in the global_config() database.
40774160
** The repository filename %s is recorded as an entry with a "name" field
@@ -4391,11 +4474,11 @@
43914474
versioned = 1;
43924475
}
43934476
blob_reset(&versionedPathname);
43944477
}
43954478
if( valueOnly && versioned ){
4396
- fossil_print("%s\n", db_get_versioned(pSetting->name, NULL));
4479
+ fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
43974480
return;
43984481
}
43994482
if( g.repositoryOpen ){
44004483
db_prepare(&q,
44014484
"SELECT '(local)', value FROM config WHERE name=%Q"
44024485
--- src/db.c
+++ src/db.c
@@ -3647,66 +3647,79 @@
3647 **
3648 ** If the zNonVersionedSetting parameter is not NULL then it holds the
3649 ** non-versioned value for this setting. If both a versioned and a
3650 ** non-versioned value exist and are not equal, then a warning message
3651 ** might be generated.
 
 
 
 
 
 
 
3652 */
3653 char *db_get_versioned(const char *zName, char *zNonVersionedSetting){
 
 
 
 
3654 char *zVersionedSetting = 0;
3655 int noWarn = 0;
3656 int found = 0;
3657 struct _cacheEntry {
3658 struct _cacheEntry *next;
3659 const char *zName, *zValue;
3660 } *cacheEntry = 0;
3661 static struct _cacheEntry *cache = 0;
3662
3663 if( !g.localOpen && g.zOpenRevision==0 ) return zNonVersionedSetting;
 
 
 
3664 /* Look up name in cache */
3665 cacheEntry = cache;
3666 while( cacheEntry!=0 ){
3667 if( fossil_strcmp(cacheEntry->zName, zName)==0 ){
3668 zVersionedSetting = fossil_strdup(cacheEntry->zValue);
3669 break;
3670 }
3671 cacheEntry = cacheEntry->next;
3672 }
 
 
 
3673 /* Attempt to read value from file in check-out if there wasn't a cache hit.*/
3674 if( cacheEntry==0 ){
3675 Blob versionedPathname;
3676 Blob setting;
3677 blob_zero(&versionedPathname);
3678 blob_zero(&setting);
3679 blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
3680 g.zLocalRoot, zName);
3681 if( !g.localOpen ){
3682 /* Repository is in the process of being opened, but files have not been
3683 * written to disk. Load from the database. */
3684 Blob noWarnFile;
3685 if( historical_blob(g.zOpenRevision, blob_str(&versionedPathname),
3686 &setting, 0) ){
3687 found = 1;
3688 }
3689 /* See if there's a no-warn flag */
3690 blob_append(&versionedPathname, ".no-warn", -1);
3691 blob_zero(&noWarnFile);
3692 if( historical_blob(g.zOpenRevision, blob_str(&versionedPathname),
3693 &noWarnFile, 0) ){
3694 noWarn = 1;
3695 }
3696 blob_reset(&noWarnFile);
3697 }else if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3698 /* File exists, and contains the value for this setting. Load from
3699 ** the file. */
3700 const char *zFile = blob_str(&versionedPathname);
3701 if( blob_read_from_file(&setting, zFile, ExtFILE)>=0 ){
3702 found = 1;
3703 }
3704 /* See if there's a no-warn flag */
3705 blob_append(&versionedPathname, ".no-warn", -1);
3706 if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3707 noWarn = 1;
3708 }
3709 }
3710 blob_reset(&versionedPathname);
3711 if( found ){
3712 blob_strip_comment_lines(&setting, &setting);
@@ -3713,20 +3726,27 @@
3713 blob_trim(&setting); /* Avoid non-obvious problems with line endings
3714 ** on boolean properties */
3715 zVersionedSetting = fossil_strdup(blob_str(&setting));
3716 }
3717 blob_reset(&setting);
 
3718 /* Store result in cache, which can be the value or 0 if not found */
3719 cacheEntry = (struct _cacheEntry*)fossil_malloc(sizeof(struct _cacheEntry));
3720 cacheEntry->next = cache;
3721 cacheEntry->zName = zName;
3722 cacheEntry->zValue = fossil_strdup(zVersionedSetting);
3723 cache = cacheEntry;
 
 
3724 }
 
3725 /* Display a warning? */
3726 if( zVersionedSetting!=0 && zNonVersionedSetting!=0
3727 && zNonVersionedSetting[0]!='\0' && !noWarn
 
 
 
3728 ){
3729 /* There's a versioned setting, and a non-versioned setting. Tell
3730 ** the user about the conflict */
3731 fossil_warning(
3732 "setting %s has both versioned and non-versioned values: using "
@@ -3735,10 +3755,11 @@
3735 "\"%/.fossil-settings/%s.no-warn\" in the check-out root, or delete "
3736 "the non-versioned setting with \"fossil unset %s\")", zName,
3737 g.zLocalRoot, zName, g.zLocalRoot, zName, zName
3738 );
3739 }
 
3740 /* Prefer the versioned setting */
3741 return ( zVersionedSetting!=0 ) ? zVersionedSetting : zNonVersionedSetting;
3742 }
3743
3744
@@ -3778,11 +3799,11 @@
3778 }
3779 if( pSetting!=0 && pSetting->versionable ){
3780 /* This is a versionable setting, try and get the info from a
3781 ** checked-out file */
3782 char * zZ = z;
3783 z = db_get_versioned(zName, z);
3784 if(zZ != z){
3785 fossil_free(zZ);
3786 }
3787 }
3788 if( z==0 ){
@@ -3919,11 +3940,11 @@
3919 }
3920 fossil_free(zVal);
3921 return dflt;
3922 }
3923 int db_get_versioned_boolean(const char *zName, int dflt){
3924 char *zVal = db_get_versioned(zName, 0);
3925 if( zVal==0 ) return dflt;
3926 if( is_truth(zVal) ) return 1;
3927 if( is_false(zVal) ) return 0;
3928 return dflt;
3929 }
@@ -4048,14 +4069,49 @@
4048 ** Get the manifest setting. For backwards compatibility first check if the
4049 ** value is a boolean. If it's not a boolean, treat each character as a flag
4050 ** to enable a manifest type. This system puts certain boundary conditions on
4051 ** which letters can be used to represent flags (any permutation of flags must
4052 ** not be able to fully form one of the boolean values).
 
 
 
 
 
 
 
 
4053 */
4054 int db_get_manifest_setting(void){
4055 int flg;
4056 char *zVal = db_get("manifest", 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4057 if( zVal==0 || is_false(zVal) ){
4058 return 0;
4059 }else if( is_truth(zVal) ){
4060 return MFESTFLG_RAW|MFESTFLG_UUID;
4061 }
@@ -4068,10 +4124,37 @@
4068 }
4069 zVal++;
4070 }
4071 return flg;
4072 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4073
4074
4075 /*
4076 ** Record the name of a local repository in the global_config() database.
4077 ** The repository filename %s is recorded as an entry with a "name" field
@@ -4391,11 +4474,11 @@
4391 versioned = 1;
4392 }
4393 blob_reset(&versionedPathname);
4394 }
4395 if( valueOnly && versioned ){
4396 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL));
4397 return;
4398 }
4399 if( g.repositoryOpen ){
4400 db_prepare(&q,
4401 "SELECT '(local)', value FROM config WHERE name=%Q"
4402
--- src/db.c
+++ src/db.c
@@ -3647,66 +3647,79 @@
3647 **
3648 ** If the zNonVersionedSetting parameter is not NULL then it holds the
3649 ** non-versioned value for this setting. If both a versioned and a
3650 ** non-versioned value exist and are not equal, then a warning message
3651 ** might be generated.
3652 **
3653 ** zCkin is normally NULL. In that case, the versioned setting is
3654 ** take from the local check-out, if a local checkout exists, or from
3655 ** checkin named by the g.zOpenRevision global variable. If zCkin is
3656 ** not NULL, then zCkin is the name of the specific checkin from which
3657 ** versioned setting value is taken. When zCkin is not NULL, the cache
3658 ** is bypassed.
3659 */
3660 char *db_get_versioned(
3661 const char *zName,
3662 char *zNonVersionedSetting,
3663 const char *zCkin
3664 ){
3665 char *zVersionedSetting = 0;
3666 int noWarn = 0;
3667 int found = 0;
3668 struct _cacheEntry {
3669 struct _cacheEntry *next;
3670 const char *zName, *zValue;
3671 } *cacheEntry = 0;
3672 static struct _cacheEntry *cache = 0;
3673
3674 if( !g.localOpen && g.zOpenRevision==0 && zCkin==0 ){
3675 return zNonVersionedSetting;
3676 }
3677
3678 /* Look up name in cache */
3679 if( zCkin==0 ){
3680 cacheEntry = cache;
3681 while( cacheEntry!=0 ){
3682 if( fossil_strcmp(cacheEntry->zName, zName)==0 ){
3683 zVersionedSetting = fossil_strdup(cacheEntry->zValue);
3684 break;
3685 }
3686 cacheEntry = cacheEntry->next;
3687 }
3688 }
3689
3690 /* Attempt to read value from file in check-out if there wasn't a cache hit.*/
3691 if( cacheEntry==0 ){
3692 Blob versionedPathname;
3693 Blob setting;
3694 blob_init(&versionedPathname, 0, 0);
3695 blob_init(&setting, 0, 0);
3696 if( !g.localOpen || zCkin!=0 ){
3697 /* Repository is in the process of being opened, but files have not been
3698 * written to disk. Load from the database. */
3699 blob_appendf(&versionedPathname, ".fossil-settings/%s", zName);
3700 if( historical_blob(zCkin ? zCkin : g.zOpenRevision,
3701 blob_str(&versionedPathname),
3702 &setting, 0)
3703 ){
3704 found = 1;
3705 }
3706 }else{
3707 blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
3708 g.zLocalRoot, zName);
3709 if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3710 /* File exists, and contains the value for this setting. Load from
3711 ** the file. */
3712 const char *zFile = blob_str(&versionedPathname);
3713 if( blob_read_from_file(&setting, zFile, ExtFILE)>=0 ){
3714 found = 1;
3715 }
3716 /* See if there's a no-warn flag */
3717 blob_append(&versionedPathname, ".no-warn", -1);
3718 if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
3719 noWarn = 1;
3720 }
 
 
 
 
3721 }
3722 }
3723 blob_reset(&versionedPathname);
3724 if( found ){
3725 blob_strip_comment_lines(&setting, &setting);
@@ -3713,20 +3726,27 @@
3726 blob_trim(&setting); /* Avoid non-obvious problems with line endings
3727 ** on boolean properties */
3728 zVersionedSetting = fossil_strdup(blob_str(&setting));
3729 }
3730 blob_reset(&setting);
3731
3732 /* Store result in cache, which can be the value or 0 if not found */
3733 if( zCkin==0 ){
3734 cacheEntry = (struct _cacheEntry*)fossil_malloc(sizeof(*cacheEntry));
3735 cacheEntry->next = cache;
3736 cacheEntry->zName = zName;
3737 cacheEntry->zValue = fossil_strdup(zVersionedSetting);
3738 cache = cacheEntry;
3739 }
3740 }
3741
3742 /* Display a warning? */
3743 if( zVersionedSetting!=0
3744 && zNonVersionedSetting!=0
3745 && zNonVersionedSetting[0]!='\0'
3746 && zCkin==0
3747 && !noWarn
3748 ){
3749 /* There's a versioned setting, and a non-versioned setting. Tell
3750 ** the user about the conflict */
3751 fossil_warning(
3752 "setting %s has both versioned and non-versioned values: using "
@@ -3735,10 +3755,11 @@
3755 "\"%/.fossil-settings/%s.no-warn\" in the check-out root, or delete "
3756 "the non-versioned setting with \"fossil unset %s\")", zName,
3757 g.zLocalRoot, zName, g.zLocalRoot, zName, zName
3758 );
3759 }
3760
3761 /* Prefer the versioned setting */
3762 return ( zVersionedSetting!=0 ) ? zVersionedSetting : zNonVersionedSetting;
3763 }
3764
3765
@@ -3778,11 +3799,11 @@
3799 }
3800 if( pSetting!=0 && pSetting->versionable ){
3801 /* This is a versionable setting, try and get the info from a
3802 ** checked-out file */
3803 char * zZ = z;
3804 z = db_get_versioned(zName, z, 0);
3805 if(zZ != z){
3806 fossil_free(zZ);
3807 }
3808 }
3809 if( z==0 ){
@@ -3919,11 +3940,11 @@
3940 }
3941 fossil_free(zVal);
3942 return dflt;
3943 }
3944 int db_get_versioned_boolean(const char *zName, int dflt){
3945 char *zVal = db_get_versioned(zName, 0, 0);
3946 if( zVal==0 ) return dflt;
3947 if( is_truth(zVal) ) return 1;
3948 if( is_false(zVal) ) return 0;
3949 return dflt;
3950 }
@@ -4048,14 +4069,49 @@
4069 ** Get the manifest setting. For backwards compatibility first check if the
4070 ** value is a boolean. If it's not a boolean, treat each character as a flag
4071 ** to enable a manifest type. This system puts certain boundary conditions on
4072 ** which letters can be used to represent flags (any permutation of flags must
4073 ** not be able to fully form one of the boolean values).
4074 **
4075 ** "manifest" is a versionable setting. But we do not issue a warning
4076 ** if there is a conflict. Instead, the value returned is the value for
4077 ** the versioned setting if the versioned setting exists, or the ordinary
4078 ** setting otherwise.
4079 **
4080 ** The argument zCkin is the specific check-in for which we want the
4081 ** manifest setting.
4082 */
4083 int db_get_manifest_setting(const char *zCkin){
4084 int flg;
4085 char *zVal;
4086
4087 /* Look for the versioned setting first */
4088 zVal = db_get_versioned("manifest", 0, zCkin);
4089
4090 if( zVal==0 && g.repositoryOpen ){
4091 /* No versioned setting, look for the repository setting second */
4092 static char *zCached = 0;
4093 if( zCached ){
4094 zVal = zCached;
4095 }else{
4096 zVal = db_text(0, "SELECT value FROM config WHERE name='manifest'");
4097 }
4098 if( zVal==0 && g.zConfigDbName ){
4099 /* No repository setting either, look for a global setting */
4100 static Stmt q2;
4101 const char *zRes;
4102 db_swap_connections();
4103 db_static_prepare(&q2,
4104 "SELECT value FROM global_config WHERE name='manifest'");
4105 db_swap_connections();
4106 if( db_step(&q2)==SQLITE_ROW && (zRes = db_column_text(&q2,0))!=0 ){
4107 zVal = fossil_strdup(zRes);
4108 }
4109 db_reset(&q2);
4110 }
4111 zCached = zVal;
4112 }
4113 if( zVal==0 || is_false(zVal) ){
4114 return 0;
4115 }else if( is_truth(zVal) ){
4116 return MFESTFLG_RAW|MFESTFLG_UUID;
4117 }
@@ -4068,10 +4124,37 @@
4124 }
4125 zVal++;
4126 }
4127 return flg;
4128 }
4129
4130 /*
4131 ** COMMAND: test-manifest-setting
4132 **
4133 ** Usage: %fossil test-manifest-setting VERSION VERSION ...
4134 **
4135 ** Display the value for the "manifest" setting for various versions
4136 ** of the repository.
4137 */
4138 void test_manfest_setting_cmd(void){
4139 int i;
4140 db_find_and_open_repository(0, 0);
4141 for(i=2; i<g.argc; i++){
4142 int m = db_get_manifest_setting(g.argv[i]);
4143 fossil_print("%s:\n", g.argv[i]);
4144 fossil_print(" flags = 0x%02x\n", m);
4145 if( m & MFESTFLG_RAW ){
4146 fossil_print(" manifest\n");
4147 }
4148 if( m & MFESTFLG_UUID ){
4149 fossil_print(" manifest.uuid\n");
4150 }
4151 if( m & MFESTFLG_TAGS ){
4152 fossil_print(" manifest.tags\n");
4153 }
4154 }
4155 }
4156
4157
4158 /*
4159 ** Record the name of a local repository in the global_config() database.
4160 ** The repository filename %s is recorded as an entry with a "name" field
@@ -4391,11 +4474,11 @@
4474 versioned = 1;
4475 }
4476 blob_reset(&versionedPathname);
4477 }
4478 if( valueOnly && versioned ){
4479 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4480 return;
4481 }
4482 if( g.repositoryOpen ){
4483 db_prepare(&q,
4484 "SELECT '(local)', value FROM config WHERE name=%Q"
4485
+5 -8
--- src/export.c
+++ src/export.c
@@ -1074,12 +1074,11 @@
10741074
*/
10751075
static int gitmirror_send_checkin(
10761076
FILE *xCmd, /* Write fast-import text on this pipe */
10771077
int rid, /* BLOB.RID for the check-in to export */
10781078
const char *zUuid, /* BLOB.UUID for the check-in to export */
1079
- int *pnLimit, /* Stop when the counter reaches zero */
1080
- int fManifest /* MFESTFLG_* values */
1079
+ int *pnLimit /* Stop when the counter reaches zero */
10811080
){
10821081
Manifest *pMan; /* The check-in to be output */
10831082
int i; /* Loop counter */
10841083
int iParent; /* Which immediate ancestor is primary. -1 for none */
10851084
Stmt q; /* An SQL query */
@@ -1089,10 +1088,11 @@
10891088
Blob comment; /* The comment text for the check-in */
10901089
int nErr = 0; /* Number of errors */
10911090
int bPhantomOk; /* True if phantom files should be ignored */
10921091
char buf[24];
10931092
char *zEmail; /* Contact info for Git committer field */
1093
+ int fManifest; /* Should the manifest files be included? */
10941094
10951095
pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
10961096
if( pMan==0 ){
10971097
/* Must be a phantom. Return without doing anything, and in particular
10981098
** without creating a mark for this check-in. */
@@ -1106,11 +1106,11 @@
11061106
char *zPMark = gitmirror_find_mark(pMan->azParent[i], 0, 0);
11071107
if( zPMark==0 ){
11081108
int prid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q",
11091109
pMan->azParent[i]);
11101110
int rc = gitmirror_send_checkin(xCmd, prid, pMan->azParent[i],
1111
- pnLimit, fManifest);
1111
+ pnLimit);
11121112
if( rc || *pnLimit<=0 ){
11131113
manifest_destroy(pMan);
11141114
return 1;
11151115
}
11161116
}
@@ -1271,10 +1271,11 @@
12711271
db_finalize(&q);
12721272
manifest_destroy(pMan);
12731273
pMan = 0;
12741274
12751275
/* Include Fossil-generated auxiliary files in the check-in */
1276
+ fManifest = db_get_manifest_setting(zUuid);
12761277
if( fManifest & MFESTFLG_RAW ){
12771278
Blob manifest;
12781279
content_get(rid, &manifest);
12791280
sterilize_manifest(&manifest, CFTYPE_MANIFEST);
12801281
fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
@@ -1383,11 +1384,10 @@
13831384
char *zPushUrl; /* URL to sync the mirror to */
13841385
double rEnd; /* time of most recent export */
13851386
int rc; /* Result code */
13861387
int bForce; /* Do the export and sync even if no changes*/
13871388
int bNeedRepack = 0; /* True if we should run repack at the end */
1388
- int fManifest; /* Current "manifest" setting */
13891389
int bIfExists; /* The --if-mirrored flag */
13901390
FILE *xCmd; /* Pipe to the "git fast-import" command */
13911391
FILE *pMarks; /* Git mark files */
13921392
Stmt q; /* Queries */
13931393
char zLine[200]; /* One line of a mark file */
@@ -1521,13 +1521,10 @@
15211521
gitmirror_message(VERB_NORMAL, "no changes\n");
15221522
db_commit_transaction();
15231523
return;
15241524
}
15251525
1526
- /* Do we need to include manifest files in the clone? */
1527
- fManifest = db_get_manifest_setting();
1528
-
15291526
/* Change to the MIRROR directory so that the Git commands will work */
15301527
rc = file_chdir(zMirror, 0);
15311528
if( rc ) fossil_fatal("cannot change the working directory to \"%s\"",
15321529
zMirror);
15331530
@@ -1579,11 +1576,11 @@
15791576
while( nLimit && db_step(&q)==SQLITE_ROW ){
15801577
int rid = db_column_int(&q, 0);
15811578
double rMTime = db_column_double(&q, 1);
15821579
const char *zUuid = db_column_text(&q, 2);
15831580
if( rMTime>rEnd ) rEnd = rMTime;
1584
- rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit, fManifest);
1581
+ rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit);
15851582
if( rc ) break;
15861583
gitmirror_message(VERB_NORMAL,"%d/%d \r", nTotal-nLimit, nTotal);
15871584
fflush(stdout);
15881585
}
15891586
db_finalize(&q);
15901587
--- src/export.c
+++ src/export.c
@@ -1074,12 +1074,11 @@
1074 */
1075 static int gitmirror_send_checkin(
1076 FILE *xCmd, /* Write fast-import text on this pipe */
1077 int rid, /* BLOB.RID for the check-in to export */
1078 const char *zUuid, /* BLOB.UUID for the check-in to export */
1079 int *pnLimit, /* Stop when the counter reaches zero */
1080 int fManifest /* MFESTFLG_* values */
1081 ){
1082 Manifest *pMan; /* The check-in to be output */
1083 int i; /* Loop counter */
1084 int iParent; /* Which immediate ancestor is primary. -1 for none */
1085 Stmt q; /* An SQL query */
@@ -1089,10 +1088,11 @@
1089 Blob comment; /* The comment text for the check-in */
1090 int nErr = 0; /* Number of errors */
1091 int bPhantomOk; /* True if phantom files should be ignored */
1092 char buf[24];
1093 char *zEmail; /* Contact info for Git committer field */
 
1094
1095 pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
1096 if( pMan==0 ){
1097 /* Must be a phantom. Return without doing anything, and in particular
1098 ** without creating a mark for this check-in. */
@@ -1106,11 +1106,11 @@
1106 char *zPMark = gitmirror_find_mark(pMan->azParent[i], 0, 0);
1107 if( zPMark==0 ){
1108 int prid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q",
1109 pMan->azParent[i]);
1110 int rc = gitmirror_send_checkin(xCmd, prid, pMan->azParent[i],
1111 pnLimit, fManifest);
1112 if( rc || *pnLimit<=0 ){
1113 manifest_destroy(pMan);
1114 return 1;
1115 }
1116 }
@@ -1271,10 +1271,11 @@
1271 db_finalize(&q);
1272 manifest_destroy(pMan);
1273 pMan = 0;
1274
1275 /* Include Fossil-generated auxiliary files in the check-in */
 
1276 if( fManifest & MFESTFLG_RAW ){
1277 Blob manifest;
1278 content_get(rid, &manifest);
1279 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
1280 fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
@@ -1383,11 +1384,10 @@
1383 char *zPushUrl; /* URL to sync the mirror to */
1384 double rEnd; /* time of most recent export */
1385 int rc; /* Result code */
1386 int bForce; /* Do the export and sync even if no changes*/
1387 int bNeedRepack = 0; /* True if we should run repack at the end */
1388 int fManifest; /* Current "manifest" setting */
1389 int bIfExists; /* The --if-mirrored flag */
1390 FILE *xCmd; /* Pipe to the "git fast-import" command */
1391 FILE *pMarks; /* Git mark files */
1392 Stmt q; /* Queries */
1393 char zLine[200]; /* One line of a mark file */
@@ -1521,13 +1521,10 @@
1521 gitmirror_message(VERB_NORMAL, "no changes\n");
1522 db_commit_transaction();
1523 return;
1524 }
1525
1526 /* Do we need to include manifest files in the clone? */
1527 fManifest = db_get_manifest_setting();
1528
1529 /* Change to the MIRROR directory so that the Git commands will work */
1530 rc = file_chdir(zMirror, 0);
1531 if( rc ) fossil_fatal("cannot change the working directory to \"%s\"",
1532 zMirror);
1533
@@ -1579,11 +1576,11 @@
1579 while( nLimit && db_step(&q)==SQLITE_ROW ){
1580 int rid = db_column_int(&q, 0);
1581 double rMTime = db_column_double(&q, 1);
1582 const char *zUuid = db_column_text(&q, 2);
1583 if( rMTime>rEnd ) rEnd = rMTime;
1584 rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit, fManifest);
1585 if( rc ) break;
1586 gitmirror_message(VERB_NORMAL,"%d/%d \r", nTotal-nLimit, nTotal);
1587 fflush(stdout);
1588 }
1589 db_finalize(&q);
1590
--- src/export.c
+++ src/export.c
@@ -1074,12 +1074,11 @@
1074 */
1075 static int gitmirror_send_checkin(
1076 FILE *xCmd, /* Write fast-import text on this pipe */
1077 int rid, /* BLOB.RID for the check-in to export */
1078 const char *zUuid, /* BLOB.UUID for the check-in to export */
1079 int *pnLimit /* Stop when the counter reaches zero */
 
1080 ){
1081 Manifest *pMan; /* The check-in to be output */
1082 int i; /* Loop counter */
1083 int iParent; /* Which immediate ancestor is primary. -1 for none */
1084 Stmt q; /* An SQL query */
@@ -1089,10 +1088,11 @@
1088 Blob comment; /* The comment text for the check-in */
1089 int nErr = 0; /* Number of errors */
1090 int bPhantomOk; /* True if phantom files should be ignored */
1091 char buf[24];
1092 char *zEmail; /* Contact info for Git committer field */
1093 int fManifest; /* Should the manifest files be included? */
1094
1095 pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
1096 if( pMan==0 ){
1097 /* Must be a phantom. Return without doing anything, and in particular
1098 ** without creating a mark for this check-in. */
@@ -1106,11 +1106,11 @@
1106 char *zPMark = gitmirror_find_mark(pMan->azParent[i], 0, 0);
1107 if( zPMark==0 ){
1108 int prid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q",
1109 pMan->azParent[i]);
1110 int rc = gitmirror_send_checkin(xCmd, prid, pMan->azParent[i],
1111 pnLimit);
1112 if( rc || *pnLimit<=0 ){
1113 manifest_destroy(pMan);
1114 return 1;
1115 }
1116 }
@@ -1271,10 +1271,11 @@
1271 db_finalize(&q);
1272 manifest_destroy(pMan);
1273 pMan = 0;
1274
1275 /* Include Fossil-generated auxiliary files in the check-in */
1276 fManifest = db_get_manifest_setting(zUuid);
1277 if( fManifest & MFESTFLG_RAW ){
1278 Blob manifest;
1279 content_get(rid, &manifest);
1280 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
1281 fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
@@ -1383,11 +1384,10 @@
1384 char *zPushUrl; /* URL to sync the mirror to */
1385 double rEnd; /* time of most recent export */
1386 int rc; /* Result code */
1387 int bForce; /* Do the export and sync even if no changes*/
1388 int bNeedRepack = 0; /* True if we should run repack at the end */
 
1389 int bIfExists; /* The --if-mirrored flag */
1390 FILE *xCmd; /* Pipe to the "git fast-import" command */
1391 FILE *pMarks; /* Git mark files */
1392 Stmt q; /* Queries */
1393 char zLine[200]; /* One line of a mark file */
@@ -1521,13 +1521,10 @@
1521 gitmirror_message(VERB_NORMAL, "no changes\n");
1522 db_commit_transaction();
1523 return;
1524 }
1525
 
 
 
1526 /* Change to the MIRROR directory so that the Git commands will work */
1527 rc = file_chdir(zMirror, 0);
1528 if( rc ) fossil_fatal("cannot change the working directory to \"%s\"",
1529 zMirror);
1530
@@ -1579,11 +1576,11 @@
1576 while( nLimit && db_step(&q)==SQLITE_ROW ){
1577 int rid = db_column_int(&q, 0);
1578 double rMTime = db_column_double(&q, 1);
1579 const char *zUuid = db_column_text(&q, 2);
1580 if( rMTime>rEnd ) rEnd = rMTime;
1581 rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit);
1582 if( rc ) break;
1583 gitmirror_message(VERB_NORMAL,"%d/%d \r", nTotal-nLimit, nTotal);
1584 fflush(stdout);
1585 }
1586 db_finalize(&q);
1587
+3 -3
--- src/setup.c
+++ src/setup.c
@@ -1157,11 +1157,11 @@
11571157
@ <table border="0"><tr><td valign="top">
11581158
login_insert_csrf_secret();
11591159
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11601160
if( pSet->width==0 ){
11611161
int hasVersionableValue = pSet->versionable &&
1162
- (db_get_versioned(pSet->name, NULL)!=0);
1162
+ (db_get_versioned(pSet->name, NULL, NULL)!=0);
11631163
onoff_attribute("", pSet->name,
11641164
pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
11651165
is_truth(pSet->def), hasVersionableValue);
11661166
@ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
11671167
if( pSet->versionable ){
@@ -1175,11 +1175,11 @@
11751175
@ </td><td style="width:50px;"></td><td valign="top">
11761176
@ <table>
11771177
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11781178
if( pSet->width>0 && !pSet->forceTextArea ){
11791179
int hasVersionableValue = pSet->versionable &&
1180
- (db_get_versioned(pSet->name, NULL)!=0);
1180
+ (db_get_versioned(pSet->name, NULL, NULL)!=0);
11811181
@ <tr><td>
11821182
@ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
11831183
if( pSet->versionable ){
11841184
@ (v)
11851185
} else {
@@ -1194,11 +1194,11 @@
11941194
}
11951195
@</table>
11961196
@ </td><td style="width:50px;"></td><td valign="top">
11971197
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11981198
if( pSet->width>0 && pSet->forceTextArea ){
1199
- int hasVersionableValue = db_get_versioned(pSet->name, NULL)!=0;
1199
+ int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
12001200
@ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
12011201
if( pSet->versionable ){
12021202
@ (v)<br>
12031203
} else {
12041204
@ <br>
12051205
--- src/setup.c
+++ src/setup.c
@@ -1157,11 +1157,11 @@
1157 @ <table border="0"><tr><td valign="top">
1158 login_insert_csrf_secret();
1159 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1160 if( pSet->width==0 ){
1161 int hasVersionableValue = pSet->versionable &&
1162 (db_get_versioned(pSet->name, NULL)!=0);
1163 onoff_attribute("", pSet->name,
1164 pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
1165 is_truth(pSet->def), hasVersionableValue);
1166 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
1167 if( pSet->versionable ){
@@ -1175,11 +1175,11 @@
1175 @ </td><td style="width:50px;"></td><td valign="top">
1176 @ <table>
1177 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1178 if( pSet->width>0 && !pSet->forceTextArea ){
1179 int hasVersionableValue = pSet->versionable &&
1180 (db_get_versioned(pSet->name, NULL)!=0);
1181 @ <tr><td>
1182 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
1183 if( pSet->versionable ){
1184 @ (v)
1185 } else {
@@ -1194,11 +1194,11 @@
1194 }
1195 @</table>
1196 @ </td><td style="width:50px;"></td><td valign="top">
1197 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1198 if( pSet->width>0 && pSet->forceTextArea ){
1199 int hasVersionableValue = db_get_versioned(pSet->name, NULL)!=0;
1200 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
1201 if( pSet->versionable ){
1202 @ (v)<br>
1203 } else {
1204 @ <br>
1205
--- src/setup.c
+++ src/setup.c
@@ -1157,11 +1157,11 @@
1157 @ <table border="0"><tr><td valign="top">
1158 login_insert_csrf_secret();
1159 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1160 if( pSet->width==0 ){
1161 int hasVersionableValue = pSet->versionable &&
1162 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1163 onoff_attribute("", pSet->name,
1164 pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
1165 is_truth(pSet->def), hasVersionableValue);
1166 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
1167 if( pSet->versionable ){
@@ -1175,11 +1175,11 @@
1175 @ </td><td style="width:50px;"></td><td valign="top">
1176 @ <table>
1177 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1178 if( pSet->width>0 && !pSet->forceTextArea ){
1179 int hasVersionableValue = pSet->versionable &&
1180 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1181 @ <tr><td>
1182 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
1183 if( pSet->versionable ){
1184 @ (v)
1185 } else {
@@ -1194,11 +1194,11 @@
1194 }
1195 @</table>
1196 @ </td><td style="width:50px;"></td><td valign="top">
1197 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1198 if( pSet->width>0 && pSet->forceTextArea ){
1199 int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
1200 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
1201 if( pSet->versionable ){
1202 @ (v)<br>
1203 } else {
1204 @ <br>
1205
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -499,11 +499,11 @@
499499
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
500500
if( pManifest ){
501501
int flg, eflg = 0;
502502
mTime = (unsigned)((pManifest->rDate - 2440587.5)*86400.0);
503503
if( pTar ) tar_begin(mTime);
504
- flg = db_get_manifest_setting();
504
+ flg = db_get_manifest_setting(blob_str(&hash));
505505
if( flg ){
506506
/* eflg is the effective flags, taking include/exclude into account */
507507
if( (pInclude==0 || glob_match(pInclude, "manifest"))
508508
&& !glob_match(pExclude, "manifest")
509509
&& (flg & MFESTFLG_RAW) ){
510510
--- src/tar.c
+++ src/tar.c
@@ -499,11 +499,11 @@
499 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
500 if( pManifest ){
501 int flg, eflg = 0;
502 mTime = (unsigned)((pManifest->rDate - 2440587.5)*86400.0);
503 if( pTar ) tar_begin(mTime);
504 flg = db_get_manifest_setting();
505 if( flg ){
506 /* eflg is the effective flags, taking include/exclude into account */
507 if( (pInclude==0 || glob_match(pInclude, "manifest"))
508 && !glob_match(pExclude, "manifest")
509 && (flg & MFESTFLG_RAW) ){
510
--- src/tar.c
+++ src/tar.c
@@ -499,11 +499,11 @@
499 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
500 if( pManifest ){
501 int flg, eflg = 0;
502 mTime = (unsigned)((pManifest->rDate - 2440587.5)*86400.0);
503 if( pTar ) tar_begin(mTime);
504 flg = db_get_manifest_setting(blob_str(&hash));
505 if( flg ){
506 /* eflg is the effective flags, taking include/exclude into account */
507 if( (pInclude==0 || glob_match(pInclude, "manifest"))
508 && !glob_match(pExclude, "manifest")
509 && (flg & MFESTFLG_RAW) ){
510
+1 -1
--- src/zip.c
+++ src/zip.c
@@ -652,11 +652,11 @@
652652
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
653653
if( pManifest ){
654654
int flg, eflg = 0;
655655
char *zName = 0;
656656
zip_set_timedate(pManifest->rDate);
657
- flg = db_get_manifest_setting();
657
+ flg = db_get_manifest_setting(blob_str(&hash));
658658
if( flg ){
659659
/* eflg is the effective flags, taking include/exclude into account */
660660
if( (pInclude==0 || glob_match(pInclude, "manifest"))
661661
&& !glob_match(pExclude, "manifest")
662662
&& (flg & MFESTFLG_RAW) ){
663663
--- src/zip.c
+++ src/zip.c
@@ -652,11 +652,11 @@
652 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
653 if( pManifest ){
654 int flg, eflg = 0;
655 char *zName = 0;
656 zip_set_timedate(pManifest->rDate);
657 flg = db_get_manifest_setting();
658 if( flg ){
659 /* eflg is the effective flags, taking include/exclude into account */
660 if( (pInclude==0 || glob_match(pInclude, "manifest"))
661 && !glob_match(pExclude, "manifest")
662 && (flg & MFESTFLG_RAW) ){
663
--- src/zip.c
+++ src/zip.c
@@ -652,11 +652,11 @@
652 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
653 if( pManifest ){
654 int flg, eflg = 0;
655 char *zName = 0;
656 zip_set_timedate(pManifest->rDate);
657 flg = db_get_manifest_setting(blob_str(&hash));
658 if( flg ){
659 /* eflg is the effective flags, taking include/exclude into account */
660 if( (pInclude==0 || glob_match(pInclude, "manifest"))
661 && !glob_match(pExclude, "manifest")
662 && (flg & MFESTFLG_RAW) ){
663

Keyboard Shortcuts

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