Differences From Artifact [22c828dcf8]:
- File src/main.c — part of check-in [169a3dabcf] at 2022-03-01 16:21:15 on branch nameofexe-appendvfs-check — Fix an unused var warning in windows (user: mgagnon size: 124223) [more...]
To Artifact [1c90030210]:
- File
src/main.c
— part of check-in
[4329553d51]
at
2022-03-30 15:08:27
on branch version-cmd-describe
— Add "--describe" flag to the "version" command to provide context to the most recent major commit tagged with "version*".
Run "touch manifest.descr" in the repo root prior to the first build, then build it a second time to get it bootstrapped. (user: danield size: 125216)
| ︙ | ︙ | |||
1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 |
** This function returns a human readable version string.
*/
const char *get_version(){
static const char version[] = RELEASE_VERSION " " MANIFEST_VERSION " "
MANIFEST_DATE " UTC";
return version;
}
/*
** This function populates a blob with version information. It is used by
** the "version" command and "test-version" web page. It assumes the blob
** passed to it is uninitialized; otherwise, it will leak memory.
*/
void fossil_version_blob(
Blob *pOut, /* Write the manifest here */
| > > > > > > > > > > > > > > > | > | > | 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 |
** This function returns a human readable version string.
*/
const char *get_version(){
static const char version[] = RELEASE_VERSION " " MANIFEST_VERSION " "
MANIFEST_DATE " UTC";
return version;
}
/*
** This function returns a human readable version string based on 'describe'.
*/
const char *get_describe_version(){
#ifndef MANIFEST_DESCRIPTION
#define MANIFEST_DESCRIPTION MANIFEST_VERSION
#endif
#ifndef DESCRIPTION_DATE
#define DESCRIPTION_DATE MANIFEST_DATE
#endif
static const char version[] = RELEASE_VERSION " " MANIFEST_DESCRIPTION " "
DESCRIPTION_DATE " UTC";
return version;
}
/*
** This function populates a blob with version information. It is used by
** the "version" command and "test-version" web page. It assumes the blob
** passed to it is uninitialized; otherwise, it will leak memory.
*/
void fossil_version_blob(
Blob *pOut, /* Write the manifest here */
int bVerbose, /* Non-zero for full information. */
int bDescribe /* Non-zero for describe information. */
){
#if defined(FOSSIL_ENABLE_TCL)
int rc;
const char *zRc;
#endif
Stmt q;
size_t pageSize = 0;
blob_zero(pOut);
blob_appendf(pOut, "This is fossil version %s\n",
bDescribe ? get_describe_version() : get_version());
if( !bVerbose ) return;
blob_appendf(pOut, "Compiled on %s %s using %s (%d-bit)\n",
__DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8);
blob_appendf(pOut, "Schema version %s\n", AUX_SCHEMA_MAX);
fossil_get_page_size(&pageSize);
blob_appendf(pOut, "Detected memory page size is %lu bytes\n",
(unsigned long)pageSize);
|
| ︙ | ︙ | |||
1283 1284 1285 1286 1287 1288 1289 | return version; } /* ** COMMAND: version ** | | > > > > > > > > | > > | | 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 |
return version;
}
/*
** COMMAND: version
**
** Usage: %fossil version ?-v|--verbose? ?-d|--describe?
**
** Print the source code version number for the fossil executable.
** If the verbose option is specified, additional details will
** be output about what optional features this binary was compiled
** with
**
** Options:
**
** -d|--describe Show an extended description based on the latest
** tagged source code commit
** -v|--verbose Show additional details will about what optional
** features this binary was compiled with
*/
void version_cmd(void){
Blob versionInfo;
int verboseFlag = find_option("verbose","v",0)!=0;
int describeFlag = find_option("describe","d",0)!=0;
/* We should be done with options.. */
verify_all_options();
fossil_version_blob(&versionInfo, verboseFlag, describeFlag);
fossil_print("%s", blob_str(&versionInfo));
}
/*
** WEBPAGE: version
**
** Show the version information for Fossil.
**
** Query parameters:
**
** verbose Show details
*/
void test_version_page(void){
Blob versionInfo;
int verboseFlag;
int describeFlag;
login_check_credentials();
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
verboseFlag = PD("verbose", 0) != 0;
describeFlag = PD("describe", 0) != 0;
style_header("Version Information");
style_submenu_element("Stat", "stat");
fossil_version_blob(&versionInfo, verboseFlag, describeFlag);
@ <pre>
@ %h(blob_str(&versionInfo))
@ </pre>
style_finish_page();
}
|
| ︙ | ︙ |