Merge lp:~elachuni/ubuntu-webcatalog/bzr-revno into lp:ubuntu-webcatalog

Proposed by Anthony Lenton
Status: Rejected
Rejected by: Natalia Bidart
Proposed branch: lp:~elachuni/ubuntu-webcatalog/bzr-revno
Merge into: lp:ubuntu-webcatalog
Diff against target: 92 lines (+29/-2)
5 files modified
django_project/config/main.cfg (+3/-0)
setup.py (+1/-0)
src/webcatalog/__init__.py (+22/-2)
src/webcatalog/preflight.py (+2/-0)
src/webcatalog/tests/test_preflight.py (+1/-0)
To merge this branch: bzr merge lp:~elachuni/ubuntu-webcatalog/bzr-revno
Reviewer Review Type Date Requested Status
Michael Nelson (community) Approve
Review via email: mp+151308@code.launchpad.net

Description of the change

This branch adds the bzr branch rev. number to the list of reported versions on the preflight page.
Now that we're rolling out to staging faster than you can say 'ping webops', we need this :)

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Is the hard-coded 13.02 really necessary?

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Setting MP as Rejected to reduce numbers of landing candidates in @reviewlist.
Change status again if this MP is still current.

Unmerged revisions

180. By Anthony Lenton

Fixed preflight test.

179. By Anthony Lenton

Added bzr revno to reported versions in preflight.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/config/main.cfg'
2--- django_project/config/main.cfg 2013-02-28 16:23:58 +0000
3+++ django_project/config/main.cfg 2013-03-01 19:16:20 +0000
4@@ -140,3 +140,6 @@
5 celery_imports = webcatalog.tasks
6 celery_result_backend = database
7 celerybeat_scheduler = djcelery.schedulers.DatabaseScheduler
8+
9+[preflight]
10+preflight_groups = developers
11
12=== modified file 'setup.py'
13--- setup.py 2013-02-28 16:23:58 +0000
14+++ setup.py 2013-03-01 19:16:20 +0000
15@@ -33,6 +33,7 @@
16 packages = find_packages('src'),
17 package_dir = {'': 'src'},
18 install_requires = [
19+ 'bzr',
20 'django',
21 'setuptools',
22 'south==0.7.3',
23
24=== modified file 'src/webcatalog/__init__.py'
25--- src/webcatalog/__init__.py 2012-06-28 14:28:26 +0000
26+++ src/webcatalog/__init__.py 2013-03-01 19:16:20 +0000
27@@ -1,6 +1,6 @@
28 # -*- coding: utf-8 -*-
29 # This file is part of the Apps Directory
30-# Copyright (C) 2011 Canonical Ltd.
31+# Copyright (C) 2011-2013 Canonical Ltd.
32 #
33 # This program is free software: you can redistribute it and/or modify
34 # it under the terms of the GNU Affero General Public License as
35@@ -15,4 +15,24 @@
36 # You should have received a copy of the GNU Affero General Public License
37 # along with this program. If not, see <http://www.gnu.org/licenses/>.
38
39-__version__ = '12.06.2; r136'
40+
41+def _get_revno(path):
42+ import bzrlib.errors
43+ import bzrlib.workingtree
44+ try:
45+ t = bzrlib.workingtree.WorkingTree.open_containing(path)[0]
46+ except (bzrlib.errors.NotBranchError, bzrlib.errors.NoWorkingTree):
47+ return None
48+ else:
49+ return t.branch.revno()
50+
51+
52+def _version_for_path(path):
53+ revno = _get_revno(path)
54+ if revno is None:
55+ return "unknown"
56+ else:
57+ return '13.02 r%s' % (revno,)
58+
59+
60+__version__ = _version_for_path(__file__)
61
62=== modified file 'src/webcatalog/preflight.py'
63--- src/webcatalog/preflight.py 2012-09-28 15:02:24 +0000
64+++ src/webcatalog/preflight.py 2013-03-01 19:16:20 +0000
65@@ -27,6 +27,7 @@
66 import openid
67 import piston.utils
68
69+import webcatalog
70 from webcatalog.utilities import WebServices
71
72 __metaclass__ = type
73@@ -46,6 +47,7 @@
74
75 def versions(self):
76 return [
77+ {'name': 'webcatalog', 'version': webcatalog.__version__},
78 {'name': 'openid', 'version': openid.__version__},
79 {'name': 'piston', 'version': piston.utils.get_version()},
80 ]
81
82=== modified file 'src/webcatalog/tests/test_preflight.py'
83--- src/webcatalog/tests/test_preflight.py 2012-10-17 07:46:31 +0000
84+++ src/webcatalog/tests/test_preflight.py 2013-03-01 19:16:20 +0000
85@@ -83,6 +83,7 @@
86 'Django',
87 'Platform',
88 'preflight',
89+ 'webcatalog',
90 ])
91 expected_checks = set([
92 ('validate_config', True),

Subscribers

People subscribed via source and target branches