# `gbp.scripts.import_orig` module documentation

Part of `gbp.scripts`

Import a new upstream version into a Git repository

Function | prepare_pristine_tar | Prepare the upstream source for pristine tar import.
Function | upstream_import_commit_msg | Undocumented
Function | detect_name_and_version | Undocumented
Function | find_upstream | No summary
Function | debian_branch_merge | Undocumented
Function | postimport_hook | Undocumented
Function | is_30_quilt | Undocumented
Function | debian_branch_merge_by_auto | Undocumented
Function | debian_branch_merge_by_replace | Undocumented
Function | debian_branch_merge_by_merge | Undocumented
Function | unpack_tarballs | Undocumented
Function | set_bare_repo_options | Modify options for import into a bare repository
Function | rollback | Undocumented
Function | build_parser | Undocumented
Function | parse_args | Parse the command line arguments @return: options and arguments
Function | main | Undocumented

def prepare_pristine_tar(archive, pkg, version):

Prepare the upstream source for pristine tar import.

This checks if the upstream source is actually a tarball and creates a symlink from archive to <pkg>_<version>.orig.tar.<ext> so pristine-tar will see the correct basename.

Parameters | archive | the upstream source's name (type: `str`)
| pkg | the source package's name (type: `str`)
| version | the upstream version number (type: `str`)
Returns | (type: `str`)

def upstream_import_commit_msg(options, version):
Undocumented
def detect_name_and_version(repo, source, options):
Undocumented
def find_upstream(use_uscan, args):

Find the main tarball to import - either via uscan or via command line argument

Returns | upstream source filename or None if nothing to import (type: string)

Raises

GbpError

raised on all detected errors

    >>> find_upstream(False, ['too', 'many'])
    Traceback (most recent call last):
    ...
    gbp.errors.GbpError: More than one archive specified. Try --help.
    >>> find_upstream(False, [])
    Traceback (most recent call last):
    ...
    gbp.errors.GbpError: No archive to import specified. Try --help.
    >>> find_upstream(True, ['tarball'])
    Traceback (most recent call last):
    ...
    gbp.errors.GbpError: you can't pass both --uscan and a filename.
    >>> find_upstream(False, ['tarball']).path
    'tarball'

def debian_branch_merge(repo, tag, version, options):
Undocumented
def postimport_hook(repo, tag, version, options):
Undocumented
def is_30_quilt(repo, options):
Undocumented
def debian_branch_merge_by_auto(repo, tag, version, options):
Undocumented
def debian_branch_merge_by_replace(repo, tag, version, options):
Undocumented
def debian_branch_merge_by_merge(repo, tag, version, options):
Undocumented
def unpack_tarballs(sourcepackage, source, version, component_tarballs, options):
Undocumented
def set_bare_repo_options(options):

Modify options for import into a bare repository

def rollback(repo, options):
Undocumented
def build_parser(name):
Undocumented
def parse_args(argv):

Parse the command line arguments

Returns | options and arguments

def main(argv):
Undocumented