Merge lp:~rackspace-titan/glance/add-authors-lp706387 into lp:~hudson-openstack/glance/trunk

Proposed by Brian Waldon
Status: Merged
Approved by: Todd Willey
Approved revision: 127
Merged at revision: 128
Proposed branch: lp:~rackspace-titan/glance/add-authors-lp706387
Merge into: lp:~hudson-openstack/glance/trunk
Diff against target: 146 lines (+111/-2)
5 files modified
.mailmap (+11/-0)
Authors (+20/-0)
bin/glance (+2/-2)
tests/unit/test_misc.py (+77/-0)
tools/pip-requires (+1/-0)
To merge this branch: bzr merge lp:~rackspace-titan/glance/add-authors-lp706387
Reviewer Review Type Date Requested Status
Todd Willey (community) Approve
Jay Pipes (community) Approve
Review via email: mp+59264@code.launchpad.net

Description of the change

Adding prefilled Authors, mailmap files
Adding test to validate Authors file is properly set up

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Tested locally. All looks good, all tests passing. Nice work, B-dog. ;)

review: Approve
Revision history for this message
Todd Willey (xtoddx) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.mailmap'
2--- .mailmap 1970-01-01 00:00:00 +0000
3+++ .mailmap 2011-04-27 18:03:22 +0000
4@@ -0,0 +1,11 @@
5+# Format is:
6+# <preferred e-mail> <other e-mail 1>
7+# <preferred e-mail> <other e-mail 2>
8+<corywright@gmail.com> <cory.wright@rackspace.com>
9+<jsuh@isi.edu> <jsuh@bespin>
10+<josh@jk0.org> <josh.kearney@rackspace.com>
11+<rconradharris@gmail.com> <rick.harris@rackspace.com>
12+<rconradharris@gmail.com> <rick@quasar.racklabs.com>
13+<rick@openstack.org> <rclark@chat-blanc>
14+<soren.hansen@rackspace.com> <soren@linux2go.dk>
15+<soren.hansen@rackspace.com> <soren@openstack.org>
16
17=== added file 'Authors'
18--- Authors 1970-01-01 00:00:00 +0000
19+++ Authors 2011-04-27 18:03:22 +0000
20@@ -0,0 +1,20 @@
21+Andrey Brindeyev <abrindeyev@griddynamics.com>
22+Brian Waldon <brian.waldon@rackspace.com>
23+Christopher MacGown <chris@slicehost.com>
24+Cory Wright <corywright@gmail.com>
25+Dan Prince <dan.prince@rackspace.com>
26+Donal Lafferty <donal.lafferty@citrix.com>
27+Eldar Nugaev <enugaev@griddynamics.com>
28+Ewan Mellor <ewan.mellor@citrix.com>
29+Jay Pipes <jaypipes@gmail.com>
30+Jinwoo 'Joseph' Suh <jsuh@isi.edu>
31+Josh Kearney <josh@jk0.org>
32+Ken Pepple <ken.pepple@gmail.com>
33+Matt Dietz <matt.dietz@rackspace.com>
34+Monty Taylor <mordred@inaugust.com>
35+Rick Clark <rick@openstack.org>
36+Rick Harris <rconradharris@gmail.com>
37+Soren Hansen <soren.hansen@rackspace.com>
38+Taku Fukushima <tfukushima@dcl.info.waseda.ac.jp>
39+Thierry Carrez <thierry@openstack.org>
40+Vishvananda Ishaya <vishvananda@gmail.com>
41
42=== modified file 'bin/glance'
43--- bin/glance 2011-04-26 04:27:41 +0000
44+++ bin/glance 2011-04-27 18:03:22 +0000
45@@ -209,8 +209,8 @@
46 pieces = str(e).split('\n')
47 for piece in pieces:
48 print piece
49- print ("Note: Your image metadata may still be in the registry, but "
50- "the image's status will likely be 'killed'.")
51+ print ("Note: Your image metadata may still be in the registry, "
52+ "but the image's status will likely be 'killed'.")
53 return FAILURE
54 else:
55 print "Dry run. We would have done the following:"
56
57=== added file 'tests/unit/test_misc.py'
58--- tests/unit/test_misc.py 1970-01-01 00:00:00 +0000
59+++ tests/unit/test_misc.py 2011-04-27 18:03:22 +0000
60@@ -0,0 +1,77 @@
61+# vim: tabstop=4 shiftwidth=4 softtabstop=4
62+
63+# Copyright 2010-2011 OpenStack, LLC
64+# All Rights Reserved.
65+#
66+# Licensed under the Apache License, Version 2.0 (the "License"); you may
67+# not use this file except in compliance with the License. You may obtain
68+# a copy of the License at
69+#
70+# http://www.apache.org/licenses/LICENSE-2.0
71+#
72+# Unless required by applicable law or agreed to in writing, software
73+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
74+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
75+# License for the specific language governing permissions and limitations
76+# under the License.
77+
78+import os
79+import unittest
80+
81+
82+def parse_mailmap(mailmap='.mailmap'):
83+ mapping = {}
84+ if os.path.exists(mailmap):
85+ fp = open(mailmap, 'r')
86+ for l in fp:
87+ l = l.strip()
88+ if not l.startswith('#') and ' ' in l:
89+ canonical_email, alias = l.split(' ')
90+ mapping[alias] = canonical_email
91+ return mapping
92+
93+
94+def str_dict_replace(s, mapping):
95+ for s1, s2 in mapping.iteritems():
96+ s = s.replace(s1, s2)
97+ return s
98+
99+
100+class AuthorsTestCase(unittest.TestCase):
101+ def test_authors_up_to_date(self):
102+ topdir = os.path.normpath(os.path.dirname(__file__) + '/../../')
103+ if os.path.exists(os.path.join(topdir, '.bzr')):
104+ contributors = set()
105+
106+ mailmap = parse_mailmap(os.path.join(topdir, '.mailmap'))
107+
108+ import bzrlib.workingtree
109+ tree = bzrlib.workingtree.WorkingTree.open(topdir)
110+ tree.lock_read()
111+ try:
112+ parents = tree.get_parent_ids()
113+ g = tree.branch.repository.get_graph()
114+ for p in parents:
115+ rev_ids = [r for r, _ in g.iter_ancestry(parents)
116+ if r != "null:"]
117+ revs = tree.branch.repository.get_revisions(rev_ids)
118+ for r in revs:
119+ for author in r.get_apparent_authors():
120+ email = author.split(' ')[-1]
121+ mailmapped = str_dict_replace(email, mailmap)
122+ contributors.add(mailmapped)
123+
124+ authors_file = open(os.path.join(topdir, 'Authors'),
125+ 'r').read()
126+
127+ missing = set()
128+ for contributor in contributors:
129+ if contributor == 'glance-core':
130+ continue
131+ if not contributor in authors_file:
132+ missing.add(contributor)
133+
134+ self.assertTrue(len(missing) == 0,
135+ '%r not listed in Authors' % missing)
136+ finally:
137+ tree.unlock()
138
139=== modified file 'tools/pip-requires'
140--- tools/pip-requires 2011-02-27 20:54:29 +0000
141+++ tools/pip-requires 2011-04-27 18:03:22 +0000
142@@ -15,3 +15,4 @@
143 swift
144 -f http://pymox.googlecode.com/files/mox-0.5.0.tar.gz
145 sqlalchemy-migrate>=0.6
146+bzr

Subscribers

People subscribed via source and target branches