Mercurial > octave
changeset 24746:52ca22ba4474
include hg ID in displayed version info
* ver.m: Show hg ID along with version in default output.
* version.m: New option, "-hgid".
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 13 Feb 2018 11:02:21 -0500 |
parents | d2467914ce33 |
children | 6114be517240 |
files | scripts/miscellaneous/ver.m scripts/miscellaneous/version.m |
diffstat | 2 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/ver.m Tue Feb 13 01:54:16 2018 -0500 +++ b/scripts/miscellaneous/ver.m Tue Feb 13 11:02:21 2018 -0500 @@ -59,6 +59,8 @@ endif if (nargout == 0) + hg_id = __octave_config_info__ ("hg_id"); + [unm, err] = uname (); if (err) @@ -70,7 +72,7 @@ hbar(1:70) = "-"; desc = {hbar - ["GNU Octave Version: " OCTAVE_VERSION] + ["GNU Octave Version: " OCTAVE_VERSION " (hg id: " hg_id ")"] ["GNU Octave License: " license] ["Operating System: " os_string] hbar}; @@ -90,7 +92,8 @@ lst = pkg ("list"); ## Start with the version info for Octave retval = struct ("Name", "Octave", "Version", version, - "Release", [], "Date", []); + "Release", [], + "Date", __octave_config_info__ ("release_date")); for i = 1:numel (lst) retval(end+1) = struct ("Name", lst{i}.name, "Version", lst{i}.version, "Release", [], "Date", lst{i}.date);
--- a/scripts/miscellaneous/version.m Tue Feb 13 01:54:16 2018 -0500 +++ b/scripts/miscellaneous/version.m Tue Feb 13 11:02:21 2018 -0500 @@ -49,6 +49,9 @@ ## ## @item @qcode{"-lapack"} ## for version information for the linked @sc{lapack}. +## +## @item @qcode{"-hgid"} +## the mercurial ID of the sources used to build Octave. ## @end table ## ## The variant with no input and output argument is an alias for the function @@ -98,6 +101,8 @@ v = __blas_version__ (); case "-lapack" v = __lapack_version__ (); + case "-hgid" + v = __octave_config_info__ ("hg_id"); otherwise error ("version: invalid FEATURE"); endswitch