Merge lp:~soren/nova/authors-check-fix into lp:~hudson-openstack/nova/trunk

Proposed by Soren Hansen
Status: Merged
Approved by: Paul Voccio
Approved revision: 784
Merged at revision: 805
Proposed branch: lp:~soren/nova/authors-check-fix
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 61 lines (+9/-5)
3 files modified
.mailmap (+1/-0)
Authors (+1/-0)
nova/tests/test_misc.py (+7/-5)
To merge this branch: bzr merge lp:~soren/nova/authors-check-fix
Reviewer Review Type Date Requested Status
Paul Voccio (community) Approve
Cory Wright (community) Approve
Review via email: mp+52984@code.launchpad.net

Commit message

Make Authors check account for tests being run with different os.getcwd() depending on how they're run. Add missing people to Authors.

Description of the change

At some point, something changed in the way we run tests, so instead of the current working directory being the top level dir, it's now the tests dir. This broke an assumption in the Authors check.

To post a comment you must log in.
Revision history for this message
Cory Wright (corywright) wrote :

lgtm

review: Approve
Revision history for this message
Paul Voccio (pvo) wrote :

okie dokie

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.mailmap'
2--- .mailmap 2011-03-03 05:10:42 +0000
3+++ .mailmap 2011-03-11 09:01:16 +0000
4@@ -28,6 +28,7 @@
5 <matt.dietz@rackspace.com> <matthewdietz@Matthew-Dietzs-MacBook-Pro.local>
6 <matt.dietz@rackspace.com> <mdietz@openstack>
7 <mordred@inaugust.com> <mordred@hudson>
8+<nirmal.ranganathan@rackspace.com> <nirmal.ranganathan@rackspace.coom>
9 <paul@openstack.org> <paul.voccio@rackspace.com>
10 <paul@openstack.org> <pvoccio@castor.local>
11 <rconradharris@gmail.com> <rick.harris@rackspace.com>
12
13=== modified file 'Authors'
14--- Authors 2011-03-03 05:10:42 +0000
15+++ Authors 2011-03-11 09:01:16 +0000
16@@ -19,6 +19,7 @@
17 Ed Leafe <ed@leafe.com>
18 Eldar Nugaev <enugaev@griddynamics.com>
19 Eric Day <eday@oddments.org>
20+Eric Windisch <eric@cloudscaling.com>
21 Ewan Mellor <ewan.mellor@citrix.com>
22 Hisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>
23 Hisaki Ohara <hisaki.ohara@intel.com>
24
25=== modified file 'nova/tests/test_misc.py'
26--- nova/tests/test_misc.py 2011-03-09 09:30:18 +0000
27+++ nova/tests/test_misc.py 2011-03-11 09:01:16 +0000
28@@ -24,18 +24,19 @@
29
30 class ProjectTestCase(test.TestCase):
31 def test_authors_up_to_date(self):
32- if os.path.exists('.bzr'):
33+ topdir = os.path.normpath(os.path.dirname(__file__) + '/../../')
34+ if os.path.exists(os.path.join(topdir, '.bzr')):
35 contributors = set()
36
37- mailmap = parse_mailmap('.mailmap')
38+ mailmap = parse_mailmap(os.path.join(topdir, '.mailmap'))
39
40 import bzrlib.workingtree
41- tree = bzrlib.workingtree.WorkingTree.open('.')
42+ tree = bzrlib.workingtree.WorkingTree.open(topdir)
43 tree.lock_read()
44 try:
45 parents = tree.get_parent_ids()
46 g = tree.branch.repository.get_graph()
47- for p in parents[1:]:
48+ for p in parents:
49 rev_ids = [r for r, _ in g.iter_ancestry(parents)
50 if r != "null:"]
51 revs = tree.branch.repository.get_revisions(rev_ids)
52@@ -44,7 +45,8 @@
53 email = author.split(' ')[-1]
54 contributors.add(str_dict_replace(email, mailmap))
55
56- authors_file = open('Authors', 'r').read()
57+ authors_file = open(os.path.join(topdir, 'Authors'),
58+ 'r').read()
59
60 missing = set()
61 for contributor in contributors: