/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to mapping.py

Make sure author and committer names pushed to git contain < and >, otherwise the git parser barfs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    return file_id.replace("_s", " ").replace("__", "_")
50
50
 
51
51
 
 
52
def fix_person_identifier(text):
 
53
    if "<" in text and ">" in text:
 
54
        return text
 
55
    return "%s <%s>" % (text, text)
 
56
 
 
57
 
52
58
class BzrGitMapping(foreign.VcsMapping):
53
59
    """Class that maps between Git and Bazaar semantics."""
54
60
    experimental = False
260
266
            assert len(git_p) == 40, "unexpected length for %r" % git_p
261
267
            commit._parents.append(git_p)
262
268
    commit._message = rev.message.encode("utf-8")
263
 
    commit._committer = rev.committer.encode("utf-8")
264
 
    commit._author = rev.get_apparent_authors()[0].encode("utf-8")
 
269
    commit._committer = fix_person_identifier(rev.committer.encode("utf-8"))
 
270
    commit._author = fix_person_identifier(rev.get_apparent_authors()[0].encode("utf-8"))
265
271
    commit._commit_time = long(rev.timestamp)
266
272
    if 'author-timestamp' in rev.properties:
267
273
        commit._author_time = long(rev.properties['author-timestamp'])