# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1682524516 -7200 # Wed Apr 26 17:55:16 2023 +0200 # Node ID b553de2cc3b95a34b01df36adb53ff30dc34d6ab # Parent 300b2ed1a75a6df93df491843774d1a2cb398e5c 📠docker_dev_start: better version number diff --git a/NEWS.rst b/NEWS.rst --- a/NEWS.rst +++ b/NEWS.rst @@ -2,15 +2,15 @@ History ======= -20.3.1 ------- - -run_tests: exclude all manifest from coverage, previous exclusion did not apply for installable modules. - 20.3.0 ------ -docker_dev_start: clearer message for missing redner image name. +docker_dev_start: + +- Clearer message for missing redner image name. +- Improve version string: include next version and topic for mercurial super projects. + +run_tests: exclude all manifest from coverage, previous exclusion did not apply for installable modules. 20.2.0 ------ diff --git a/odoo_scripts/docker_dev_start.py b/odoo_scripts/docker_dev_start.py --- a/odoo_scripts/docker_dev_start.py +++ b/odoo_scripts/docker_dev_start.py @@ -56,7 +56,7 @@ __version__ = "3.12.0" __date__ = "2017-08-11" -__updated__ = "2023-04-21" +__updated__ = "2023-04-26" def __parser(project_name: str) -> ArgumentParser: @@ -1188,20 +1188,24 @@ project_version = "local" if os.path.exists(".hg"): + # Next version guessing could be done by using marabunta yaml and using it + # rather than doing latesttag.1 project_version = check_output( [ "hg", - "log", - "-r", - ".", + "identify", "-T", - "{latesttag}{sub('^-0-.*', '', '-{latesttagdistance}-m{node|short}')}", + "{latesttag}{if('{dirty}', '.1.dev{latesttagdistance}{if('{topic}', ' {" + "fqbn}')}', '{ifeq('{latesttagdistance}', 1, '', '{ifeq('{latesttagdist" + "ance}', 2, '', '.1.dev{latesttagdistance}{if('{topic}', ' {fqbn}')}')}" + "')}')}", ] ).decode() if os.path.exists(".git"): project_version = check_output(["git", "describe"]).decode() + options["environment"]["VERSION_PACKAGE"] = "" options["environment"]["SENTRY_RELEASE"] = project_version options["environment"]["VERSION"] = project_version