Fossil SCM
Throughout the /json API, renamed the "mtime" property with "timestamp", to consolidate the inconsistent usage.
Commit
070b75542ce368bc2740b10e7ed3def982b35564
Parent
c4dc635e6b80e23…
7 files changed
+2
-2
+7
-5
+1
-1
+1
-1
+1
-1
+1
-1
+3
-3
+2
-2
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -115,11 +115,11 @@ | ||
| 115 | 115 | SET("type", eventTypeLabel ); |
| 116 | 116 | SET("uuid",json_new_string(zUuid)); |
| 117 | 117 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 118 | 118 | |
| 119 | 119 | mtime = db_column_int(&q,1); |
| 120 | - SET("mtime",json_new_int(mtime)); | |
| 120 | + SET("timestamp",json_new_int(mtime)); | |
| 121 | 121 | omtime = db_column_int(&q,2); |
| 122 | 122 | if(omtime && (omtime!=mtime)){ |
| 123 | 123 | SET("originTime",json_new_int(omtime)); |
| 124 | 124 | } |
| 125 | 125 | |
| @@ -281,11 +281,11 @@ | ||
| 281 | 281 | } |
| 282 | 282 | blob_reset(&content); |
| 283 | 283 | |
| 284 | 284 | db_prepare(&q, |
| 285 | 285 | "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," | |
| 287 | 287 | " coalesce(event.ecomment,event.comment) as comment," |
| 288 | 288 | " coalesce(event.euser,event.user) as user," |
| 289 | 289 | " b.uuid as uuid, " |
| 290 | 290 | #if 0 |
| 291 | 291 | " mlink.mperm as mperm," |
| 292 | 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("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 @@ | ||
| 221 | 221 | } else{ |
| 222 | 222 | name = json_new_string( n ); |
| 223 | 223 | } |
| 224 | 224 | cson_object_set_s(zEntry, zKeyName, name ); |
| 225 | 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 :/. */ | |
| 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 | + */ | |
| 228 | 232 | char const * u = db_column_text(&q,1); |
| 229 | 233 | sqlite_int64 const sz = db_column_int64(&q,2); |
| 230 | 234 | /*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 ) ); | |
| 234 | 236 | cson_object_set_s(zEntry, zKeySize, |
| 235 | 237 | cson_value_new_integer( (cson_int_t)sz )); |
| 236 | 238 | /*cson_object_set(zEntry, "mtime", |
| 237 | 239 | cson_value_new_integer( (cson_int_t)ts ));*/ |
| 238 | 240 | } |
| 239 | 241 |
| --- 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 |
+1
-1
| --- src/json_finfo.c | ||
| +++ src/json_finfo.c | ||
| @@ -121,11 +121,11 @@ | ||
| 121 | 121 | cson_object * row = cson_new_object(); |
| 122 | 122 | cson_array_append( checkins, cson_object_value(row) ); |
| 123 | 123 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 124 | 124 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 125 | 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) )); | |
| 126 | + cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) )); | |
| 127 | 127 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 128 | 128 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 129 | 129 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 130 | 130 | cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) )); |
| 131 | 131 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 132 | 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, "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 |
+1
-1
| --- src/json_report.c | ||
| +++ src/json_report.c | ||
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | db_prepare(&q,"SELECT rn AS report," |
| 104 | 104 | " owner AS owner," |
| 105 | 105 | " title AS title," |
| 106 | - " cast(strftime('%%s',mtime) as int) as mtime," | |
| 106 | + " cast(strftime('%%s',mtime) as int) as timestamp," | |
| 107 | 107 | " cols as columns," |
| 108 | 108 | " sqlcode as sqlCode" |
| 109 | 109 | " FROM reportfmt" |
| 110 | 110 | " WHERE rn=%d", |
| 111 | 111 | nReport); |
| 112 | 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 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 @@ | ||
| 276 | 276 | " SELECT" |
| 277 | 277 | #if 0 |
| 278 | 278 | " blob.rid AS rid," |
| 279 | 279 | #endif |
| 280 | 280 | " uuid AS uuid," |
| 281 | - " cast(strftime('%s',event.mtime) as int) AS mtime," | |
| 281 | + " cast(strftime('%s',event.mtime) as int) AS timestamp," | |
| 282 | 282 | " coalesce(ecomment,comment) AS comment," |
| 283 | 283 | " coalesce(euser,user) AS user," |
| 284 | 284 | " CASE event.type" |
| 285 | 285 | " WHEN 'ci' THEN 'checkin'" |
| 286 | 286 | " WHEN 'w' THEN 'wiki'" |
| 287 | 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 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 |
+1
-1
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -360,11 +360,11 @@ | ||
| 360 | 360 | json_timeline_temp_table(); |
| 361 | 361 | blob_append(&sql, |
| 362 | 362 | "SELECT" |
| 363 | 363 | " blob.rid AS rid," |
| 364 | 364 | " uuid AS uuid," |
| 365 | - " datetime(event.mtime,'utc') as mtime," | |
| 365 | + " datetime(event.mtime,'utc') as timestamp," | |
| 366 | 366 | " coalesce(ecomment, comment) as comment," |
| 367 | 367 | " coalesce(euser, user) as user," |
| 368 | 368 | " blob.rid IN leaf as isLeaf," |
| 369 | 369 | " bgcolor as bgColor" |
| 370 | 370 | " FROM event JOIN blob" |
| 371 | 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 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 @@ | ||
| 61 | 61 | } |
| 62 | 62 | db_prepare(&q,"SELECT uid AS uid," |
| 63 | 63 | " login AS name," |
| 64 | 64 | " cap AS capabilities," |
| 65 | 65 | " info AS info," |
| 66 | - " mtime AS mtime" | |
| 66 | + " mtime AS timestamp" | |
| 67 | 67 | " FROM user ORDER BY login"); |
| 68 | 68 | payV = json_stmt_to_array_of_obj(&q, NULL); |
| 69 | 69 | db_finalize(&q); |
| 70 | 70 | if(NULL == payV){ |
| 71 | 71 | json_set_err(FSL_JSON_E_UNKNOWN, |
| @@ -85,11 +85,11 @@ | ||
| 85 | 85 | Stmt q; |
| 86 | 86 | db_prepare(&q,"SELECT uid AS uid," |
| 87 | 87 | " login AS name," |
| 88 | 88 | " cap AS capabilities," |
| 89 | 89 | " info AS info," |
| 90 | - " mtime AS mtime" | |
| 90 | + " mtime AS timestamp" | |
| 91 | 91 | " FROM user" |
| 92 | 92 | " WHERE login=%Q", |
| 93 | 93 | zName); |
| 94 | 94 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 95 | 95 | u = cson_sqlite3_row_to_object(q.pStmt); |
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | Stmt q; |
| 108 | 108 | db_prepare(&q,"SELECT uid AS uid," |
| 109 | 109 | " login AS name," |
| 110 | 110 | " cap AS capabilities," |
| 111 | 111 | " info AS info," |
| 112 | - " mtime AS mtime" | |
| 112 | + " mtime AS timestamp" | |
| 113 | 113 | " FROM user" |
| 114 | 114 | " WHERE uid=%d", |
| 115 | 115 | uid); |
| 116 | 116 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 117 | 117 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 118 | 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 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 |