Common functionality for Debian and RPM patchqueue management

Variable DEFAULT_PQ_BRANCH_NAME Undocumented
Function pq_branch_match Match branch name with pq branch name pattern
Function is_pq_branch is branch a patch-queue branch?
Function pq_branch_name get the patch queue branch corresponding to branch
Function pq_branch_base Get the branch corresponding to the given patch queue branch. Returns the packaging/debian branch if pq format string doesn't contain '%(branch)s' key.
Function parse_gbp_commands Parse gbp commands from commit message
Function patch_path_filter Create patch include paths, i.e. a "negation" of the exclude paths.
Function write_patch_file Write patch file
Function format_patch Create patch of a single commit
Function format_diff Create a patch of diff between two repository objects
Function get_author Determine author name and email
Function get_maintainer_from_control Get the maintainer from the control file
Function switch_to_pq_branch Switch to patch-queue branch if not already there, create it if it doesn't exist yet
Function apply_single_patch Undocumented
Function apply_and_commit_patch apply a single patch 'patch', add topic 'topic' and commit it
Function drop_pq Undocumented
DEFAULT_PQ_BRANCH_NAME =
Undocumented
(type: str)
def pq_branch_match(branch, pq_fmt_str):

Match branch name with pq branch name pattern

>>> pq_branch_match('patch-queue/foo', 'patch-queue/%(br)s').groupdict()
{'br': 'foo'}
>>> pq_branch_match('pq/foo/bar', 'pq/%(br)s/baz')
>>> pq_branch_match('pq/foo/bar', 'pq/%(br)s/bar').groupdict()
{'br': 'foo'}
>>> pq_branch_match('foo/bar/1.0/pq', 'foo/%(br)s/%(ver)s/pq').groupdict()
{'ver': '1.0', 'br': 'bar'}
def is_pq_branch(branch, options):

is branch a patch-queue branch?

>>> from optparse import OptionParser
>>> (opts, args) = OptionParser().parse_args([])
>>> is_pq_branch("foo", opts)
False
>>> is_pq_branch("patch-queue/foo", opts)
True
>>> opts.pq_branch = "%(branch)s/development"
>>> is_pq_branch("foo/development/bar", opts)
False
>>> is_pq_branch("bar/foo/development", opts)
True
>>> opts.pq_branch = "development"
>>> is_pq_branch("development", opts)
True
>>> opts.pq_branch = "my/%(branch)s/pq"
>>> is_pq_branch("my/foo/pqb", opts)
False
>>> is_pq_branch("my/foo/pq", opts)
True
>>> opts.pq_branch = "my/%(branch)s/%(version)s"
>>> is_pq_branch("my/foo", opts)
False
>>> is_pq_branch("my/foo/1.0", opts)
True
def pq_branch_name(branch, options, extra_keys=None):

get the patch queue branch corresponding to branch

>>> from optparse import OptionParser
>>> (opts, args) = OptionParser().parse_args([])
>>> pq_branch_name("patch-queue/master", opts)
>>> pq_branch_name("foo", opts)
'patch-queue/foo'
>>> opts.pq_branch = "%(branch)s/development"
>>> pq_branch_name("foo", opts)
'foo/development'
>>> opts.pq_branch = "development"
>>> pq_branch_name("foo", opts)
'development'
>>> opts.pq_branch = "pq/%(branch)s/%(ver)s"
>>> pq_branch_name("foo", opts, {'ver': '1.0'})
'pq/foo/1.0'
def pq_branch_base(pq_branch, options):

Get the branch corresponding to the given patch queue branch. Returns the packaging/debian branch if pq format string doesn't contain '%(branch)s' key.

>>> from optparse import OptionParser
>>> (opts, args) = OptionParser().parse_args([])
>>> opts.packaging_branch = "packaging"
>>> pq_branch_base("patch-queue/master", opts)
'master'
>>> pq_branch_base("foo", opts)
>>> opts.pq_branch = "my/%(branch)s/development"
>>> pq_branch_base("foo/development", opts)
>>> pq_branch_base("my/foo/development/bar", opts)
>>> pq_branch_base("my/foo/development", opts)
'foo'
>>> opts.pq_branch = "development"
>>> pq_branch_base("foo/development", opts)
>>> pq_branch_base("development", opts)
'packaging'
def parse_gbp_commands(info, cmd_tag, noarg_cmds, arg_cmds):

Parse gbp commands from commit message

def patch_path_filter(file_status, exclude_regex=None):

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

def write_patch_file(filename, commit_info, diff):

Write patch file

def format_patch(outdir, repo, commit_info, series, numbered=(True), path_exclude_regex=None, topic=""""""):

Create patch of a single commit

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

Create a patch of diff between two repository objects

def get_author(repo):

Determine author name and email

def get_maintainer_from_control(repo):

Get the maintainer from the control file

def switch_to_pq_branch(repo, branch, options, name_keys=None):

Switch to patch-queue branch if not already there, create it if it doesn't exist yet

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

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

def drop_pq(repo, branch, options, name_keys=None):
Undocumented
API Documentation for git-buildpackage, generated by pydoctor at 2020-05-22 08:50:00.