cstroe / svndumpapi

A Java library for manipulating a Subversion dump file.
GNU Affero General Public License v3.0
5 stars 1 forks source link

Fix #21: Make SvnDumpWriterImpl correctly deal with delete nodes and copied nodes #22

Closed cstroe closed 8 years ago

cstroe commented 8 years ago

The problem was completely about putting the correct number of new lines in the correct places. Instead of trying to reproduce svnadmin dump's finite state machine (believe me I've tried), I'm cheating and just counting the new lines after each node, and then repeating them.

This involves adding an extra made up SvnProperty to the node and passing it to endNode(SvnNode) in the SvnNode properties (see this file, and the parser). Because this new property will be added to the node properties after it's been consumed, it doesn't (and shouldn't) break existing functionality. It doesn't break existing functionality because most SvnDumpConsumers do very little work in endNode(SvnNode).

This also means that if a dump is not read in using SvnDumpFileParser, you will not get the extra hint property, and it will default to a single new line after each SvnNode, breaking compatibility with the svnadmin dump format (for new lines). Since the main usage scenario involves reading through SvnDumpFileParser, we should not be bitten by this.