| | @@ -163,13 +163,16 @@ |
| 163 | 163 | int nLine = 0; |
| 164 | 164 | char zPrevDate[20]; |
| 165 | 165 | zPrevDate[0] = 0; |
| 166 | 166 | |
| 167 | 167 | while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ |
| 168 | | - const char *zId = db_column_text(q, 0); |
| 169 | | - const char *zDate = db_column_text(q, 1); |
| 170 | | - const char *zCom = db_column_text(q, 2); |
| 168 | + const char *zId = db_column_text(q, 1); |
| 169 | + const char *zDate = db_column_text(q, 2); |
| 170 | + const char *zCom = db_column_text(q, 3); |
| 171 | + int nChild = db_column_int(q, 4); |
| 172 | + int nParent = db_column_int(q, 5); |
| 173 | + char *zFree = 0; |
| 171 | 174 | char zUuid[UUID_SIZE+1]; |
| 172 | 175 | |
| 173 | 176 | sprintf(zUuid, "%.10s", zId); |
| 174 | 177 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 175 | 178 | printf("=== %.10s ===\n", zDate); |
| | @@ -176,11 +179,25 @@ |
| 176 | 179 | memcpy(zPrevDate, zDate, 10); |
| 177 | 180 | nLine++; |
| 178 | 181 | } |
| 179 | 182 | if( zCom==0 ) zCom = ""; |
| 180 | 183 | printf("%.5s [%.10s] ", &zDate[11], zUuid); |
| 184 | + if( nChild>1 || nParent>1 ){ |
| 185 | + int n = 0; |
| 186 | + char zPrefix[50]; |
| 187 | + if( nParent>1 ){ |
| 188 | + sqlite3_snprintf(sizeof(zPrefix), zPrefix, "*MERGE* "); |
| 189 | + n = strlen(zPrefix); |
| 190 | + } |
| 191 | + if( nChild>1 ){ |
| 192 | + sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*FORK* "); |
| 193 | + n = strlen(zPrefix); |
| 194 | + } |
| 195 | + zCom = zFree = sqlite3_mprintf("%s%s", zPrefix, zCom); |
| 196 | + } |
| 181 | 197 | nLine += comment_print(zCom, 19, 79); |
| 198 | + sqlite3_free(zFree); |
| 182 | 199 | } |
| 183 | 200 | } |
| 184 | 201 | |
| 185 | 202 | |
| 186 | 203 | /* |
| | @@ -197,11 +214,11 @@ |
| 197 | 214 | ** Times are according to the local timezone. |
| 198 | 215 | */ |
| 199 | 216 | void timeline_cmd(void){ |
| 200 | 217 | Stmt q; |
| 201 | 218 | int n; |
| 202 | | - char *zCount; |
| 219 | + const char *zCount; |
| 203 | 220 | char *zDate; |
| 204 | 221 | db_find_and_open_repository(); |
| 205 | 222 | zCount = find_option("n","count",1); |
| 206 | 223 | if( zCount ){ |
| 207 | 224 | n = atoi(zCount); |
| | @@ -215,15 +232,17 @@ |
| 215 | 232 | zDate = g.argv[2]; |
| 216 | 233 | }else{ |
| 217 | 234 | zDate = "now"; |
| 218 | 235 | } |
| 219 | 236 | db_prepare(&q, |
| 220 | | - "SELECT uuid, datetime(event.mtime,'localtime')," |
| 221 | | - " comment || ' (by ' || user || ')'" |
| 237 | + "SELECT blob.rid, uuid, datetime(event.mtime,'localtime')," |
| 238 | + " comment || ' (by ' || user || ')'," |
| 239 | + " (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim)," |
| 240 | + " (SELECT count(*) FROM plink WHERE cid=blob.rid)" |
| 222 | 241 | " FROM event, blob" |
| 223 | 242 | " WHERE event.type='ci' AND blob.rid=event.objid" |
| 224 | 243 | " AND event.mtime<=(SELECT julianday(%Q,'utc'))" |
| 225 | 244 | " ORDER BY event.mtime DESC", zDate |
| 226 | 245 | ); |
| 227 | 246 | print_timeline(&q, n); |
| 228 | 247 | db_finalize(&q); |
| 229 | 248 | } |
| 230 | 249 | |