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
=== modified file 'summit/common/context_processors.py'
--- summit/common/context_processors.py 2012-04-17 01:53:48 +0000
+++ summit/common/context_processors.py 2012-12-15 02:10:24 +0000
@@ -22,6 +22,7 @@
22from django.conf import settings22from django.conf import settings
2323
24from common.models import Menu24from common.models import Menu
25import version
2526
2627
27def url_base(request):28def url_base(request):
@@ -41,9 +42,8 @@
41 """42 """
42 add The Summit Scheduler version to template context processor.43 add The Summit Scheduler version to template context processor.
43 """44 """
45 return {'summit_version': version.version, 'summit_revno': version.revno}
4446
45 version = getattr(settings, 'VERSION_STRING', 'unknown')
46 return {'summit_version': version}
4747
48def site_menu(request):48def site_menu(request):
49 """49 """
5050
=== modified file 'summit/common/management/commands/release.py'
--- summit/common/management/commands/release.py 2012-01-23 01:18:55 +0000
+++ summit/common/management/commands/release.py 2012-12-15 02:10:24 +0000
@@ -15,12 +15,12 @@
15 except:15 except:
16 bzr_revno = 'unknown'16 bzr_revno = 'unknown'
1717
18 file_name = os.path.join(settings.PROJECT_PATH, "version")18 file_name = os.path.join(settings.PROJECT_PATH, "version.py")
19 if os.path.exists(file_name):19 if os.path.exists(file_name):
20 os.remove(file_name)20 os.remove(file_name)
21 f = open(file_name, "w")21 f = open(file_name, "w")
22 f.write("""version: %s22 f.write("""version = '%s'
23revno: %s23revno = '%s'
24""" % (version, bzr_revno))24""" % (version, bzr_revno))
25 f.close()25 f.close()
26 return (version, bzr_revno)26 return (version, bzr_revno)
2727
=== modified file 'summit/common/templates/base.html'
--- summit/common/templates/base.html 2012-10-10 16:02:28 +0000
+++ summit/common/templates/base.html 2012-12-15 02:10:24 +0000
@@ -103,7 +103,7 @@
103 <p>&copy; Canonical Ltd., Ubuntu Community.</p>103 <p>&copy; Canonical Ltd., Ubuntu Community.</p>
104 <p>Ubuntu and Canonical are registered trademarks of <a href="http://www.canonical.com">Canonical Ltd</a>.</p>104 <p>Ubuntu and Canonical are registered trademarks of <a href="http://www.canonical.com">Canonical Ltd</a>.</p>
105 <p>Problems with Summit? <a href="https://bugs.launchpad.net/summit/+filebug">File a Bug &rsaquo;</a></p>105 <p>Problems with Summit? <a href="https://bugs.launchpad.net/summit/+filebug">File a Bug &rsaquo;</a></p>
106 <p>Summit {{ summit_version }}</p>106 <p>The Summit Scheduler version {{ summit_version }} (revno: {{ summit_revno }})</p>
107 </div>107 </div>
108{% endblock %}108{% endblock %}
109109
110110
=== modified file 'summit/common/utils.py'
--- summit/common/utils.py 2012-08-12 22:32:46 +0000
+++ summit/common/utils.py 2012-12-15 02:10:24 +0000
@@ -10,26 +10,3 @@
10 from shortcuts import redirect as red10 from shortcuts import redirect as red
1111
12 return red(to, *args, **kwargs)12 return red(to, *args, **kwargs)
13
14
15def get_summit_version(version_file, debug):
16 """
17 return the bzr revision number and version of The Summit Scheduler
18 """
19
20 if not os.path.exists(version_file):
21 return "version unknown"
22
23 f = email.message_from_file(open(version_file))
24 version = f["version"]
25 bzr_revno = f["revno"]
26
27 if debug:
28 try:
29 from bzrlib.branch import Branch
30 branch = Branch.open_containing('.')[0]
31 bzr_revno = branch.revno()
32 except:
33 pass
34
35 return "version %s (rev %s)" % (version, bzr_revno)
3613
=== modified file 'summit/settings.py'
--- summit/settings.py 2012-10-09 20:42:22 +0000
+++ summit/settings.py 2012-12-15 02:10:24 +0000
@@ -30,11 +30,6 @@
30OPENID_FOLLOW_RENAMES=True30OPENID_FOLLOW_RENAMES=True
31OPENID_SREG_REQUIRED_FIELDS = ['email']31OPENID_SREG_REQUIRED_FIELDS = ['email']
3232
33from common import utils
34VERSION_STRING = utils.get_summit_version(
35 os.path.join(PROJECT_PATH, "version"),
36 DEBUG)
37
38SITE_ROOT = 'http://summit.ubuntu.com'33SITE_ROOT = 'http://summit.ubuntu.com'
3934
40ADMINS = (35ADMINS = (
4136
=== removed file 'summit/version'
--- summit/version 2012-10-25 15:16:15 +0000
+++ summit/version 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1version: 1.2.5
2revno: 465
30
=== added file 'summit/version.py'
--- summit/version.py 1970-01-01 00:00:00 +0000
+++ summit/version.py 2012-12-15 02:10:24 +0000
@@ -0,0 +1,2 @@
1version = '1.2.5'
2revno = '465'

Subscribers

People subscribed via source and target branches