From e271d3d10c821b0dcb6bc71ceffd64f20b401f34 Mon Sep 17 00:00:00 2001 From: Gary Kramlich Date: Tue, 24 Dec 2024 00:05:50 -0600 Subject: [PATCH] Add support for .hg_archival to detect_vcs This allows vcs_tag() to work on a mercurial archived tarball so programs can display the revision at runtime. --- mesonbuild/utils/universal.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py index f26a9a3de8c6..c0afaebb4d66 100644 --- a/mesonbuild/utils/universal.py +++ b/mesonbuild/utils/universal.py @@ -772,6 +772,14 @@ def detect_vcs(source_dir: T.Union[str, Path]) -> T.Optional[T.Dict[str, str]]: 'rev_regex': '(.*)', 'dep': '.hg/dirstate' }, + { + 'name': 'mercurial', + 'cmd': 'cat', + 'repo_dir': '.', + 'get_rev': 'cat .hg_archival.txt', + 'rev_regex': 'node: (.*)\n', + 'dep': '.hg_archival.txt' + }, { 'name': 'subversion', 'cmd': 'svn',