Skip to content

Add support for patchset/patch/hunk string representation #23

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
What do you want to do?

Print the representation of a parsed patch, for instance to split a large 
patchset in one patch per patch file.

How to test if it works as expected? Please describe step by step.

Given a PatchSet object, repr(PatchSet) should return a string that should be 
the same  (or almost the same) as the original parsed file.
Then for each Patch in the patchset, repr(Patch) should return a string that 
should be the same (or almost the same) as the original Patch in the parsed 
file.
Then for each Hunk in a patch, repr(Hunk) should return a string that should be 
the same  (or almost the same) as the original Hunk in the Patch in the parsed 
file.

It is OK if the line endings do not match exactly (i.e. hunkends may be 
ignored) and default to Posix, and it is OK if the repr is not exactly the same 
as the original one, but a good enough one.

Attached is a proposed patch with some tests, based on the latest HEAD @ r196



Original issue reported on code.google.com by pombreda...@gmail.com on 28 Mar 2013 at 11:00

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions