class documentation

class Patch(object):

Known subclasses: gbp.patch_series.Dep3Patch

View In Hierarchy

A patch in a PatchSeries

Method __init__ Undocumented
Method __repr__ Undocumented
Class Variable patch_exts Undocumented
Instance Variable info Information retrieved from a RFC822 style patch header
Instance Variable long_desc the long description of the patch
Instance Variable path path to the patch
Instance Variable strip path components to strip (think patch -p<strip>)
Instance Variable topic the topic of the patch (the directory component)
Property author The patch's author
Property date The patch's modification time
Property email The patch author's email address
Property subject The patch's subject, either from the patch header or from the filename.
Method _get_info_field Return the key key from the info dict or use val if key is not a valid key.
Method _get_subject_from_filename Determine the patch's subject based on the its filename
Method _read_git_mailinfo Read patch information into a structured form
Method _read_info Undocumented
def __init__(self, path, topic=None, strip=None):

Undocumented

def __repr__(self):

Undocumented

patch_exts: list[str] =

Undocumented

info: dict with str keys and values =

Information retrieved from a RFC822 style patch header

long_desc =

the long description of the patch

path: string =

path to the patch

strip: integer =

path components to strip (think patch -p<strip>)

topic: string =

the topic of the patch (the directory component)

@property
author =

The patch's author

@property
date =

The patch's modification time

@property
email =

The patch author's email address

@property
subject =

The patch's subject, either from the patch header or from the filename.

def _get_info_field(self, key, get_val=None):

Return the key key from the info dict or use val if key is not a valid key.

Fill self.info if not already done.

Parameters
key:strkey to fetch
get_val:()->stralternate value if key is not in info dict
def _get_subject_from_filename(self):

Determine the patch's subject based on the its filename

>>> p = Patch('debian/patches/foo.patch')
>>> p._get_subject_from_filename()
'foo'
>>> Patch('foo.patch')._get_subject_from_filename()
'foo'
>>> Patch('debian/patches/foo.bar')._get_subject_from_filename()
'foo.bar'
>>> p = Patch('debian/patches/foo')
>>> p._get_subject_from_filename()
'foo'
>>> Patch('0123-foo.patch')._get_subject_from_filename()
'foo'
>>> Patch('0123.patch')._get_subject_from_filename()
'0123'
>>> Patch('0123-foo-0123.patch')._get_subject_from_filename()
'foo-0123'
Returns
strthe patch's subject
def _read_git_mailinfo(self):

Read patch information into a structured form

using git mailinfo

def _read_info(self):

Undocumented