Fossil SCM

Add "server-id" printout to "fossil dbstat". Only print project-id if there is one.

jan.nijtmans 2014-06-27 15:32 UTC trunk
Commit 88d503e15bc30ded6ff51a69aca5eb8cec1a7805
1 file changed +7 -1
+7 -1
--- src/stat.c
+++ src/stat.c
@@ -168,10 +168,12 @@
168168
int szMax, szAvg;
169169
const char *zDb;
170170
int brief;
171171
char zBuf[100];
172172
const int colWidth = -19 /* printf alignment/width for left column */;
173
+ const char *p;
174
+
173175
brief = find_option("brief", "b",0)!=0;
174176
db_find_and_open_repository(0,0);
175177
fsize = file_size(g.zRepositoryName);
176178
bigSizeName(sizeof(zBuf), zBuf, fsize);
177179
fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf );
@@ -224,11 +226,15 @@
224226
}
225227
n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
226228
" + 0.99");
227229
fossil_print("%*s%d days or approximately %.2f years.\n",
228230
colWidth, "project-age:", n, n/365.2425);
229
- fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code",""));
231
+ p = db_get("project-code", 0);
232
+ if( p ){
233
+ fossil_print("%*s%s\n", colWidth, "project-id:", p);
234
+ }
235
+ fossil_print("%*s%s\n", colWidth, "server-id:", db_get("server-code", 0));
230236
fossil_print("%*s%s %s [%s] (%s)\n",
231237
colWidth, "fossil-version:",
232238
MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION,
233239
COMPILER_NAME);
234240
fossil_print("%*s%.19s [%.10s] (%s)\n",
235241
--- src/stat.c
+++ src/stat.c
@@ -168,10 +168,12 @@
168 int szMax, szAvg;
169 const char *zDb;
170 int brief;
171 char zBuf[100];
172 const int colWidth = -19 /* printf alignment/width for left column */;
 
 
173 brief = find_option("brief", "b",0)!=0;
174 db_find_and_open_repository(0,0);
175 fsize = file_size(g.zRepositoryName);
176 bigSizeName(sizeof(zBuf), zBuf, fsize);
177 fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf );
@@ -224,11 +226,15 @@
224 }
225 n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
226 " + 0.99");
227 fossil_print("%*s%d days or approximately %.2f years.\n",
228 colWidth, "project-age:", n, n/365.2425);
229 fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code",""));
 
 
 
 
230 fossil_print("%*s%s %s [%s] (%s)\n",
231 colWidth, "fossil-version:",
232 MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION,
233 COMPILER_NAME);
234 fossil_print("%*s%.19s [%.10s] (%s)\n",
235
--- src/stat.c
+++ src/stat.c
@@ -168,10 +168,12 @@
168 int szMax, szAvg;
169 const char *zDb;
170 int brief;
171 char zBuf[100];
172 const int colWidth = -19 /* printf alignment/width for left column */;
173 const char *p;
174
175 brief = find_option("brief", "b",0)!=0;
176 db_find_and_open_repository(0,0);
177 fsize = file_size(g.zRepositoryName);
178 bigSizeName(sizeof(zBuf), zBuf, fsize);
179 fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf );
@@ -224,11 +226,15 @@
226 }
227 n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
228 " + 0.99");
229 fossil_print("%*s%d days or approximately %.2f years.\n",
230 colWidth, "project-age:", n, n/365.2425);
231 p = db_get("project-code", 0);
232 if( p ){
233 fossil_print("%*s%s\n", colWidth, "project-id:", p);
234 }
235 fossil_print("%*s%s\n", colWidth, "server-id:", db_get("server-code", 0));
236 fossil_print("%*s%s %s [%s] (%s)\n",
237 colWidth, "fossil-version:",
238 MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION,
239 COMPILER_NAME);
240 fossil_print("%*s%.19s [%.10s] (%s)\n",
241

Keyboard Shortcuts

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