jhbuild r2024 - in trunk: . doc/C jhbuild/commands jhbuild/modtypes jhbuild/versioncontrol
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: jhbuild r2024 - in trunk: . doc/C jhbuild/commands jhbuild/modtypes jhbuild/versioncontrol
- Date: Tue, 15 Apr 2008 19:50:33 +0100 (BST)
Author: fpeters
Date: Tue Apr 15 19:50:33 2008
New Revision: 2024
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2024&view=rev
Log:
* jhbuild/commands/info.py, jhbuild/modtypes/distutils.py,
jhbuild/versioncontrol/git.py, jhbuild/versioncontrol/mtn.py,
doc/C/jhbuild.xml: changed jhbuild info to print info on all modules
when there is no module specified; also fixed issues with getting
revision info for git and monotone modules.
Modified:
trunk/ChangeLog
trunk/doc/C/jhbuild.xml
trunk/jhbuild/commands/info.py
trunk/jhbuild/modtypes/distutils.py
trunk/jhbuild/versioncontrol/git.py
trunk/jhbuild/versioncontrol/mtn.py
Modified: trunk/doc/C/jhbuild.xml
==============================================================================
--- trunk/doc/C/jhbuild.xml (original)
+++ trunk/doc/C/jhbuild.xml Tue Apr 15 19:50:33 2008
@@ -808,6 +808,9 @@
JHBuild. It may also print some information specific to the
module type, such as the CVS repository or download URL.</para>
+ <para>If there is no module specified the command will print information
+ about all the modules defined in the module set.</para>
+
</section>
<section id="command-reference-list">
Modified: trunk/jhbuild/commands/info.py
==============================================================================
--- trunk/jhbuild/commands/info.py (original)
+++ trunk/jhbuild/commands/info.py Tue Apr 15 19:50:33 2008
@@ -41,19 +41,21 @@
name = 'info'
usage_args = '[ modules ... ]'
+
def run(self, config, options, args):
packagedb = jhbuild.frontends.get_buildscript(config, []).packagedb
module_set = jhbuild.moduleset.load(config)
- if not args:
- self.parser.error('This command requires a module parameter.')
-
- for modname in args:
- try:
- module = module_set.modules[modname]
- except KeyError:
- raise FatalError('unknown module %s' % modname)
- self.show_info(module, packagedb, module_set)
+ if args:
+ for modname in args:
+ try:
+ module = module_set.modules[modname]
+ except KeyError:
+ raise FatalError('unknown module %s' % modname)
+ self.show_info(module, packagedb, module_set)
+ else:
+ for module in module_set.modules.values():
+ self.show_info(module, packagedb, module_set)
def show_info(self, module, packagedb, module_set):
installdate = packagedb.installdate(module.name, module.get_revision() or '')
Modified: trunk/jhbuild/modtypes/distutils.py
==============================================================================
--- trunk/jhbuild/modtypes/distutils.py (original)
+++ trunk/jhbuild/modtypes/distutils.py Tue Apr 15 19:50:33 2008
@@ -56,7 +56,7 @@
return self.get_srcdir(buildscript)
def get_revision(self):
- return self.branch.branchname
+ return self.branch.tree_id()
def do_start(self, buildscript):
pass
Modified: trunk/jhbuild/versioncontrol/git.py
==============================================================================
--- trunk/jhbuild/versioncontrol/git.py (original)
+++ trunk/jhbuild/versioncontrol/git.py Tue Apr 15 19:50:33 2008
@@ -45,6 +45,10 @@
urlparse.uses_relative.append('ssh')
+class GitUnknownBranchNameError(Exception):
+ pass
+
+
class GitRepository(Repository):
"""A class representing a GIT repository.
@@ -115,7 +119,7 @@
'origin/master', 'origin/trunk', 'master', 'trunk']:
if self.branch_exist(b):
return b
- raise
+ raise GitUnknownBranchNameError()
branchname = property(branchname)
def _get_commit_from_date(self):
@@ -214,8 +218,13 @@
def tree_id(self):
if not os.path.exists(self.srcdir):
return None
- output = get_output(['git-rev-parse', self.branchname],
- cwd = self.srcdir)
+ try:
+ output = get_output(['git-rev-parse', self.branchname],
+ cwd = self.srcdir)
+ except CommandError:
+ return None
+ except GitUnknownBranchNameError:
+ return None
return output.strip()
Modified: trunk/jhbuild/versioncontrol/mtn.py
==============================================================================
--- trunk/jhbuild/versioncontrol/mtn.py (original)
+++ trunk/jhbuild/versioncontrol/mtn.py Tue Apr 15 19:50:33 2008
@@ -148,8 +148,11 @@
self._checkout(buildscript)
def tree_id(self):
- output = get_output(['mtn', 'automate', 'get_base_revision_id'],
- cwd=self.srcdir)
+ try:
+ output = get_output(['mtn', 'automate', 'get_base_revision_id'],
+ cwd=self.srcdir)
+ except CommandError:
+ return None
return output[0]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]