Fossil SCM

s/json_tags_for_rid()/json_tags_for_checkin_rid()/g, since that's really what it does.

stephan 2011-11-05 00:13 trunk
Commit 4ff2e31cef61e95aad7f7532fd51fcdad8fefafd
+4 -4
--- src/json.c
+++ src/json.c
@@ -1774,18 +1774,18 @@
17741774
return pay;
17751775
17761776
}
17771777
17781778
/*
1779
-** If the given rid has any tags associated with it, this function
1780
-** returns a JSON Array containing the tag names, else it returns
1781
-** NULL.
1779
+** If the given COMMIT rid has any tags associated with it, this
1780
+** function returns a JSON Array containing the tag names, else it
1781
+** returns NULL.
17821782
**
17831783
** See info_tags_of_checkin() for more details (this is simply a JSON
17841784
** wrapper for that function).
17851785
*/
1786
-cson_value * json_tags_for_rid(int rid, char propagatingOnly){
1786
+cson_value * json_tags_for_checkin_rid(int rid, char propagatingOnly){
17871787
cson_value * v = NULL;
17881788
char * tags = info_tags_of_checkin(rid, propagatingOnly);
17891789
if(tags){
17901790
if(*tags){
17911791
v = json_string_split2(tags,',',0);
17921792
--- src/json.c
+++ src/json.c
@@ -1774,18 +1774,18 @@
1774 return pay;
1775
1776 }
1777
1778 /*
1779 ** If the given rid has any tags associated with it, this function
1780 ** returns a JSON Array containing the tag names, else it returns
1781 ** NULL.
1782 **
1783 ** See info_tags_of_checkin() for more details (this is simply a JSON
1784 ** wrapper for that function).
1785 */
1786 cson_value * json_tags_for_rid(int rid, char propagatingOnly){
1787 cson_value * v = NULL;
1788 char * tags = info_tags_of_checkin(rid, propagatingOnly);
1789 if(tags){
1790 if(*tags){
1791 v = json_string_split2(tags,',',0);
1792
--- src/json.c
+++ src/json.c
@@ -1774,18 +1774,18 @@
1774 return pay;
1775
1776 }
1777
1778 /*
1779 ** If the given COMMIT rid has any tags associated with it, this
1780 ** function returns a JSON Array containing the tag names, else it
1781 ** returns NULL.
1782 **
1783 ** See info_tags_of_checkin() for more details (this is simply a JSON
1784 ** wrapper for that function).
1785 */
1786 cson_value * json_tags_for_checkin_rid(int rid, char propagatingOnly){
1787 cson_value * v = NULL;
1788 char * tags = info_tags_of_checkin(rid, propagatingOnly);
1789 if(tags){
1790 if(*tags){
1791 v = json_string_split2(tags,',',0);
1792
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -135,11 +135,11 @@
135135
136136
if(zParent){
137137
SET("parentUuid", json_new_string(zParent));
138138
}
139139
140
- tmpV = json_tags_for_rid(rid,0);
140
+ tmpV = json_tags_for_checkin_rid(rid,0);
141141
if(tmpV){
142142
SET("tags",tmpV);
143143
}
144144
145145
if( showFiles ){
@@ -284,14 +284,15 @@
284284
TAG_BRANCH, rid
285285
);
286286
checkin_arr = cson_new_array();
287287
cson_object_set(pay, "checkins", cson_array_value(checkin_arr));
288288
#if 0
289
- /* Damn: json_tags_for_rid() only works for commits.
289
+ /* Damn: json_tags_for_checkin_rid() only works for commits.
290290
291
- FIXME: extend json_tags_for_rid() to accept file rids and then
292
- implement this loop to add the tags to each object.
291
+ FIXME: add json_tags_for_file_rid(), analog to
292
+ json_tags_for_checkin_rid(), and then implement this loop to add the
293
+ tags to each object.
293294
*/
294295
295296
while( SQLITE_ROW == db_step(&q) ){
296297
checkinV = cson_sqlite3_row_to_object( q.pStmt );
297298
if(!checkinV){
@@ -301,11 +302,11 @@
301302
tagKey = cson_new_string("tags",4);
302303
json_gc_add("artifact/file/tags", cson_string_value(tagKey))
303304
/*avoids a potential lifetime issue*/;
304305
}
305306
checkin = cson_value_get_object(checkinV);
306
- cson_object_set_s(checkin, tagKey, json_tags_for_rid(rid,0));
307
+ cson_object_set_s(checkin, tagKey, json_tags_for_checkin_rid(rid,0));
307308
cson_array_append( checkin_arr, checkinV );
308309
}
309310
#else
310311
json_stmt_to_array_of_obj( &q, checkin_arr );
311312
#endif
312313
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -135,11 +135,11 @@
135
136 if(zParent){
137 SET("parentUuid", json_new_string(zParent));
138 }
139
140 tmpV = json_tags_for_rid(rid,0);
141 if(tmpV){
142 SET("tags",tmpV);
143 }
144
145 if( showFiles ){
@@ -284,14 +284,15 @@
284 TAG_BRANCH, rid
285 );
286 checkin_arr = cson_new_array();
287 cson_object_set(pay, "checkins", cson_array_value(checkin_arr));
288 #if 0
289 /* Damn: json_tags_for_rid() only works for commits.
290
291 FIXME: extend json_tags_for_rid() to accept file rids and then
292 implement this loop to add the tags to each object.
 
293 */
294
295 while( SQLITE_ROW == db_step(&q) ){
296 checkinV = cson_sqlite3_row_to_object( q.pStmt );
297 if(!checkinV){
@@ -301,11 +302,11 @@
301 tagKey = cson_new_string("tags",4);
302 json_gc_add("artifact/file/tags", cson_string_value(tagKey))
303 /*avoids a potential lifetime issue*/;
304 }
305 checkin = cson_value_get_object(checkinV);
306 cson_object_set_s(checkin, tagKey, json_tags_for_rid(rid,0));
307 cson_array_append( checkin_arr, checkinV );
308 }
309 #else
310 json_stmt_to_array_of_obj( &q, checkin_arr );
311 #endif
312
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -135,11 +135,11 @@
135
136 if(zParent){
137 SET("parentUuid", json_new_string(zParent));
138 }
139
140 tmpV = json_tags_for_checkin_rid(rid,0);
141 if(tmpV){
142 SET("tags",tmpV);
143 }
144
145 if( showFiles ){
@@ -284,14 +284,15 @@
284 TAG_BRANCH, rid
285 );
286 checkin_arr = cson_new_array();
287 cson_object_set(pay, "checkins", cson_array_value(checkin_arr));
288 #if 0
289 /* Damn: json_tags_for_checkin_rid() only works for commits.
290
291 FIXME: add json_tags_for_file_rid(), analog to
292 json_tags_for_checkin_rid(), and then implement this loop to add the
293 tags to each object.
294 */
295
296 while( SQLITE_ROW == db_step(&q) ){
297 checkinV = cson_sqlite3_row_to_object( q.pStmt );
298 if(!checkinV){
@@ -301,11 +302,11 @@
302 tagKey = cson_new_string("tags",4);
303 json_gc_add("artifact/file/tags", cson_string_value(tagKey))
304 /*avoids a potential lifetime issue*/;
305 }
306 checkin = cson_value_get_object(checkinV);
307 cson_object_set_s(checkin, tagKey, json_tags_for_checkin_rid(rid,0));
308 cson_array_append( checkin_arr, checkinV );
309 }
310 #else
311 json_stmt_to_array_of_obj( &q, checkin_arr );
312 #endif
313
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -396,11 +396,11 @@
396396
unsigned int len = cson_array_length_get(ar);
397397
for( ; i < len; ++i ){
398398
cson_object * row = cson_value_get_object(cson_array_get(ar,i));
399399
int rid = cson_value_get_integer(cson_object_get(row,"rid"));
400400
if(row>0) {
401
- cson_object_set_s(row, tags, json_tags_for_rid(rid,0));
401
+ cson_object_set_s(row, tags, json_tags_for_checkin_rid(rid,0));
402402
cson_object_set_s(row, isLeaf, json_value_to_bool(cson_object_get(row,"isLeaf")));
403403
}
404404
}
405405
cson_value_free( cson_string_value(tags) );
406406
cson_value_free( cson_string_value(isLeaf) );
407407
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -396,11 +396,11 @@
396 unsigned int len = cson_array_length_get(ar);
397 for( ; i < len; ++i ){
398 cson_object * row = cson_value_get_object(cson_array_get(ar,i));
399 int rid = cson_value_get_integer(cson_object_get(row,"rid"));
400 if(row>0) {
401 cson_object_set_s(row, tags, json_tags_for_rid(rid,0));
402 cson_object_set_s(row, isLeaf, json_value_to_bool(cson_object_get(row,"isLeaf")));
403 }
404 }
405 cson_value_free( cson_string_value(tags) );
406 cson_value_free( cson_string_value(isLeaf) );
407
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -396,11 +396,11 @@
396 unsigned int len = cson_array_length_get(ar);
397 for( ; i < len; ++i ){
398 cson_object * row = cson_value_get_object(cson_array_get(ar,i));
399 int rid = cson_value_get_integer(cson_object_get(row,"rid"));
400 if(row>0) {
401 cson_object_set_s(row, tags, json_tags_for_checkin_rid(rid,0));
402 cson_object_set_s(row, isLeaf, json_value_to_bool(cson_object_get(row,"isLeaf")));
403 }
404 }
405 cson_value_free( cson_string_value(tags) );
406 cson_value_free( cson_string_value(isLeaf) );
407

Keyboard Shortcuts

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