Merge lp:~cjohnston/summit/963312 into lp:summit

Proposed by Chris Johnston
Status: Merged
Approved by: Adnane Belmadiaf
Approved revision: 475
Merged at revision: 475
Proposed branch: lp:~cjohnston/summit/963312
Merge into: lp:summit
Diff against target: 116 lines (+8/-36)
7 files modified
summit/common/context_processors.py (+2/-2)
summit/common/management/commands/release.py (+3/-3)
summit/common/templates/base.html (+1/-1)
summit/common/utils.py (+0/-23)
summit/settings.py (+0/-5)
summit/version (+0/-2)
summit/version.py (+2/-0)
To merge this branch: bzr merge lp:~cjohnston/summit/963312
Reviewer Review Type Date Requested Status
Adnane Belmadiaf Approve
Review via email: mp+140057@code.launchpad.net

Commit message

Changes the way Summit parses version info

Description of the change

Changes the way Summit parses version info

To post a comment you must log in.
Revision history for this message
Adnane Belmadiaf (daker) wrote :

+1 from me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'summit/common/context_processors.py'
2--- summit/common/context_processors.py 2012-04-17 01:53:48 +0000
3+++ summit/common/context_processors.py 2012-12-15 02:10:24 +0000
4@@ -22,6 +22,7 @@
5 from django.conf import settings
6
7 from common.models import Menu
8+import version
9
10
11 def url_base(request):
12@@ -41,9 +42,8 @@
13 """
14 add The Summit Scheduler version to template context processor.
15 """
16+ return {'summit_version': version.version, 'summit_revno': version.revno}
17
18- version = getattr(settings, 'VERSION_STRING', 'unknown')
19- return {'summit_version': version}
20
21 def site_menu(request):
22 """
23
24=== modified file 'summit/common/management/commands/release.py'
25--- summit/common/management/commands/release.py 2012-01-23 01:18:55 +0000
26+++ summit/common/management/commands/release.py 2012-12-15 02:10:24 +0000
27@@ -15,12 +15,12 @@
28 except:
29 bzr_revno = 'unknown'
30
31- file_name = os.path.join(settings.PROJECT_PATH, "version")
32+ file_name = os.path.join(settings.PROJECT_PATH, "version.py")
33 if os.path.exists(file_name):
34 os.remove(file_name)
35 f = open(file_name, "w")
36- f.write("""version: %s
37-revno: %s
38+ f.write("""version = '%s'
39+revno = '%s'
40 """ % (version, bzr_revno))
41 f.close()
42 return (version, bzr_revno)
43
44=== modified file 'summit/common/templates/base.html'
45--- summit/common/templates/base.html 2012-10-10 16:02:28 +0000
46+++ summit/common/templates/base.html 2012-12-15 02:10:24 +0000
47@@ -103,7 +103,7 @@
48 <p>&copy; Canonical Ltd., Ubuntu Community.</p>
49 <p>Ubuntu and Canonical are registered trademarks of <a href="http://www.canonical.com">Canonical Ltd</a>.</p>
50 <p>Problems with Summit? <a href="https://bugs.launchpad.net/summit/+filebug">File a Bug &rsaquo;</a></p>
51- <p>Summit {{ summit_version }}</p>
52+ <p>The Summit Scheduler version {{ summit_version }} (revno: {{ summit_revno }})</p>
53 </div>
54 {% endblock %}
55
56
57=== modified file 'summit/common/utils.py'
58--- summit/common/utils.py 2012-08-12 22:32:46 +0000
59+++ summit/common/utils.py 2012-12-15 02:10:24 +0000
60@@ -10,26 +10,3 @@
61 from shortcuts import redirect as red
62
63 return red(to, *args, **kwargs)
64-
65-
66-def get_summit_version(version_file, debug):
67- """
68- return the bzr revision number and version of The Summit Scheduler
69- """
70-
71- if not os.path.exists(version_file):
72- return "version unknown"
73-
74- f = email.message_from_file(open(version_file))
75- version = f["version"]
76- bzr_revno = f["revno"]
77-
78- if debug:
79- try:
80- from bzrlib.branch import Branch
81- branch = Branch.open_containing('.')[0]
82- bzr_revno = branch.revno()
83- except:
84- pass
85-
86- return "version %s (rev %s)" % (version, bzr_revno)
87
88=== modified file 'summit/settings.py'
89--- summit/settings.py 2012-10-09 20:42:22 +0000
90+++ summit/settings.py 2012-12-15 02:10:24 +0000
91@@ -30,11 +30,6 @@
92 OPENID_FOLLOW_RENAMES=True
93 OPENID_SREG_REQUIRED_FIELDS = ['email']
94
95-from common import utils
96-VERSION_STRING = utils.get_summit_version(
97- os.path.join(PROJECT_PATH, "version"),
98- DEBUG)
99-
100 SITE_ROOT = 'http://summit.ubuntu.com'
101
102 ADMINS = (
103
104=== removed file 'summit/version'
105--- summit/version 2012-10-25 15:16:15 +0000
106+++ summit/version 1970-01-01 00:00:00 +0000
107@@ -1,2 +0,0 @@
108-version: 1.2.5
109-revno: 465
110
111=== added file 'summit/version.py'
112--- summit/version.py 1970-01-01 00:00:00 +0000
113+++ summit/version.py 2012-12-15 02:10:24 +0000
114@@ -0,0 +1,2 @@
115+version = '1.2.5'
116+revno = '465'

Subscribers

People subscribed via source and target branches