jelmer/python-fastimport — pull request #2 by masklinn (2014-03-10 15:25:28+00:00)
Title: Add copy method to CommitCommand

When modifying existing streams lazily (a good idea when 10k+ commits streams can easily be a GB+ uncompressed), altering existing commits in-place can lead to odd side-effects, but creating commit copies "by hand" is long-winded and error prone. Especially when only trying to alter an attribute or 2 (e.g. the commit message, or authors fixups/remapping)

Using a static list of attributes to copy would be slightly faster, but in my experience the cost of the fast-import itself (into git) is at least an order of magnitude more than the processing, even when applying dozens of fairly complex filters, so I opted to use the technique used in `ImportCommand.dump_str` instead.