Merge lp:~jamalta/launchpad/contributions-merge into lp:launchpad

Proposed by Jamal Fanaian
Status: Merged
Approved by: Guilherme Salgado
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jamalta/launchpad/contributions-merge
Merge into: lp:launchpad
Diff against target: 51 lines (+17/-3)
1 file modified
utilities/community-contributions.py (+17/-3)
To merge this branch: bzr merge lp:~jamalta/launchpad/contributions-merge
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) code Approve
Review via email: mp+18716@code.launchpad.net

Commit message

Created name map for community-contributions to merge people using different names/email addresses.

To post a comment you must log in.
Revision history for this message
Jamal Fanaian (jamalta) wrote :

= Summary =

Created a name map in community-contributions.py that will take care of merging users who have contributed using different names and emails.

== Pre-implementation notes ==

Spoke with salgado to make sure this was a good idea and implementation.

== Tests ==

== Demo and Q/A ==

 % utilities/community-contributions.py --dry-run .

== Launchpad lint ==

The lint notices are unrelated to any changes I made.

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  utilities/community-contributions.py

== Pylint notices ==

utilities/community-contributions.py
    49: [C0301] Line too long (79/78)
    175: [C0301] Line too long (79/78)
    49: [W0702] No exception type(s) specified
    47: [W0403] Relative import 'editmoin'

Revision history for this message
Guilherme Salgado (salgado) wrote :

Looks good to me

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'utilities/community-contributions.py'
--- utilities/community-contributions.py 2009-12-07 20:21:44 +0000
+++ utilities/community-contributions.py 2010-02-05 19:46:18 +0000
@@ -46,7 +46,7 @@
46try:46try:
47 from editmoin import editshortcut47 from editmoin import editshortcut
48except:48except:
49 sys.stderr.write("""ERROR: Unable to import from 'editmoin'. How to solve:49 sys.stderr.write("""ERROR: Unable to import from 'editmoin'. How to solve:
50Get editmoin.py from launchpadlib's "contrib/" directory:50Get editmoin.py from launchpadlib's "contrib/" directory:
5151
52 http://bazaar.launchpad.net/~lazr-developers/launchpadlib/trunk/annotate/head%3A/contrib/editmoin.py52 http://bazaar.launchpad.net/~lazr-developers/launchpadlib/trunk/annotate/head%3A/contrib/editmoin.py
@@ -123,6 +123,14 @@
123 u'kiko@beetle',123 u'kiko@beetle',
124 )124 )
125125
126# Some people have made commits using various names and/or email
127# addresses, so this map will be used to merge them accordingly.
128merge_names_map = {
129 u'Jamal Fanaian <jfanaian@gmail.com>':
130 u'Jamal Fanaian <jamal.fanaian@gmail.com>',
131 u'Jamal Fanaian <jamal@jfvm1>':
132 u'Jamal Fanaian <jamal.fanaian@gmail.com>',
133 }
126134
127class ContainerRevision():135class ContainerRevision():
128 """A wrapper for a top-level LogRevision containing child LogRevisions."""136 """A wrapper for a top-level LogRevision containing child LogRevisions."""
@@ -164,8 +172,9 @@
164 #172 #
165 # -and-173 # -and-
166 #174 #
167 # http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/revision/\175 # http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/\
168 # launchpad@pqm.canonical.com-20090821221206-ritpv21q8w61gbpt176 # revision/launchpad@pqm.canonical.com-20090821221206-\
177 # ritpv21q8w61gbpt
169 #178 #
170 # In our links, even when the link text is a revnum, we still179 # In our links, even when the link text is a revnum, we still
171 # use a rev-id for the target. This is both so that the URL will180 # use a rev-id for the target. This is both so that the URL will
@@ -247,6 +256,11 @@
247 known = True256 known = True
248 break257 break
249 if not known:258 if not known:
259 # Use the merge names map to merge contributions from the same
260 # person using alternate names and/or emails.
261 if a in merge_names_map:
262 a = merge_names_map[a]
263
250 ### There's a variant of the Singleton pattern that could be264 ### There's a variant of the Singleton pattern that could be
251 ### used for this, whereby instantiating an ExCon object would265 ### used for this, whereby instantiating an ExCon object would
252 ### just get back an existing object if such has already been266 ### just get back an existing object if such has already been