Fossil SCM

Add the "comment:" field to the output of "fossil info".

drh 2010-08-16 12:11 trunk
Commit da52ff93636eeb15488e1ca48cf5132bdf865edf
2 files changed +1 -2 +8 -1
+1 -2
--- src/db.c
+++ src/db.c
@@ -1253,11 +1253,10 @@
12531253
** so this routine is a no-op.
12541254
*/
12551255
void db_swap_connections(void){
12561256
if( !g.useAttach ){
12571257
sqlite3 *dbTemp = g.db;
1258
- assert( g.dbConfig!=0 );
12591258
g.db = g.dbConfig;
12601259
g.dbConfig = dbTemp;
12611260
}
12621261
}
12631262
@@ -1374,11 +1373,11 @@
13741373
db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
13751374
}
13761375
13771376
/*
13781377
** 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
13801379
** of the following form:
13811380
**
13821381
** repo:%s
13831382
**
13841383
** The value field is set to 1.
13851384
--- 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 @@
6565
);
6666
/* 01234567890123 */
6767
printf("%-13s %s %s\n", zUuidName, zUuid, zDate ? zDate : "");
6868
free(zUuid);
6969
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
+ );
7076
}
7177
db_prepare(&q, "SELECT uuid, pid FROM plink JOIN blob ON pid=rid "
7278
" WHERE cid=%d", rid);
7379
while( db_step(&q)==SQLITE_ROW ){
7480
const char *zUuid = db_column_text(&q, 0);
@@ -96,11 +102,12 @@
96102
if( zTags && zTags[0] ){
97103
printf("tags: %s\n", zTags);
98104
}
99105
free(zTags);
100106
if( zComment ){
101
- printf("comment:\n%s\n", zComment);
107
+ printf("comment: ");
108
+ comment_print(zComment, 14, 79);
102109
free(zComment);
103110
}
104111
}
105112
106113
107114
--- 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

Keyboard Shortcuts

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