[jhbuild] BzrRepository.tree_id(): return None if revision-info fails
- From: Craig Keogh <cskeogh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] BzrRepository.tree_id(): return None if revision-info fails
- Date: Sat, 14 Apr 2012 08:16:12 +0000 (UTC)
commit d81552e0d36cb1a9dd52dadff86ef6455f490c0f
Author: Marcin Wojdyr <wojdyr gmail com>
Date: Tue Mar 6 12:11:34 2012 +0000
BzrRepository.tree_id(): return None if revision-info fails
(it fails in the export mode)
Removed special handling of bzr < 1.17.
jhbuild/versioncontrol/bzr.py | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/jhbuild/versioncontrol/bzr.py b/jhbuild/versioncontrol/bzr.py
index bb26d14..5df28f3 100644
--- a/jhbuild/versioncontrol/bzr.py
+++ b/jhbuild/versioncontrol/bzr.py
@@ -207,15 +207,13 @@ Remove it or change your dvcs_mirror_dir settings.""") % self.srcdir)
def tree_id(self):
if not os.path.exists(self.srcdir):
return None
- else:
- try:
- # --tree is relatively new (bzr 1.17)
- cmd = ['bzr', 'revision-info', '--tree']
- tree_id = get_output(cmd, cwd=self.srcdir).strip()
- except:
- cmd = ['bzr', 'revision-info']
- tree_id = get_output(cmd, cwd=self.srcdir).strip()
- return tree_id
+ try:
+ # --tree is new in bzr 1.17
+ cmd = ['bzr', 'revision-info', '--tree']
+ tree_id = get_output(cmd, cwd=self.srcdir).strip()
+ except CommandError:
+ return None
+ return tree_id
def to_sxml(self):
attrs = {}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]