Fossil SCM

Two manifest.tags changes: 1) Unconditionally add branch. 2) Change the format to explicitly state tag or branch entry.

jan 2016-08-08 21:42 jan-manifest-tags
Commit 0925f75a0c05f9cc7825cb7b9ed7d8a5fc249293
+5 -9
--- src/checkout.c
+++ src/checkout.c
@@ -199,29 +199,25 @@
199199
** It is unclear if the rid parameter is always the same as the current
200200
** check-out.
201201
*/
202202
void get_checkin_taglist(int rid, Blob *pOut){
203203
Stmt stmt;
204
+ char *zCurrent;
204205
blob_reset(pOut);
205
- if( g.localOpen ){
206
- char *zCurrent;
207
- int vid;
208
- vid = db_lget_int("checkout", 0);
209
- zCurrent = db_text(0, "SELECT value FROM tagxref"
210
- " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);
211
- blob_appendf(pOut, "branch=%s\n", zCurrent);
212
- }
206
+ zCurrent = db_text(0, "SELECT value FROM tagxref"
207
+ " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH);
208
+ blob_appendf(pOut, "branch %s\n", zCurrent);
213209
db_prepare(&stmt, "SELECT substr(tagname, 5)"
214210
" FROM tagxref, tag"
215211
" WHERE tagxref.rid=%d"
216212
" AND tagxref.tagtype>0"
217213
" AND tag.tagid=tagxref.tagid"
218214
" AND tag.tagname GLOB 'sym-*'", rid);
219215
while( db_step(&stmt)==SQLITE_ROW ){
220216
const char *zName;
221217
zName = db_column_text(&stmt, 0);
222
- blob_appendf(pOut, "%s\n", zName);
218
+ blob_appendf(pOut, "tag %s\n", zName);
223219
}
224220
db_reset(&stmt);
225221
db_finalize(&stmt);
226222
}
227223
228224
--- src/checkout.c
+++ src/checkout.c
@@ -199,29 +199,25 @@
199 ** It is unclear if the rid parameter is always the same as the current
200 ** check-out.
201 */
202 void get_checkin_taglist(int rid, Blob *pOut){
203 Stmt stmt;
 
204 blob_reset(pOut);
205 if( g.localOpen ){
206 char *zCurrent;
207 int vid;
208 vid = db_lget_int("checkout", 0);
209 zCurrent = db_text(0, "SELECT value FROM tagxref"
210 " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);
211 blob_appendf(pOut, "branch=%s\n", zCurrent);
212 }
213 db_prepare(&stmt, "SELECT substr(tagname, 5)"
214 " FROM tagxref, tag"
215 " WHERE tagxref.rid=%d"
216 " AND tagxref.tagtype>0"
217 " AND tag.tagid=tagxref.tagid"
218 " AND tag.tagname GLOB 'sym-*'", rid);
219 while( db_step(&stmt)==SQLITE_ROW ){
220 const char *zName;
221 zName = db_column_text(&stmt, 0);
222 blob_appendf(pOut, "%s\n", zName);
223 }
224 db_reset(&stmt);
225 db_finalize(&stmt);
226 }
227
228
--- src/checkout.c
+++ src/checkout.c
@@ -199,29 +199,25 @@
199 ** It is unclear if the rid parameter is always the same as the current
200 ** check-out.
201 */
202 void get_checkin_taglist(int rid, Blob *pOut){
203 Stmt stmt;
204 char *zCurrent;
205 blob_reset(pOut);
206 zCurrent = db_text(0, "SELECT value FROM tagxref"
207 " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH);
208 blob_appendf(pOut, "branch %s\n", zCurrent);
 
 
 
 
 
209 db_prepare(&stmt, "SELECT substr(tagname, 5)"
210 " FROM tagxref, tag"
211 " WHERE tagxref.rid=%d"
212 " AND tagxref.tagtype>0"
213 " AND tag.tagid=tagxref.tagid"
214 " AND tag.tagname GLOB 'sym-*'", rid);
215 while( db_step(&stmt)==SQLITE_ROW ){
216 const char *zName;
217 zName = db_column_text(&stmt, 0);
218 blob_appendf(pOut, "tag %s\n", zName);
219 }
220 db_reset(&stmt);
221 db_finalize(&stmt);
222 }
223
224
--- test/set-manifest.test
+++ test/set-manifest.test
@@ -116,11 +116,11 @@
116116
test "set-manifest-5-$v-f-$f" {[file isfile $f]}
117117
}
118118
}
119119
120120
# Quick check for tags applied in trunk
121
-test_file_contents "set-manifest-6" "manifest.tags" "branch=trunk\ntrunk\n"
121
+test_file_contents "set-manifest-6" "manifest.tags" "branch trunk\ntag trunk\n"
122122
123123
124124
##### Test manifest.tags file content updates after commits
125125
126126
# Explicitly set manifest.tags mode
@@ -127,29 +127,29 @@
127127
fossil set manifest t
128128
test "set-manifest-7-1" {[file isfile manifest.tags]}
129129
130130
# Add a tag and make sure it appears in manifest.tags
131131
fossil tag add manifest-7-tag-1 tip
132
-test "set-manifest-7-2" {[file_contains "manifest.tags" "^manifest-7-tag-1$"]}
132
+test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
133133
134134
# Add a file and make sure tag has disappeared from manifest.tags
135135
write_file file1 "file1 contents"
136136
fossil add file1
137137
fossil commit -m "Added file1."
138
-test "set-manifest-7-3" {![file_contains "manifest.tags" "^manifest-7-tag-1$"]}
138
+test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
139139
140140
# Add new tag and check that it is in manifest.tags
141141
fossil tag add manifest-7-tag-2 tip
142
-test "set-manifest-7-4" {[file_contains "manifest.tags" "^manifest-7-tag-2$"]}
142
+test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]}
143143
144144
145145
##### Tags manifest branch= updates
146146
147147
# Add file, create new branch on commit and check that
148148
# manifest.tags has been updated appropriately
149149
write_file file3 "file3 contents"
150150
fossil add file3
151151
fossil commit -m "Added file3." --branch manifest-8-branch
152
-test "set-manifest-8" {[file_contains "manifest.tags" "^branch=manifest-8-branch$"]}
152
+test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]}
153153
154154
155155
test_cleanup
156156
--- test/set-manifest.test
+++ test/set-manifest.test
@@ -116,11 +116,11 @@
116 test "set-manifest-5-$v-f-$f" {[file isfile $f]}
117 }
118 }
119
120 # Quick check for tags applied in trunk
121 test_file_contents "set-manifest-6" "manifest.tags" "branch=trunk\ntrunk\n"
122
123
124 ##### Test manifest.tags file content updates after commits
125
126 # Explicitly set manifest.tags mode
@@ -127,29 +127,29 @@
127 fossil set manifest t
128 test "set-manifest-7-1" {[file isfile manifest.tags]}
129
130 # Add a tag and make sure it appears in manifest.tags
131 fossil tag add manifest-7-tag-1 tip
132 test "set-manifest-7-2" {[file_contains "manifest.tags" "^manifest-7-tag-1$"]}
133
134 # Add a file and make sure tag has disappeared from manifest.tags
135 write_file file1 "file1 contents"
136 fossil add file1
137 fossil commit -m "Added file1."
138 test "set-manifest-7-3" {![file_contains "manifest.tags" "^manifest-7-tag-1$"]}
139
140 # Add new tag and check that it is in manifest.tags
141 fossil tag add manifest-7-tag-2 tip
142 test "set-manifest-7-4" {[file_contains "manifest.tags" "^manifest-7-tag-2$"]}
143
144
145 ##### Tags manifest branch= updates
146
147 # Add file, create new branch on commit and check that
148 # manifest.tags has been updated appropriately
149 write_file file3 "file3 contents"
150 fossil add file3
151 fossil commit -m "Added file3." --branch manifest-8-branch
152 test "set-manifest-8" {[file_contains "manifest.tags" "^branch=manifest-8-branch$"]}
153
154
155 test_cleanup
156
--- test/set-manifest.test
+++ test/set-manifest.test
@@ -116,11 +116,11 @@
116 test "set-manifest-5-$v-f-$f" {[file isfile $f]}
117 }
118 }
119
120 # Quick check for tags applied in trunk
121 test_file_contents "set-manifest-6" "manifest.tags" "branch trunk\ntag trunk\n"
122
123
124 ##### Test manifest.tags file content updates after commits
125
126 # Explicitly set manifest.tags mode
@@ -127,29 +127,29 @@
127 fossil set manifest t
128 test "set-manifest-7-1" {[file isfile manifest.tags]}
129
130 # Add a tag and make sure it appears in manifest.tags
131 fossil tag add manifest-7-tag-1 tip
132 test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
133
134 # Add a file and make sure tag has disappeared from manifest.tags
135 write_file file1 "file1 contents"
136 fossil add file1
137 fossil commit -m "Added file1."
138 test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
139
140 # Add new tag and check that it is in manifest.tags
141 fossil tag add manifest-7-tag-2 tip
142 test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]}
143
144
145 ##### Tags manifest branch= updates
146
147 # Add file, create new branch on commit and check that
148 # manifest.tags has been updated appropriately
149 write_file file3 "file3 contents"
150 fossil add file3
151 fossil commit -m "Added file3." --branch manifest-8-branch
152 test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]}
153
154
155 test_cleanup
156

Keyboard Shortcuts

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