aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/utils/universal.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-10-30 13:08:47 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-02-01 17:01:30 -0500
commitc9ac73a4da52b093feac90591efa8fe1b5ef2f42 (patch)
tree0c52b78da460bccb35724cc05f3d2ecf6d26bd6a /mesonbuild/utils/universal.py
parenta21af43200e13fa65e12bdbe5116a0cecc4990b3 (diff)
downloadmeson-c9ac73a4da52b093feac90591efa8fe1b5ef2f42.zip
meson-c9ac73a4da52b093feac90591efa8fe1b5ef2f42.tar.gz
meson-c9ac73a4da52b093feac90591efa8fe1b5ef2f42.tar.bz2
simplify instantiation of builtin type using builtins instead of functions
Diffstat (limited to 'mesonbuild/utils/universal.py')
-rw-r--r--mesonbuild/utils/universal.py36
1 files changed, 32 insertions, 4 deletions
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index 5c91449..b0cc252 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -736,10 +736,38 @@ def windows_detect_native_arch() -> str:
def detect_vcs(source_dir: T.Union[str, Path]) -> T.Optional[T.Dict[str, str]]:
vcs_systems = [
- dict(name = 'git', cmd = 'git', repo_dir = '.git', get_rev = 'git describe --dirty=+', rev_regex = '(.*)', dep = '.git/logs/HEAD'),
- dict(name = 'mercurial', cmd = 'hg', repo_dir = '.hg', get_rev = 'hg id -i', rev_regex = '(.*)', dep = '.hg/dirstate'),
- dict(name = 'subversion', cmd = 'svn', repo_dir = '.svn', get_rev = 'svn info', rev_regex = 'Revision: (.*)', dep = '.svn/wc.db'),
- dict(name = 'bazaar', cmd = 'bzr', repo_dir = '.bzr', get_rev = 'bzr revno', rev_regex = '(.*)', dep = '.bzr'),
+ {
+ 'name': 'git',
+ 'cmd': 'git',
+ 'repo_dir': '.git',
+ 'get_rev': 'git describe --dirty=+',
+ 'rev_regex': '(.*)',
+ 'dep': '.git/logs/HEAD'
+ },
+ {
+ 'name': 'mercurial',
+ 'cmd': 'hg',
+ 'repo_dir': '.hg',
+ 'get_rev': 'hg id -i',
+ 'rev_regex': '(.*)',
+ 'dep': '.hg/dirstate'
+ },
+ {
+ 'name': 'subversion',
+ 'cmd': 'svn',
+ 'repo_dir': '.svn',
+ 'get_rev': 'svn info',
+ 'rev_regex': 'Revision: (.*)',
+ 'dep': '.svn/wc.db'
+ },
+ {
+ 'name': 'bazaar',
+ 'cmd': 'bzr',
+ 'repo_dir': '.bzr',
+ 'get_rev': 'bzr revno',
+ 'rev_regex': '(.*)',
+ 'dep': '.bzr'
+ },
]
if isinstance(source_dir, str):
source_dir = Path(source_dir)