class documentation
class PatchSeries(list):
A series of Patch
es as read from a quilt series file).
Class Method | read |
Read a series file into Patch objects |
Class Variable | comment |
Undocumented |
Class Variable | level |
Undocumented |
Class Method | _parse |
Parse a single line from a series file |
Class Method | _read |
Read patch series |
Class Method | _split |
Separate the -p<num> option from the patch name |
Class Method | _strip |
Strip a comment from a series file line |
Static Method | _get |
Get the topic from the patch's path |
Parse a single line from a series file
>>> PatchSeries._parse_line("a/b -p1", '/tmp/patches') <gbp.patch_series.Patch path='/tmp/patches/a/b' topic='a' strip=1 > >>> PatchSeries._parse_line("a/b", '.') <gbp.patch_series.Patch path='./a/b' topic='a' >
Read patch series
>>> PatchSeries._read_series(['a/b', ... 'a -p1 # comment', ... 'a/b -p2'], '.') ... # doctest:+NORMALIZE_WHITESPACE [<gbp.patch_series.Patch path='./a/b' topic='a' >, <gbp.patch_series.Patch path='./a' strip=1 >, <gbp.patch_series.Patch path='./a/b' topic='a' strip=2 >]
>>> PatchSeries._read_series(['# foo', 'a/b', '', '# bar'], '.') [<gbp.patch_series.Patch path='./a/b' topic='a' >]
Parameters | |
series:iterable of strings | series of patches in quilt format |
patch | path prefix to prepend to each patch path |
Separate the -p<num> option from the patch name
>>> PatchSeries._split_strip("asdf -p1") ('asdf', 1) >>> PatchSeries._split_strip("a/nice/patch") ('a/nice/patch', None) >>> PatchSeries._split_strip("asdf foo") ('asdf foo', None)
Strip a comment from a series file line
>>> PatchSeries._strip_comment("does/not matter") 'does/not matter' >>> PatchSeries._strip_comment("remove/the # comment # text") 'remove/the' >>> PatchSeries._strip_comment("leave/level/intact -p1 # comment # text") 'leave/level/intact -p1'