Fossil SCM

Add manifest.tags to the list of potentially reserved names and decouple manifest and manifest.uuid from each other.

jan 2016-01-03 22:54 jan-manifest-tags
Commit 142cb7aabdc746a5cf82104325a16cb8e54e6ccc
1 file changed +21 -8
+21 -8
--- src/add.c
+++ src/add.c
@@ -71,29 +71,42 @@
7171
".fos-journal",
7272
".fos-wal",
7373
".fos-shm",
7474
};
7575
76
- /* Names of auxiliary files generated by SQLite when the "manifest"
77
- ** property is enabled
76
+ /* Possible names of auxiliary files generated when the "manifest" property
77
+ ** is used
7878
*/
79
- static const char *const azManifest[] = {
80
- "manifest",
81
- "manifest.uuid",
79
+ static const struct {
80
+ const char *fname;
81
+ int flg;
82
+ }aManifestflags[] = {
83
+ { "manifest", MFESTFLG_RAW },
84
+ { "manifest.uuid", MFESTFLG_UUID },
85
+ { "manifest.tags", MFESTFLG_TAGS }
8286
};
87
+ static const char *azManifests[3];
8388
8489
/*
8590
** Names of repository files, if they exist in the checkout.
8691
*/
8792
static const char *azRepo[4] = { 0, 0, 0, 0 };
8893
8994
/* Cached setting "manifest" */
9095
static int cachedManifest = -1;
96
+ static int numManifests;
9197
9298
if( cachedManifest == -1 ){
99
+ int i;
93100
Blob repo;
94
- cachedManifest = db_get_boolean("manifest",0);
101
+ cachedManifest = db_get_manifest_setting();
102
+ numManifests = 0;
103
+ for(i=0; i<count(aManifestflags); i++){
104
+ if( cachedManifest&aManifestflags[i].flg ) {
105
+ azManifests[numManifests++] = aManifestflags[i].fname;
106
+ }
107
+ }
95108
blob_zero(&repo);
96109
if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
97110
const char *zRepo = blob_str(&repo);
98111
azRepo[0] = zRepo;
99112
azRepo[1] = mprintf("%s-journal", zRepo);
@@ -104,12 +117,12 @@
104117
105118
if( N<0 ) return 0;
106119
if( N<count(azName) ) return azName[N];
107120
N -= count(azName);
108121
if( cachedManifest ){
109
- if( N<count(azManifest) ) return azManifest[N];
110
- N -= count(azManifest);
122
+ if( N<numManifests ) return azManifests[N];
123
+ N -= numManifests;
111124
}
112125
if( !omitRepo && N<count(azRepo) ) return azRepo[N];
113126
return 0;
114127
}
115128
116129
--- src/add.c
+++ src/add.c
@@ -71,29 +71,42 @@
71 ".fos-journal",
72 ".fos-wal",
73 ".fos-shm",
74 };
75
76 /* Names of auxiliary files generated by SQLite when the "manifest"
77 ** property is enabled
78 */
79 static const char *const azManifest[] = {
80 "manifest",
81 "manifest.uuid",
 
 
 
 
82 };
 
83
84 /*
85 ** Names of repository files, if they exist in the checkout.
86 */
87 static const char *azRepo[4] = { 0, 0, 0, 0 };
88
89 /* Cached setting "manifest" */
90 static int cachedManifest = -1;
 
91
92 if( cachedManifest == -1 ){
 
93 Blob repo;
94 cachedManifest = db_get_boolean("manifest",0);
 
 
 
 
 
 
95 blob_zero(&repo);
96 if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
97 const char *zRepo = blob_str(&repo);
98 azRepo[0] = zRepo;
99 azRepo[1] = mprintf("%s-journal", zRepo);
@@ -104,12 +117,12 @@
104
105 if( N<0 ) return 0;
106 if( N<count(azName) ) return azName[N];
107 N -= count(azName);
108 if( cachedManifest ){
109 if( N<count(azManifest) ) return azManifest[N];
110 N -= count(azManifest);
111 }
112 if( !omitRepo && N<count(azRepo) ) return azRepo[N];
113 return 0;
114 }
115
116
--- src/add.c
+++ src/add.c
@@ -71,29 +71,42 @@
71 ".fos-journal",
72 ".fos-wal",
73 ".fos-shm",
74 };
75
76 /* Possible names of auxiliary files generated when the "manifest" property
77 ** is used
78 */
79 static const struct {
80 const char *fname;
81 int flg;
82 }aManifestflags[] = {
83 { "manifest", MFESTFLG_RAW },
84 { "manifest.uuid", MFESTFLG_UUID },
85 { "manifest.tags", MFESTFLG_TAGS }
86 };
87 static const char *azManifests[3];
88
89 /*
90 ** Names of repository files, if they exist in the checkout.
91 */
92 static const char *azRepo[4] = { 0, 0, 0, 0 };
93
94 /* Cached setting "manifest" */
95 static int cachedManifest = -1;
96 static int numManifests;
97
98 if( cachedManifest == -1 ){
99 int i;
100 Blob repo;
101 cachedManifest = db_get_manifest_setting();
102 numManifests = 0;
103 for(i=0; i<count(aManifestflags); i++){
104 if( cachedManifest&aManifestflags[i].flg ) {
105 azManifests[numManifests++] = aManifestflags[i].fname;
106 }
107 }
108 blob_zero(&repo);
109 if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
110 const char *zRepo = blob_str(&repo);
111 azRepo[0] = zRepo;
112 azRepo[1] = mprintf("%s-journal", zRepo);
@@ -104,12 +117,12 @@
117
118 if( N<0 ) return 0;
119 if( N<count(azName) ) return azName[N];
120 N -= count(azName);
121 if( cachedManifest ){
122 if( N<numManifests ) return azManifests[N];
123 N -= numManifests;
124 }
125 if( !omitRepo && N<count(azRepo) ) return azRepo[N];
126 return 0;
127 }
128
129

Keyboard Shortcuts

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