[jhbuild] Better error message for wrong or missing branch/repo (GNOME bug 683639)
- From: Craig Keogh <cskeogh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] Better error message for wrong or missing branch/repo (GNOME bug 683639)
- Date: Sun, 30 Sep 2012 00:21:46 +0000 (UTC)
commit 99bbc497b2ce7d9cbe4331d220e8ed5ca321132d
Author: Marcin Wojdyr <wojdyr gmail com>
Date: Sat Sep 8 20:44:40 2012 +0100
Better error message for wrong or missing branch/repo (GNOME bug 683639)
Previously message accidently contained dict:
Possible repositories are {u'files':
<jhbuild.versioncontrol.tarball.TarballRepository object at
0x7f0c15982390>,
jhbuild/modtypes/__init__.py | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index 69e560f..e36920f 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -143,16 +143,17 @@ def get_branch(node, repositories, default_repo, config):
try:
repo = repositories[childnode.getAttribute('repo')]
except KeyError:
+ repo_names = ', '.join([r.name for r in repositories.values()])
raise UndefinedRepositoryError(
_('Repository=%(missing)s not found for module id=%(module)s. Possible repositories are %(possible)s'
- % {'missing': childnode.getAttribute('repo'), 'module': name, 'possible': repositories}))
+ % {'missing': childnode.getAttribute('repo'), 'module': name,
+ 'possible': repo_names}))
+ elif default_repo:
+ repo = repositories[default_repo]
else:
- try:
- repo = repositories[default_repo]
- except KeyError:
- raise UndefinedRepositoryError(
- _('Default repository=%(missing)s not found for module id=%(module)s. Possible repositories are %(possible)s'
- % {'missing': default_repo, 'module': name, 'possible': repositories}))
+ raise UndefinedRepositoryError(
+ _('No repository for module id=%(module)s. Either set branch/repo or default repository.'
+ % {'module': name}))
if repo.mirrors:
mirror_type = config.mirror_policy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]