module documentation

Common functionality for Debian and RPM patchqueue management

Function apply_and_commit_patch apply a single patch 'patch', add topic 'topic' and commit it
Function apply_single_patch Undocumented
Function drop_pq Undocumented
Function format_diff Create a patch of diff between two repository objects
Function format_patch Create patch of a single commit
Function get_maintainer_from_control Get the maintainer from the control file
Function is_pq_branch is branch a patch-queue branch?
Function parse_gbp_commands Parses gbp commands from commit message. Args with and wthout arguments are supported as is filtering out of commands from the commit body.
Function patch_path_filter Create patch include paths, i.e. a "negation" of the exclude paths.
Function pq_branch_base get the branch corresponding to the given patch queue branch
Function pq_branch_name get the patch queue branch corresponding to branch
Function switch_to_pq_branch Switch to patch-queue branch if not already on it. doesn't exist yet
Function write_patch_file Write patch file
Constant DEFAULT_PATCH_NUM_PREFIX_FORMAT Undocumented
Constant PQ_BRANCH_PREFIX Undocumented
def apply_and_commit_patch(repo, patch, fallback_author, topic=None, name=None):

apply a single patch 'patch', add topic 'topic' and commit it

def apply_single_patch(repo, branch, patch, fallback_author, topic=None):

Undocumented

def drop_pq(repo, branch):

Undocumented

def format_diff(outdir, filename, repo, start, end, abbrev, path_exclude_regex=None):

Create a patch of diff between two repository objects

def format_patch(outdir, repo, commit_info, series, abbrev, numbered=True, path_exclude_regex=None, topic='', name=None, renumber=False, patch_num_prefix_format=DEFAULT_PATCH_NUM_PREFIX_FORMAT):

Create patch of a single commit

def get_maintainer_from_control(repo):

Get the maintainer from the control file

def is_pq_branch(branch):

is branch a patch-queue branch?

>>> is_pq_branch("foo")
False
>>> is_pq_branch("patch-queue/foo")
True
def parse_gbp_commands(info, cmd_tag, noarg_cmds, arg_cmds, filter_cmds=None):

Parses gbp commands from commit message. Args with and wthout arguments are supported as is filtering out of commands from the commit body.

Parameters
infothe commit into to parse for commands
cmd_tagthe command tag
noarg_cmds:list of strcommands without an argument
arg_cmds:list of strcommand with an argumnt
filter_cmds:list of strcommands to filter out of the passed in info
Returns
the parsed commands and the filtered commit body.
def patch_path_filter(file_status, exclude_regex=None):

Create patch include paths, i.e. a "negation" of the exclude paths.

def pq_branch_base(branch):

get the branch corresponding to the given patch queue branch

>>> pq_branch_base("patch-queue/master")
'master'
>>> pq_branch_base("foo")
'foo'
def pq_branch_name(branch):

get the patch queue branch corresponding to branch

>>> pq_branch_name("patch-queue/master")
'patch-queue/master'
>>> pq_branch_name("foo")
'patch-queue/foo'
def switch_to_pq_branch(repo, branch):

Switch to patch-queue branch if not already on it. doesn't exist yet

def write_patch_file(filename, commit_info, diff):

Write patch file

DEFAULT_PATCH_NUM_PREFIX_FORMAT: str =

Undocumented

Value
'%04d-'
PQ_BRANCH_PREFIX: str =

Undocumented

Value
'patch-queue/'