Merge lp:~germar/bzr-fastimport/bzr-fastimport into lp:bzr-fastimport

Proposed by Germar
Status: Needs review
Proposed branch: lp:~germar/bzr-fastimport/bzr-fastimport
Merge into: lp:bzr-fastimport
Diff against target: 33 lines (+11/-1)
1 file modified
exporter.py (+11/-1)
To merge this branch: bzr merge lp:~germar/bzr-fastimport/bzr-fastimport
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Needs Fixing
Bazaar Developers Pending
Review via email: mp+274480@code.launchpad.net

Description of the change

Inspired by http://www.fusonic.net/en/blog/2013/03/26/migrating-from-bazaar-to-git/ this will add the bug properties to the commit message if running with --plain. So you will not loose that information anymore if you export to GIT.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Please also add a test for this behaviour.

review: Needs Fixing

Unmerged revisions

361. By Germar

write bug property into commit message if running with --plain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'exporter.py'
--- exporter.py 2014-05-15 09:26:03 +0000
+++ exporter.py 2015-10-14 22:56:18 +0000
@@ -422,10 +422,20 @@
422 from_ = None422 from_ = None
423 merges = None423 merges = None
424424
425 message = revobj.message
426
425 # Filter the revision properties. Some metadata (like the427 # Filter the revision properties. Some metadata (like the
426 # author information) is already exposed in other ways so428 # author information) is already exposed in other ways so
427 # don't repeat it here.429 # don't repeat it here.
428 if self.plain_format:430 if self.plain_format:
431 if 'bugs' in revobj.properties:
432 m = re.match(r'(http.*/\d+)', revobj.properties['bugs'])
433 if m:
434 message += ' (fixed %s)' %m.group(1)
435 if self.verbose:
436 self.note('Added bug note to message: %s' %message)
437 else:
438 self.warning("Found bug property but wasn't able to extract link: %s" %revobj.properties['bugs'])
429 properties = None439 properties = None
430 else:440 else:
431 properties = revobj.properties441 properties = revobj.properties
@@ -437,7 +447,7 @@
437447
438 # Build and return the result448 # Build and return the result
439 return commands.CommitCommand(git_ref, mark, author_info,449 return commands.CommitCommand(git_ref, mark, author_info,
440 committer_info, revobj.message.encode("utf-8"), from_, merges, iter(file_cmds),450 committer_info, message.encode("utf-8"), from_, merges, iter(file_cmds),
441 more_authors=more_author_info, properties=properties)451 more_authors=more_author_info, properties=properties)
442452
443 def _get_revision_trees(self, parent, revision_id):453 def _get_revision_trees(self, parent, revision_id):

Subscribers

People subscribed via source and target branches