Fossil SCM
Add "server-id" printout to "fossil dbstat". Only print project-id if there is one.
Commit
88d503e15bc30ded6ff51a69aca5eb8cec1a7805
Parent
11ba4bd6cf0cb9c…
1 file changed
+7
-1
+7
-1
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -168,10 +168,12 @@ | ||
| 168 | 168 | int szMax, szAvg; |
| 169 | 169 | const char *zDb; |
| 170 | 170 | int brief; |
| 171 | 171 | char zBuf[100]; |
| 172 | 172 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 173 | + const char *p; | |
| 174 | + | |
| 173 | 175 | brief = find_option("brief", "b",0)!=0; |
| 174 | 176 | db_find_and_open_repository(0,0); |
| 175 | 177 | fsize = file_size(g.zRepositoryName); |
| 176 | 178 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 177 | 179 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| @@ -224,11 +226,15 @@ | ||
| 224 | 226 | } |
| 225 | 227 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 226 | 228 | " + 0.99"); |
| 227 | 229 | fossil_print("%*s%d days or approximately %.2f years.\n", |
| 228 | 230 | 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)); | |
| 230 | 236 | fossil_print("%*s%s %s [%s] (%s)\n", |
| 231 | 237 | colWidth, "fossil-version:", |
| 232 | 238 | MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION, |
| 233 | 239 | COMPILER_NAME); |
| 234 | 240 | fossil_print("%*s%.19s [%.10s] (%s)\n", |
| 235 | 241 |
| --- 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 |