Fossil SCM
Add the "comment:" field to the output of "fossil info".
Commit
da52ff93636eeb15488e1ca48cf5132bdf865edf
Parent
76201a088b2c0d4…
2 files changed
+1
-2
+8
-1
M
src/db.c
+1
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1253,11 +1253,10 @@ | ||
| 1253 | 1253 | ** so this routine is a no-op. |
| 1254 | 1254 | */ |
| 1255 | 1255 | void db_swap_connections(void){ |
| 1256 | 1256 | if( !g.useAttach ){ |
| 1257 | 1257 | sqlite3 *dbTemp = g.db; |
| 1258 | - assert( g.dbConfig!=0 ); | |
| 1259 | 1258 | g.db = g.dbConfig; |
| 1260 | 1259 | g.dbConfig = dbTemp; |
| 1261 | 1260 | } |
| 1262 | 1261 | } |
| 1263 | 1262 | |
| @@ -1374,11 +1373,11 @@ | ||
| 1374 | 1373 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 1375 | 1374 | } |
| 1376 | 1375 | |
| 1377 | 1376 | /* |
| 1378 | 1377 | ** Record the name of a local repository in the global_config() database. |
| 1379 | -** The repostiroy filename %s is recorded as an entry with a "name" field | |
| 1378 | +** The repository filename %s is recorded as an entry with a "name" field | |
| 1380 | 1379 | ** of the following form: |
| 1381 | 1380 | ** |
| 1382 | 1381 | ** repo:%s |
| 1383 | 1382 | ** |
| 1384 | 1383 | ** The value field is set to 1. |
| 1385 | 1384 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1253,11 +1253,10 @@ | |
| 1253 | ** so this routine is a no-op. |
| 1254 | */ |
| 1255 | void db_swap_connections(void){ |
| 1256 | if( !g.useAttach ){ |
| 1257 | sqlite3 *dbTemp = g.db; |
| 1258 | assert( g.dbConfig!=0 ); |
| 1259 | g.db = g.dbConfig; |
| 1260 | g.dbConfig = dbTemp; |
| 1261 | } |
| 1262 | } |
| 1263 | |
| @@ -1374,11 +1373,11 @@ | |
| 1374 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 1375 | } |
| 1376 | |
| 1377 | /* |
| 1378 | ** Record the name of a local repository in the global_config() database. |
| 1379 | ** The repostiroy filename %s is recorded as an entry with a "name" field |
| 1380 | ** of the following form: |
| 1381 | ** |
| 1382 | ** repo:%s |
| 1383 | ** |
| 1384 | ** The value field is set to 1. |
| 1385 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1253,11 +1253,10 @@ | |
| 1253 | ** so this routine is a no-op. |
| 1254 | */ |
| 1255 | void db_swap_connections(void){ |
| 1256 | if( !g.useAttach ){ |
| 1257 | sqlite3 *dbTemp = g.db; |
| 1258 | g.db = g.dbConfig; |
| 1259 | g.dbConfig = dbTemp; |
| 1260 | } |
| 1261 | } |
| 1262 | |
| @@ -1374,11 +1373,11 @@ | |
| 1373 | db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value); |
| 1374 | } |
| 1375 | |
| 1376 | /* |
| 1377 | ** Record the name of a local repository in the global_config() database. |
| 1378 | ** The repository filename %s is recorded as an entry with a "name" field |
| 1379 | ** of the following form: |
| 1380 | ** |
| 1381 | ** repo:%s |
| 1382 | ** |
| 1383 | ** The value field is set to 1. |
| 1384 |
+8
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -65,10 +65,16 @@ | ||
| 65 | 65 | ); |
| 66 | 66 | /* 01234567890123 */ |
| 67 | 67 | printf("%-13s %s %s\n", zUuidName, zUuid, zDate ? zDate : ""); |
| 68 | 68 | free(zUuid); |
| 69 | 69 | free(zDate); |
| 70 | + } | |
| 71 | + if( zUuid && showComment ){ | |
| 72 | + zComment = db_text(0, | |
| 73 | + "SELECT coalesce(ecomment,comment) FROM event WHERE objid=%d", | |
| 74 | + rid | |
| 75 | + ); | |
| 70 | 76 | } |
| 71 | 77 | db_prepare(&q, "SELECT uuid, pid FROM plink JOIN blob ON pid=rid " |
| 72 | 78 | " WHERE cid=%d", rid); |
| 73 | 79 | while( db_step(&q)==SQLITE_ROW ){ |
| 74 | 80 | const char *zUuid = db_column_text(&q, 0); |
| @@ -96,11 +102,12 @@ | ||
| 96 | 102 | if( zTags && zTags[0] ){ |
| 97 | 103 | printf("tags: %s\n", zTags); |
| 98 | 104 | } |
| 99 | 105 | free(zTags); |
| 100 | 106 | if( zComment ){ |
| 101 | - printf("comment:\n%s\n", zComment); | |
| 107 | + printf("comment: "); | |
| 108 | + comment_print(zComment, 14, 79); | |
| 102 | 109 | free(zComment); |
| 103 | 110 | } |
| 104 | 111 | } |
| 105 | 112 | |
| 106 | 113 | |
| 107 | 114 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -65,10 +65,16 @@ | |
| 65 | ); |
| 66 | /* 01234567890123 */ |
| 67 | printf("%-13s %s %s\n", zUuidName, zUuid, zDate ? zDate : ""); |
| 68 | free(zUuid); |
| 69 | free(zDate); |
| 70 | } |
| 71 | db_prepare(&q, "SELECT uuid, pid FROM plink JOIN blob ON pid=rid " |
| 72 | " WHERE cid=%d", rid); |
| 73 | while( db_step(&q)==SQLITE_ROW ){ |
| 74 | const char *zUuid = db_column_text(&q, 0); |
| @@ -96,11 +102,12 @@ | |
| 96 | if( zTags && zTags[0] ){ |
| 97 | printf("tags: %s\n", zTags); |
| 98 | } |
| 99 | free(zTags); |
| 100 | if( zComment ){ |
| 101 | printf("comment:\n%s\n", zComment); |
| 102 | free(zComment); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | |
| 107 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -65,10 +65,16 @@ | |
| 65 | ); |
| 66 | /* 01234567890123 */ |
| 67 | printf("%-13s %s %s\n", zUuidName, zUuid, zDate ? zDate : ""); |
| 68 | free(zUuid); |
| 69 | free(zDate); |
| 70 | } |
| 71 | if( zUuid && showComment ){ |
| 72 | zComment = db_text(0, |
| 73 | "SELECT coalesce(ecomment,comment) FROM event WHERE objid=%d", |
| 74 | rid |
| 75 | ); |
| 76 | } |
| 77 | db_prepare(&q, "SELECT uuid, pid FROM plink JOIN blob ON pid=rid " |
| 78 | " WHERE cid=%d", rid); |
| 79 | while( db_step(&q)==SQLITE_ROW ){ |
| 80 | const char *zUuid = db_column_text(&q, 0); |
| @@ -96,11 +102,12 @@ | |
| 102 | if( zTags && zTags[0] ){ |
| 103 | printf("tags: %s\n", zTags); |
| 104 | } |
| 105 | free(zTags); |
| 106 | if( zComment ){ |
| 107 | printf("comment: "); |
| 108 | comment_print(zComment, 14, 79); |
| 109 | free(zComment); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | |
| 114 |