03 Jan 2006 05:43:06 UTC
- Distribution: Parse-SVNDiff
- Module version: 0.05
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (326 / 0 / 12)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (42.05KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionAUTRIJUS ☺唐鳳☻and 1 contributors
- Audrey Tang
Parse::SVNDiff - Subversion binary diff format parser
This document describes version 0.05 of Parse::SVNDiff, released January 3, 2006.
use Parse::SVNDiff; $diff = Parse::SVNDiff->new; $diff->parse($raw_svndiff); $raw_svndiff = $diff->dump; $target_text = $diff->apply($source_text); $diff->apply_fh($source_fh, $target_fh);
This module implements a parser and a dumper for Subversion's svndiff binary diff format. The API is still subject to change in the next few versions.
If you pass the lazy option to the constructor;
$diff = Parse::SVNDiff->new( lazy => 1 );
Then the module does not actually parse the diff until you either dump it or apply it to something.
Note that Lazy Diffs are so lazy that they also forget their contents after a
dumpso can't be applied twice. This is under the assumption that if you're doing it lazy, you're probably only going to want to do one of those.
You can also make individual data windows lazy load parts of themselves; it remains to be seen whether this will see a new performance improvement or degradation. The option is;
$diff = Parse::SVNDiff->new( lazy => 1, lazy_windows => 1, );
Currently you can't use
lazy_windowsunless the input stream to
Each window specifies a "source" offset that is from the beginning of the file, not a relative position from its last position. It would be much better if that was the case, as well as it not being allowed to be negative. That way, the "source" data stream would be able to be a stream and not a seekable file.
This means two things;
The "source" filehandle in
apply_fh()must permit seeking
Very large window sizes are not currently treated in a lazy fashion; each window is processed in a chunk. This limitation is just a matter of getting more tuits to handle large chunk sizes properly, however.
Audrey Tang <firstname.lastname@example.org>
Sam Vilain <email@example.com>
Copyright 2004, 2005, 2006 by Audrey Tang, Sam Vilain.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Parse::SVNDiff, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Parse::SVNDiff
For more information on module installation, please visit the detailed CPAN module installation guide.