Patch helper module

class rebasehelper.patch_helper.GitPatchTool[source]

Class for git command used for patching old and new sources

CMD = 'git'
classmethod apply_old_patches()[source]

Function applies a patch to a old/new sources

static apply_patch(repo, patch_object)[source]

Function applies patches to old sources It tries apply patch with am command and if it fails then with command –apply

classmethod call_prep_script(prep_script_path)[source]
classmethod create_prep_script(prep)[source]

Function abstract special things from prep section and apply them to old sources

diff_cls = None
exec_prep_script = False
classmethod init_git(directory)[source]

Function initialize old and new Git repository

classmethod match(cmd=None)[source]
new_repo = None
new_sources = ''
non_interactive = False
old_repo = None
old_sources = ''
output_data = None
patch_sources_by_prep_script = False
patches = None
prep_section = False
classmethod run_patch(old_dir, new_dir, rest_sources, patches, prep, **kwargs)[source]

The function can be used for patching one directory against another

source_dir = ''
class rebasehelper.patch_helper.PatchBase[source]

Class used for using several patching command tools, … Each method should overwrite method like run_check

classmethod match(cmd=None, *args, **kwargs)[source]

Method checks whether it is usefull patch method

classmethod run_patch(old_dir, new_dir, rest_sources, git_helper, patches, *args, **kwargs)[source]

Method will check all patches in relevant package

class rebasehelper.patch_helper.Patcher(tool=None)[source]

Class representing a process of applying and generating rebased patch using specific tool.

patch(old_dir, new_dir, rest_sources, patches, prep, **kwargs)[source]

Apply patches and generate rebased patches if needed

Parameters:
  • old_dir – path to dir with old patches
  • new_dir – path to dir with new patches
  • patches – old patches
  • rebased_patches – rebased patches
  • kwargs

Returns:

rebasehelper.patch_helper.register_patch_tool(patch_tool)[source]