Example #1
0
            update_cache_objects(output, wgitref, input=False)

            for branch in branches:
                with tempdir.tempdir() as branch_tmpdir:
                    wgitdir = os.path.join(branch_tmpdir, 'work.git')

                    git.clone(output, wgitdir, [
                        '--reference', wgitref, '--bare', '--single-branch',
                        '--branch', branch
                    ])
                    git.remove_config('core.bare', tree=wgitdir)
                    git.set_origin(output, wgitdir)

                    env = make_proxy_env(True)
                    kernel_head = git.ls_remote(branch,
                                                tree=kernelobjdir,
                                                env=env)

                    backport_author_env = {
                        'GIT_AUTHOR_NAME': SCRIPT_GIT_NAME,
                        'GIT_AUTHOR_EMAIL': SCRIPT_GIT_EMAIL,
                    }

                    old_data = {}
                    try:
                        msg = git.commit_message('HEAD', wgitdir)
                        for line in msg.split('\n'):
                            line = line.strip()
                            if line.startswith(PREFIX):
                                k, v = line[len(PREFIX):].split(':')
                                k = k.strip()
Example #2
0
            update_cache_objects(input, kernelobjdir, input=True)

            wgitref = os.path.join(cachedir, 'backport-' + tree)

            update_cache_objects(output, wgitref, input=False)

            for branch in branches:
                with tempdir.tempdir() as branch_tmpdir:
                    wgitdir = os.path.join(branch_tmpdir, 'work.git')

                    git.clone(output, wgitdir, ['--reference', wgitref, '--bare', '--single-branch', '--branch', branch])
                    git.remove_config('core.bare', tree=wgitdir)
                    git.set_origin(output, wgitdir)

                    env = make_proxy_env(True)
                    kernel_head = git.ls_remote(branch, tree=kernelobjdir, env=env)

                    backport_author_env = {
                        'GIT_AUTHOR_NAME': SCRIPT_GIT_NAME,
                        'GIT_AUTHOR_EMAIL': SCRIPT_GIT_EMAIL,
                    }

                    old_data = {}
                    try:
                        msg = git.commit_message('HEAD', wgitdir)
                        for line in msg.split('\n'):
                            line = line.strip()
                            if line.startswith(PREFIX):
                                k, v = line[len(PREFIX):].split(':')
                                k = k.strip()
                                v = v.strip()