# `gbp.scripts.pq_rpm` module documentation

Part of `gbp.scripts`

Manage RPM patches in a patch queue

Function | is_ancestor | Check if commit is ancestor of another
Function | generate_patches | Generate patch files from git
Function | rm_patch_files | Delete the patch files listed in the spec file. Doesn't delete patches marked as not maintained by gbp.
Function | update_patch_series | Export patches to packaging directory and update spec file accordingly.
Function | parse_spec | Find and parse spec file.
Function | find_upstream_commit | Find commit corresponding upstream version
Function | export_patches | Export patches from the pq branch into a packaging branch
Function | safe_patches | Safe the current patches in a temporary directory
Function | get_packager | Get packager information from spec
Function | import_spec_patches | apply a series of patches in a spec/packaging dir to branch the patch-queue branch for 'branch'
Function | rebase_pq | Rebase pq branch on the correct upstream version (from spec file).
Function | switch_pq | Switch to patch-queue branch if on base branch and vice versa
Function | usage_msg | Undocumented
Function | build_parser | Construct command line parser
Function | parse_args | Parse command line arguments
Function | main | Main function for the gbp pq-rpm command

def is_ancestor(repo, parent, child):

Check if commit is ancestor of another

def generate_patches(repo, start, end, outdir, options):

Generate patch files from git

def rm_patch_files(spec):

Delete the patch files listed in the spec file. Doesn't delete patches marked as not maintained by gbp.

def update_patch_series(repo, spec, start, end, options):

Export patches to packaging directory and update spec file accordingly.

def parse_spec(options, repo, treeish=None):

Find and parse spec file.

If treeish is given, try to find the spec file from that. Otherwise, search for the spec file in the working copy.

def find_upstream_commit(repo, spec, upstream_tag):

Find commit corresponding upstream version

def export_patches(repo, options):

Export patches from the pq branch into a packaging branch

def safe_patches(queue):

Safe the current patches in a temporary directory

Parameters | queue | an existing patch queue
Returns | safed queue (with patches in tmpdir) (type: tuple)

def get_packager(spec):

Get packager information from spec

def import_spec_patches(repo, options):

apply a series of patches in a spec/packaging dir to branch the patch-queue branch for 'branch'

Parameters | repo | git repository to work on
| options | command options

def rebase_pq(repo, options):

Rebase pq branch on the correct upstream version (from spec file).

def switch_pq(repo, current):

Switch to patch-queue branch if on base branch and vice versa

def usage_msg():
Undocumented
def build_parser(name):

Construct command line parser

def parse_args(argv):

Parse command line arguments

def main(argv):

Main function for the gbp pq-rpm command