aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-09-09 10:31:44 -0400
committerXavier Claessens <xclaesse@gmail.com>2020-09-10 11:39:30 -0400
commita3ac25b0c3b1d671090acb14273af7d942bf07ce (patch)
tree4defb394da9769f4d1edaa9a90f280f4b1265b21
parent552432e50731b3803d7d637dd4bf38c4f52ecf08 (diff)
downloadmeson-a3ac25b0c3b1d671090acb14273af7d942bf07ce.zip
meson-a3ac25b0c3b1d671090acb14273af7d942bf07ce.tar.gz
meson-a3ac25b0c3b1d671090acb14273af7d942bf07ce.tar.bz2
msubprojects: Fix review comments
-rw-r--r--docs/markdown/Subprojects.md4
-rwxr-xr-xmesonbuild/msubprojects.py10
2 files changed, 10 insertions, 4 deletions
diff --git a/docs/markdown/Subprojects.md b/docs/markdown/Subprojects.md
index 57f5176..5dae0e8 100644
--- a/docs/markdown/Subprojects.md
+++ b/docs/markdown/Subprojects.md
@@ -264,10 +264,10 @@ the following command-line options:
`meson subprojects` has various subcommands to manage all subprojects. If the
subcommand fails on any subproject the execution continues with other subprojects.
-All subcommands accepts `--sourcedir` argument pointing to the root source dir
+All subcommands accept `--sourcedir` argument pointing to the root source dir
of the main project.
-*Since 0.56.0* all subcommands accepts `--type <file,git,hg,svn>` argument to
+*Since 0.56.0* all subcommands accept `--type <file|git|hg|svn>` argument to
run the subcommands only on subprojects of the given type.
*Since 0.56.0* If the subcommand fails on any subproject an error code is returned
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index 1eecc17..22729d4 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -45,7 +45,7 @@ def git_output(cmd, workingdir):
return quiet_git(cmd, workingdir, check=True)[1]
def git_stash(workingdir):
- # Don't pipe stdout here because we want the user to see his changes have
+ # Don't pipe stdout here because we want the user to see their changes have
# been saved.
verbose_git(['stash'], workingdir, check=True)
@@ -118,7 +118,13 @@ def update_git(wrap, repo_dir, options):
# It could be a detached git submodule for example.
mlog.log(' -> No revision specified.')
return True
- branch = git_output(['branch', '--show-current'], repo_dir).strip()
+ try:
+ branch = git_output(['branch', '--show-current'], repo_dir).strip()
+ except GitException as e:
+ mlog.log(' -> Failed to determine current branch in', mlog.bold(repo_dir))
+ mlog.log(mlog.red(e.output))
+ mlog.log(mlog.red(str(e)))
+ return False
# Fetch only the revision we need, this avoids fetching useless branches and
# is needed for http case were new remote branches wouldn't be discovered
# otherwise. After this command, FETCH_HEAD is the revision we want.