Fossil SCM

Fix multiple bugs associated with the versioned manifest setting.

drh 2025-03-13 10:34 trunk merge
Commit dfc0f1b41f6d9cd53455894a6a1e1d966b3c2e03d7294ebbb63f98aff90e64b1
+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
+117 -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,30 @@
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
+ zVal = db_text(0, "SELECT value FROM config WHERE name='manifest'");
4093
+ }
40574094
if( zVal==0 || is_false(zVal) ){
40584095
return 0;
40594096
}else if( is_truth(zVal) ){
40604097
return MFESTFLG_RAW|MFESTFLG_UUID;
40614098
}
@@ -4068,10 +4105,37 @@
40684105
}
40694106
zVal++;
40704107
}
40714108
return flg;
40724109
}
4110
+
4111
+/*
4112
+** COMMAND: test-manifest-setting
4113
+**
4114
+** Usage: %fossil test-manifest-setting VERSION VERSION ...
4115
+**
4116
+** Display the value for the "manifest" setting for various versions
4117
+** of the repository.
4118
+*/
4119
+void test_manfest_setting_cmd(void){
4120
+ int i;
4121
+ db_find_and_open_repository(0, 0);
4122
+ for(i=2; i<g.argc; i++){
4123
+ int m = db_get_manifest_setting(g.argv[i]);
4124
+ fossil_print("%s:\n", g.argv[i]);
4125
+ fossil_print(" flags = 0x%02x\n", m);
4126
+ if( m & MFESTFLG_RAW ){
4127
+ fossil_print(" manifest\n");
4128
+ }
4129
+ if( m & MFESTFLG_UUID ){
4130
+ fossil_print(" manifest.uuid\n");
4131
+ }
4132
+ if( m & MFESTFLG_TAGS ){
4133
+ fossil_print(" manifest.tags\n");
4134
+ }
4135
+ }
4136
+}
40734137
40744138
40754139
/*
40764140
** Record the name of a local repository in the global_config() database.
40774141
** The repository filename %s is recorded as an entry with a "name" field
@@ -4391,11 +4455,11 @@
43914455
versioned = 1;
43924456
}
43934457
blob_reset(&versionedPathname);
43944458
}
43954459
if( valueOnly && versioned ){
4396
- fossil_print("%s\n", db_get_versioned(pSetting->name, NULL));
4460
+ fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
43974461
return;
43984462
}
43994463
if( g.repositoryOpen ){
44004464
db_prepare(&q,
44014465
"SELECT '(local)', value FROM config WHERE name=%Q"
44024466
--- 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,30 @@
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 +4105,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 +4455,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,30 @@
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 zVal = db_text(0, "SELECT value FROM config WHERE name='manifest'");
4093 }
4094 if( zVal==0 || is_false(zVal) ){
4095 return 0;
4096 }else if( is_truth(zVal) ){
4097 return MFESTFLG_RAW|MFESTFLG_UUID;
4098 }
@@ -4068,10 +4105,37 @@
4105 }
4106 zVal++;
4107 }
4108 return flg;
4109 }
4110
4111 /*
4112 ** COMMAND: test-manifest-setting
4113 **
4114 ** Usage: %fossil test-manifest-setting VERSION VERSION ...
4115 **
4116 ** Display the value for the "manifest" setting for various versions
4117 ** of the repository.
4118 */
4119 void test_manfest_setting_cmd(void){
4120 int i;
4121 db_find_and_open_repository(0, 0);
4122 for(i=2; i<g.argc; i++){
4123 int m = db_get_manifest_setting(g.argv[i]);
4124 fossil_print("%s:\n", g.argv[i]);
4125 fossil_print(" flags = 0x%02x\n", m);
4126 if( m & MFESTFLG_RAW ){
4127 fossil_print(" manifest\n");
4128 }
4129 if( m & MFESTFLG_UUID ){
4130 fossil_print(" manifest.uuid\n");
4131 }
4132 if( m & MFESTFLG_TAGS ){
4133 fossil_print(" manifest.tags\n");
4134 }
4135 }
4136 }
4137
4138
4139 /*
4140 ** Record the name of a local repository in the global_config() database.
4141 ** The repository filename %s is recorded as an entry with a "name" field
@@ -4391,11 +4455,11 @@
4455 versioned = 1;
4456 }
4457 blob_reset(&versionedPathname);
4458 }
4459 if( valueOnly && versioned ){
4460 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4461 return;
4462 }
4463 if( g.repositoryOpen ){
4464 db_prepare(&q,
4465 "SELECT '(local)', value FROM config WHERE name=%Q"
4466
+13 -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,12 @@
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? */
1094
+ int fPManifest = 0; /* OR of the manifest files for all parents */
10941095
10951096
pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
10961097
if( pMan==0 ){
10971098
/* Must be a phantom. Return without doing anything, and in particular
10981099
** without creating a mark for this check-in. */
@@ -1106,11 +1107,11 @@
11061107
char *zPMark = gitmirror_find_mark(pMan->azParent[i], 0, 0);
11071108
if( zPMark==0 ){
11081109
int prid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q",
11091110
pMan->azParent[i]);
11101111
int rc = gitmirror_send_checkin(xCmd, prid, pMan->azParent[i],
1111
- pnLimit, fManifest);
1112
+ pnLimit);
11121113
if( rc || *pnLimit<=0 ){
11131114
manifest_destroy(pMan);
11141115
return 1;
11151116
}
11161117
}
@@ -1215,10 +1216,11 @@
12151216
blob_reset(&comment);
12161217
iParent = -1; /* Which ancestor is the primary parent */
12171218
for(i=0; i<pMan->nParent; i++){
12181219
char *zOther = gitmirror_find_mark(pMan->azParent[i],0,0);
12191220
if( zOther==0 ) continue;
1221
+ fPManifest |= db_get_manifest_setting(pMan->azParent[i]);
12201222
if( iParent<0 ){
12211223
iParent = i;
12221224
fprintf(xCmd, "from %s\n", zOther);
12231225
}else{
12241226
fprintf(xCmd, "merge %s\n", zOther);
@@ -1271,29 +1273,36 @@
12711273
db_finalize(&q);
12721274
manifest_destroy(pMan);
12731275
pMan = 0;
12741276
12751277
/* Include Fossil-generated auxiliary files in the check-in */
1278
+ fManifest = db_get_manifest_setting(zUuid);
12761279
if( fManifest & MFESTFLG_RAW ){
12771280
Blob manifest;
12781281
content_get(rid, &manifest);
12791282
sterilize_manifest(&manifest, CFTYPE_MANIFEST);
12801283
fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
12811284
blob_strlen(&manifest), blob_str(&manifest));
12821285
blob_reset(&manifest);
1286
+ }else if( fPManifest & MFESTFLG_RAW ){
1287
+ fprintf(xCmd, "D manifest\n");
12831288
}
12841289
if( fManifest & MFESTFLG_UUID ){
12851290
int n = (int)strlen(zUuid);
12861291
fprintf(xCmd,"M 100644 inline manifest.uuid\ndata %d\n%s\n\n", n+1, zUuid);
1292
+ }else if( fPManifest & MFESTFLG_UUID ){
1293
+ fprintf(xCmd, "D manifest.uuid\n");
12871294
}
12881295
if( fManifest & MFESTFLG_TAGS ){
12891296
Blob tagslist;
12901297
blob_init(&tagslist, 0, 0);
12911298
get_checkin_taglist(rid, &tagslist);
12921299
fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
12931300
blob_strlen(&tagslist), blob_str(&tagslist));
12941301
blob_reset(&tagslist);
1302
+ }else if( fPManifest & MFESTFLG_TAGS ){
1303
+ fprintf(xCmd, "D manifest.tags\n");
12951304
}
12961305
12971306
/* The check-in is finished, so decrement the counter */
12981307
(*pnLimit)--;
12991308
return 0;
@@ -1383,11 +1392,10 @@
13831392
char *zPushUrl; /* URL to sync the mirror to */
13841393
double rEnd; /* time of most recent export */
13851394
int rc; /* Result code */
13861395
int bForce; /* Do the export and sync even if no changes*/
13871396
int bNeedRepack = 0; /* True if we should run repack at the end */
1388
- int fManifest; /* Current "manifest" setting */
13891397
int bIfExists; /* The --if-mirrored flag */
13901398
FILE *xCmd; /* Pipe to the "git fast-import" command */
13911399
FILE *pMarks; /* Git mark files */
13921400
Stmt q; /* Queries */
13931401
char zLine[200]; /* One line of a mark file */
@@ -1521,13 +1529,10 @@
15211529
gitmirror_message(VERB_NORMAL, "no changes\n");
15221530
db_commit_transaction();
15231531
return;
15241532
}
15251533
1526
- /* Do we need to include manifest files in the clone? */
1527
- fManifest = db_get_manifest_setting();
1528
-
15291534
/* Change to the MIRROR directory so that the Git commands will work */
15301535
rc = file_chdir(zMirror, 0);
15311536
if( rc ) fossil_fatal("cannot change the working directory to \"%s\"",
15321537
zMirror);
15331538
@@ -1579,11 +1584,11 @@
15791584
while( nLimit && db_step(&q)==SQLITE_ROW ){
15801585
int rid = db_column_int(&q, 0);
15811586
double rMTime = db_column_double(&q, 1);
15821587
const char *zUuid = db_column_text(&q, 2);
15831588
if( rMTime>rEnd ) rEnd = rMTime;
1584
- rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit, fManifest);
1589
+ rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit);
15851590
if( rc ) break;
15861591
gitmirror_message(VERB_NORMAL,"%d/%d \r", nTotal-nLimit, nTotal);
15871592
fflush(stdout);
15881593
}
15891594
db_finalize(&q);
15901595
--- 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,12 @@
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 +1107,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 }
@@ -1215,10 +1216,11 @@
1215 blob_reset(&comment);
1216 iParent = -1; /* Which ancestor is the primary parent */
1217 for(i=0; i<pMan->nParent; i++){
1218 char *zOther = gitmirror_find_mark(pMan->azParent[i],0,0);
1219 if( zOther==0 ) continue;
 
1220 if( iParent<0 ){
1221 iParent = i;
1222 fprintf(xCmd, "from %s\n", zOther);
1223 }else{
1224 fprintf(xCmd, "merge %s\n", zOther);
@@ -1271,29 +1273,36 @@
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",
1281 blob_strlen(&manifest), blob_str(&manifest));
1282 blob_reset(&manifest);
 
 
1283 }
1284 if( fManifest & MFESTFLG_UUID ){
1285 int n = (int)strlen(zUuid);
1286 fprintf(xCmd,"M 100644 inline manifest.uuid\ndata %d\n%s\n\n", n+1, zUuid);
 
 
1287 }
1288 if( fManifest & MFESTFLG_TAGS ){
1289 Blob tagslist;
1290 blob_init(&tagslist, 0, 0);
1291 get_checkin_taglist(rid, &tagslist);
1292 fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
1293 blob_strlen(&tagslist), blob_str(&tagslist));
1294 blob_reset(&tagslist);
 
 
1295 }
1296
1297 /* The check-in is finished, so decrement the counter */
1298 (*pnLimit)--;
1299 return 0;
@@ -1383,11 +1392,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 +1529,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 +1584,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,12 @@
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 int fPManifest = 0; /* OR of the manifest files for all parents */
1095
1096 pMan = manifest_get(rid, CFTYPE_MANIFEST, 0);
1097 if( pMan==0 ){
1098 /* Must be a phantom. Return without doing anything, and in particular
1099 ** without creating a mark for this check-in. */
@@ -1106,11 +1107,11 @@
1107 char *zPMark = gitmirror_find_mark(pMan->azParent[i], 0, 0);
1108 if( zPMark==0 ){
1109 int prid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q",
1110 pMan->azParent[i]);
1111 int rc = gitmirror_send_checkin(xCmd, prid, pMan->azParent[i],
1112 pnLimit);
1113 if( rc || *pnLimit<=0 ){
1114 manifest_destroy(pMan);
1115 return 1;
1116 }
1117 }
@@ -1215,10 +1216,11 @@
1216 blob_reset(&comment);
1217 iParent = -1; /* Which ancestor is the primary parent */
1218 for(i=0; i<pMan->nParent; i++){
1219 char *zOther = gitmirror_find_mark(pMan->azParent[i],0,0);
1220 if( zOther==0 ) continue;
1221 fPManifest |= db_get_manifest_setting(pMan->azParent[i]);
1222 if( iParent<0 ){
1223 iParent = i;
1224 fprintf(xCmd, "from %s\n", zOther);
1225 }else{
1226 fprintf(xCmd, "merge %s\n", zOther);
@@ -1271,29 +1273,36 @@
1273 db_finalize(&q);
1274 manifest_destroy(pMan);
1275 pMan = 0;
1276
1277 /* Include Fossil-generated auxiliary files in the check-in */
1278 fManifest = db_get_manifest_setting(zUuid);
1279 if( fManifest & MFESTFLG_RAW ){
1280 Blob manifest;
1281 content_get(rid, &manifest);
1282 sterilize_manifest(&manifest, CFTYPE_MANIFEST);
1283 fprintf(xCmd,"M 100644 inline manifest\ndata %d\n%s\n",
1284 blob_strlen(&manifest), blob_str(&manifest));
1285 blob_reset(&manifest);
1286 }else if( fPManifest & MFESTFLG_RAW ){
1287 fprintf(xCmd, "D manifest\n");
1288 }
1289 if( fManifest & MFESTFLG_UUID ){
1290 int n = (int)strlen(zUuid);
1291 fprintf(xCmd,"M 100644 inline manifest.uuid\ndata %d\n%s\n\n", n+1, zUuid);
1292 }else if( fPManifest & MFESTFLG_UUID ){
1293 fprintf(xCmd, "D manifest.uuid\n");
1294 }
1295 if( fManifest & MFESTFLG_TAGS ){
1296 Blob tagslist;
1297 blob_init(&tagslist, 0, 0);
1298 get_checkin_taglist(rid, &tagslist);
1299 fprintf(xCmd,"M 100644 inline manifest.tags\ndata %d\n%s\n",
1300 blob_strlen(&tagslist), blob_str(&tagslist));
1301 blob_reset(&tagslist);
1302 }else if( fPManifest & MFESTFLG_TAGS ){
1303 fprintf(xCmd, "D manifest.tags\n");
1304 }
1305
1306 /* The check-in is finished, so decrement the counter */
1307 (*pnLimit)--;
1308 return 0;
@@ -1383,11 +1392,10 @@
1392 char *zPushUrl; /* URL to sync the mirror to */
1393 double rEnd; /* time of most recent export */
1394 int rc; /* Result code */
1395 int bForce; /* Do the export and sync even if no changes*/
1396 int bNeedRepack = 0; /* True if we should run repack at the end */
 
1397 int bIfExists; /* The --if-mirrored flag */
1398 FILE *xCmd; /* Pipe to the "git fast-import" command */
1399 FILE *pMarks; /* Git mark files */
1400 Stmt q; /* Queries */
1401 char zLine[200]; /* One line of a mark file */
@@ -1521,13 +1529,10 @@
1529 gitmirror_message(VERB_NORMAL, "no changes\n");
1530 db_commit_transaction();
1531 return;
1532 }
1533
 
 
 
1534 /* Change to the MIRROR directory so that the Git commands will work */
1535 rc = file_chdir(zMirror, 0);
1536 if( rc ) fossil_fatal("cannot change the working directory to \"%s\"",
1537 zMirror);
1538
@@ -1579,11 +1584,11 @@
1584 while( nLimit && db_step(&q)==SQLITE_ROW ){
1585 int rid = db_column_int(&q, 0);
1586 double rMTime = db_column_double(&q, 1);
1587 const char *zUuid = db_column_text(&q, 2);
1588 if( rMTime>rEnd ) rEnd = rMTime;
1589 rc = gitmirror_send_checkin(xCmd, rid, zUuid, &nLimit);
1590 if( rc ) break;
1591 gitmirror_message(VERB_NORMAL,"%d/%d \r", nTotal-nLimit, nTotal);
1592 fflush(stdout);
1593 }
1594 db_finalize(&q);
1595
+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