Fossil SCM

Throughout the /json API, renamed the "mtime" property with "timestamp", to consolidate the inconsistent usage.

stephan 2012-03-21 20:23 trunk
Commit 070b75542ce368bc2740b10e7ed3def982b35564
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -115,11 +115,11 @@
115115
SET("type", eventTypeLabel );
116116
SET("uuid",json_new_string(zUuid));
117117
SET("isLeaf", cson_value_new_bool(is_a_leaf(rid)));
118118
119119
mtime = db_column_int(&q,1);
120
- SET("mtime",json_new_int(mtime));
120
+ SET("timestamp",json_new_int(mtime));
121121
omtime = db_column_int(&q,2);
122122
if(omtime && (omtime!=mtime)){
123123
SET("originTime",json_new_int(omtime));
124124
}
125125
@@ -281,11 +281,11 @@
281281
}
282282
blob_reset(&content);
283283
284284
db_prepare(&q,
285285
"SELECT filename.name AS name, "
286
- " cast(strftime('%%s',event.mtime) as int) AS mtime,"
286
+ " cast(strftime('%%s',event.mtime) as int) AS timestamp,"
287287
" coalesce(event.ecomment,event.comment) as comment,"
288288
" coalesce(event.euser,event.user) as user,"
289289
" b.uuid as uuid, "
290290
#if 0
291291
" mlink.mperm as mperm,"
292292
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -115,11 +115,11 @@
115 SET("type", eventTypeLabel );
116 SET("uuid",json_new_string(zUuid));
117 SET("isLeaf", cson_value_new_bool(is_a_leaf(rid)));
118
119 mtime = db_column_int(&q,1);
120 SET("mtime",json_new_int(mtime));
121 omtime = db_column_int(&q,2);
122 if(omtime && (omtime!=mtime)){
123 SET("originTime",json_new_int(omtime));
124 }
125
@@ -281,11 +281,11 @@
281 }
282 blob_reset(&content);
283
284 db_prepare(&q,
285 "SELECT filename.name AS name, "
286 " cast(strftime('%%s',event.mtime) as int) AS mtime,"
287 " coalesce(event.ecomment,event.comment) as comment,"
288 " coalesce(event.euser,event.user) as user,"
289 " b.uuid as uuid, "
290 #if 0
291 " mlink.mperm as mperm,"
292
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -115,11 +115,11 @@
115 SET("type", eventTypeLabel );
116 SET("uuid",json_new_string(zUuid));
117 SET("isLeaf", cson_value_new_bool(is_a_leaf(rid)));
118
119 mtime = db_column_int(&q,1);
120 SET("timestamp",json_new_int(mtime));
121 omtime = db_column_int(&q,2);
122 if(omtime && (omtime!=mtime)){
123 SET("originTime",json_new_int(omtime));
124 }
125
@@ -281,11 +281,11 @@
281 }
282 blob_reset(&content);
283
284 db_prepare(&q,
285 "SELECT filename.name AS name, "
286 " cast(strftime('%%s',event.mtime) as int) AS timestamp,"
287 " coalesce(event.ecomment,event.comment) as comment,"
288 " coalesce(event.euser,event.user) as user,"
289 " b.uuid as uuid, "
290 #if 0
291 " mlink.mperm as mperm,"
292
+7 -5
--- src/json_dir.c
+++ src/json_dir.c
@@ -221,18 +221,20 @@
221221
} else{
222222
name = json_new_string( n );
223223
}
224224
cson_object_set_s(zEntry, zKeyName, name );
225225
if( zCI && !isDir){
226
- /* don't add the uuid/size for dir entries - that data refers
227
- to one of the files in that directory :/. */
226
+ /* Don't add the uuid/size for dir entries - that data refers to
227
+ one of the files in that directory :/. Entries with no
228
+ --checkin may refer to N versions, and therefore we cannot
229
+ associate a single size and uuid with them (and fetching all
230
+ would be overkill for most use cases).
231
+ */
228232
char const * u = db_column_text(&q,1);
229233
sqlite_int64 const sz = db_column_int64(&q,2);
230234
/*sqlite_int64 const ts = db_column_int64(&q,3);*/
231
- if(u && *u){
232
- cson_object_set_s(zEntry, zKeyUuid, json_new_string( u ) );
233
- }
235
+ cson_object_set_s(zEntry, zKeyUuid, json_new_string( u ) );
234236
cson_object_set_s(zEntry, zKeySize,
235237
cson_value_new_integer( (cson_int_t)sz ));
236238
/*cson_object_set(zEntry, "mtime",
237239
cson_value_new_integer( (cson_int_t)ts ));*/
238240
}
239241
--- src/json_dir.c
+++ src/json_dir.c
@@ -221,18 +221,20 @@
221 } else{
222 name = json_new_string( n );
223 }
224 cson_object_set_s(zEntry, zKeyName, name );
225 if( zCI && !isDir){
226 /* don't add the uuid/size for dir entries - that data refers
227 to one of the files in that directory :/. */
 
 
 
 
228 char const * u = db_column_text(&q,1);
229 sqlite_int64 const sz = db_column_int64(&q,2);
230 /*sqlite_int64 const ts = db_column_int64(&q,3);*/
231 if(u && *u){
232 cson_object_set_s(zEntry, zKeyUuid, json_new_string( u ) );
233 }
234 cson_object_set_s(zEntry, zKeySize,
235 cson_value_new_integer( (cson_int_t)sz ));
236 /*cson_object_set(zEntry, "mtime",
237 cson_value_new_integer( (cson_int_t)ts ));*/
238 }
239
--- src/json_dir.c
+++ src/json_dir.c
@@ -221,18 +221,20 @@
221 } else{
222 name = json_new_string( n );
223 }
224 cson_object_set_s(zEntry, zKeyName, name );
225 if( zCI && !isDir){
226 /* Don't add the uuid/size for dir entries - that data refers to
227 one of the files in that directory :/. Entries with no
228 --checkin may refer to N versions, and therefore we cannot
229 associate a single size and uuid with them (and fetching all
230 would be overkill for most use cases).
231 */
232 char const * u = db_column_text(&q,1);
233 sqlite_int64 const sz = db_column_int64(&q,2);
234 /*sqlite_int64 const ts = db_column_int64(&q,3);*/
235 cson_object_set_s(zEntry, zKeyUuid, json_new_string( u ) );
 
 
236 cson_object_set_s(zEntry, zKeySize,
237 cson_value_new_integer( (cson_int_t)sz ));
238 /*cson_object_set(zEntry, "mtime",
239 cson_value_new_integer( (cson_int_t)ts ));*/
240 }
241
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -121,11 +121,11 @@
121121
cson_object * row = cson_new_object();
122122
cson_array_append( checkins, cson_object_value(row) );
123123
cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) ));
124124
cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) ));
125125
/*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/
126
- cson_object_set(row, "mtime", json_new_int( db_column_int(&q,3) ));
126
+ cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) ));
127127
cson_object_set(row, "user", json_new_string( db_column_text(&q,4) ));
128128
cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) ));
129129
/*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/
130130
cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) ));
131131
if( (0 < limit) && (++currentRow >= limit) ){
132132
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -121,11 +121,11 @@
121 cson_object * row = cson_new_object();
122 cson_array_append( checkins, cson_object_value(row) );
123 cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) ));
124 cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) ));
125 /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/
126 cson_object_set(row, "mtime", json_new_int( db_column_int(&q,3) ));
127 cson_object_set(row, "user", json_new_string( db_column_text(&q,4) ));
128 cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) ));
129 /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/
130 cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) ));
131 if( (0 < limit) && (++currentRow >= limit) ){
132
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -121,11 +121,11 @@
121 cson_object * row = cson_new_object();
122 cson_array_append( checkins, cson_object_value(row) );
123 cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) ));
124 cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) ));
125 /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/
126 cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) ));
127 cson_object_set(row, "user", json_new_string( db_column_text(&q,4) ));
128 cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) ));
129 /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/
130 cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) ));
131 if( (0 < limit) && (++currentRow >= limit) ){
132
--- src/json_report.c
+++ src/json_report.c
@@ -101,11 +101,11 @@
101101
}
102102
103103
db_prepare(&q,"SELECT rn AS report,"
104104
" owner AS owner,"
105105
" title AS title,"
106
- " cast(strftime('%%s',mtime) as int) as mtime,"
106
+ " cast(strftime('%%s',mtime) as int) as timestamp,"
107107
" cols as columns,"
108108
" sqlcode as sqlCode"
109109
" FROM reportfmt"
110110
" WHERE rn=%d",
111111
nReport);
112112
--- src/json_report.c
+++ src/json_report.c
@@ -101,11 +101,11 @@
101 }
102
103 db_prepare(&q,"SELECT rn AS report,"
104 " owner AS owner,"
105 " title AS title,"
106 " cast(strftime('%%s',mtime) as int) as mtime,"
107 " cols as columns,"
108 " sqlcode as sqlCode"
109 " FROM reportfmt"
110 " WHERE rn=%d",
111 nReport);
112
--- src/json_report.c
+++ src/json_report.c
@@ -101,11 +101,11 @@
101 }
102
103 db_prepare(&q,"SELECT rn AS report,"
104 " owner AS owner,"
105 " title AS title,"
106 " cast(strftime('%%s',mtime) as int) as timestamp,"
107 " cols as columns,"
108 " sqlcode as sqlCode"
109 " FROM reportfmt"
110 " WHERE rn=%d",
111 nReport);
112
+1 -1
--- src/json_tag.c
+++ src/json_tag.c
@@ -276,11 +276,11 @@
276276
" SELECT"
277277
#if 0
278278
" blob.rid AS rid,"
279279
#endif
280280
" uuid AS uuid,"
281
- " cast(strftime('%s',event.mtime) as int) AS mtime,"
281
+ " cast(strftime('%s',event.mtime) as int) AS timestamp,"
282282
" coalesce(ecomment,comment) AS comment,"
283283
" coalesce(euser,user) AS user,"
284284
" CASE event.type"
285285
" WHEN 'ci' THEN 'checkin'"
286286
" WHEN 'w' THEN 'wiki'"
287287
--- src/json_tag.c
+++ src/json_tag.c
@@ -276,11 +276,11 @@
276 " SELECT"
277 #if 0
278 " blob.rid AS rid,"
279 #endif
280 " uuid AS uuid,"
281 " cast(strftime('%s',event.mtime) as int) AS mtime,"
282 " coalesce(ecomment,comment) AS comment,"
283 " coalesce(euser,user) AS user,"
284 " CASE event.type"
285 " WHEN 'ci' THEN 'checkin'"
286 " WHEN 'w' THEN 'wiki'"
287
--- src/json_tag.c
+++ src/json_tag.c
@@ -276,11 +276,11 @@
276 " SELECT"
277 #if 0
278 " blob.rid AS rid,"
279 #endif
280 " uuid AS uuid,"
281 " cast(strftime('%s',event.mtime) as int) AS timestamp,"
282 " coalesce(ecomment,comment) AS comment,"
283 " coalesce(euser,user) AS user,"
284 " CASE event.type"
285 " WHEN 'ci' THEN 'checkin'"
286 " WHEN 'w' THEN 'wiki'"
287
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -360,11 +360,11 @@
360360
json_timeline_temp_table();
361361
blob_append(&sql,
362362
"SELECT"
363363
" blob.rid AS rid,"
364364
" uuid AS uuid,"
365
- " datetime(event.mtime,'utc') as mtime,"
365
+ " datetime(event.mtime,'utc') as timestamp,"
366366
" coalesce(ecomment, comment) as comment,"
367367
" coalesce(euser, user) as user,"
368368
" blob.rid IN leaf as isLeaf,"
369369
" bgcolor as bgColor"
370370
" FROM event JOIN blob"
371371
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -360,11 +360,11 @@
360 json_timeline_temp_table();
361 blob_append(&sql,
362 "SELECT"
363 " blob.rid AS rid,"
364 " uuid AS uuid,"
365 " datetime(event.mtime,'utc') as mtime,"
366 " coalesce(ecomment, comment) as comment,"
367 " coalesce(euser, user) as user,"
368 " blob.rid IN leaf as isLeaf,"
369 " bgcolor as bgColor"
370 " FROM event JOIN blob"
371
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -360,11 +360,11 @@
360 json_timeline_temp_table();
361 blob_append(&sql,
362 "SELECT"
363 " blob.rid AS rid,"
364 " uuid AS uuid,"
365 " datetime(event.mtime,'utc') as timestamp,"
366 " coalesce(ecomment, comment) as comment,"
367 " coalesce(euser, user) as user,"
368 " blob.rid IN leaf as isLeaf,"
369 " bgcolor as bgColor"
370 " FROM event JOIN blob"
371
+3 -3
--- src/json_user.c
+++ src/json_user.c
@@ -61,11 +61,11 @@
6161
}
6262
db_prepare(&q,"SELECT uid AS uid,"
6363
" login AS name,"
6464
" cap AS capabilities,"
6565
" info AS info,"
66
- " mtime AS mtime"
66
+ " mtime AS timestamp"
6767
" FROM user ORDER BY login");
6868
payV = json_stmt_to_array_of_obj(&q, NULL);
6969
db_finalize(&q);
7070
if(NULL == payV){
7171
json_set_err(FSL_JSON_E_UNKNOWN,
@@ -85,11 +85,11 @@
8585
Stmt q;
8686
db_prepare(&q,"SELECT uid AS uid,"
8787
" login AS name,"
8888
" cap AS capabilities,"
8989
" info AS info,"
90
- " mtime AS mtime"
90
+ " mtime AS timestamp"
9191
" FROM user"
9292
" WHERE login=%Q",
9393
zName);
9494
if( (SQLITE_ROW == db_step(&q)) ){
9595
u = cson_sqlite3_row_to_object(q.pStmt);
@@ -107,11 +107,11 @@
107107
Stmt q;
108108
db_prepare(&q,"SELECT uid AS uid,"
109109
" login AS name,"
110110
" cap AS capabilities,"
111111
" info AS info,"
112
- " mtime AS mtime"
112
+ " mtime AS timestamp"
113113
" FROM user"
114114
" WHERE uid=%d",
115115
uid);
116116
if( (SQLITE_ROW == db_step(&q)) ){
117117
u = cson_sqlite3_row_to_object(q.pStmt);
118118
--- src/json_user.c
+++ src/json_user.c
@@ -61,11 +61,11 @@
61 }
62 db_prepare(&q,"SELECT uid AS uid,"
63 " login AS name,"
64 " cap AS capabilities,"
65 " info AS info,"
66 " mtime AS mtime"
67 " FROM user ORDER BY login");
68 payV = json_stmt_to_array_of_obj(&q, NULL);
69 db_finalize(&q);
70 if(NULL == payV){
71 json_set_err(FSL_JSON_E_UNKNOWN,
@@ -85,11 +85,11 @@
85 Stmt q;
86 db_prepare(&q,"SELECT uid AS uid,"
87 " login AS name,"
88 " cap AS capabilities,"
89 " info AS info,"
90 " mtime AS mtime"
91 " FROM user"
92 " WHERE login=%Q",
93 zName);
94 if( (SQLITE_ROW == db_step(&q)) ){
95 u = cson_sqlite3_row_to_object(q.pStmt);
@@ -107,11 +107,11 @@
107 Stmt q;
108 db_prepare(&q,"SELECT uid AS uid,"
109 " login AS name,"
110 " cap AS capabilities,"
111 " info AS info,"
112 " mtime AS mtime"
113 " FROM user"
114 " WHERE uid=%d",
115 uid);
116 if( (SQLITE_ROW == db_step(&q)) ){
117 u = cson_sqlite3_row_to_object(q.pStmt);
118
--- src/json_user.c
+++ src/json_user.c
@@ -61,11 +61,11 @@
61 }
62 db_prepare(&q,"SELECT uid AS uid,"
63 " login AS name,"
64 " cap AS capabilities,"
65 " info AS info,"
66 " mtime AS timestamp"
67 " FROM user ORDER BY login");
68 payV = json_stmt_to_array_of_obj(&q, NULL);
69 db_finalize(&q);
70 if(NULL == payV){
71 json_set_err(FSL_JSON_E_UNKNOWN,
@@ -85,11 +85,11 @@
85 Stmt q;
86 db_prepare(&q,"SELECT uid AS uid,"
87 " login AS name,"
88 " cap AS capabilities,"
89 " info AS info,"
90 " mtime AS timestamp"
91 " FROM user"
92 " WHERE login=%Q",
93 zName);
94 if( (SQLITE_ROW == db_step(&q)) ){
95 u = cson_sqlite3_row_to_object(q.pStmt);
@@ -107,11 +107,11 @@
107 Stmt q;
108 db_prepare(&q,"SELECT uid AS uid,"
109 " login AS name,"
110 " cap AS capabilities,"
111 " info AS info,"
112 " mtime AS timestamp"
113 " FROM user"
114 " WHERE uid=%d",
115 uid);
116 if( (SQLITE_ROW == db_step(&q)) ){
117 u = cson_sqlite3_row_to_object(q.pStmt);
118

Keyboard Shortcuts

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