Exemplo n.º 1
0
parser.add_argument(
    '--tree-branch',
    default='master',
    help='the branch or commit to use as a base for applying patches')
parser.add_argument('--result-dir',
                    default=results_dir,
                    help='the directory where results will be generated')
args = parser.parse_args()

args.mdir = os.path.abspath(args.mdir)
args.tree = os.path.abspath(args.tree)

core.log_open_sec("Loading patches")
try:
    files = [os.path.join(args.mdir, f) for f in sorted(os.listdir(args.mdir))]
    series = Series()

    for f in files:
        with open(f, 'r') as fp:
            data = fp.read()
            if re.search(r"\[.* 0+/\d.*\]", data) and \
               not re.search(r"\n@@ -\d", data):
                series.set_cover_letter(data)
            else:
                series.add_patch(Patch(data))
finally:
    core.log_end_sec()

tree = Tree(args.tree_name, args.tree_name, args.tree, branch=args.tree_branch)
tester = Tester(args.result_dir)