sys.path.append(os.path.join(our_path, '..'))
# Our modules
+from u_boot_pylib import tout
from patman import cmdline
from patman import control
from u_boot_pylib import test_util
if not args.debug:
sys.tracebacklimit = 0
- # Run our meagre tests
+ tout.init(tout.INFO if args.verbose else tout.WARNING)
+
+ # Run our reasonably good tests
if args.cmd == 'test':
# pylint: disable=C0415
from patman import func_test
# Process commits, produce patches files, check them, email them
else:
- control.do_patman(args)
+ exit_code = control.do_patman(args)
+ sys.exit(exit_code)
if __name__ == "__main__":
args.ignore_bad_tags = True
send(args)
- # Check status of patches in patchwork
- elif args.cmd == 'status':
- ret_code = 0
- try:
+ ret_code = 0
+ try:
+ # Check status of patches in patchwork
+ if args.cmd == 'status':
patchwork_status(args.branch, args.count, args.start, args.end,
args.dest_branch, args.force, args.show_comments,
args.patchwork_url)
- except Exception as exc:
- terminal.tprint(f'patman: {type(exc).__name__}: {exc}',
- colour=terminal.Color.RED)
- if args.debug:
- print()
- traceback.print_exc()
- ret_code = 1
- sys.exit(ret_code)
+ except Exception as exc:
+ terminal.tprint(f'patman: {type(exc).__name__}: {exc}',
+ colour=terminal.Color.RED)
+ if args.debug:
+ print()
+ traceback.print_exc()
+ ret_code = 1
+ return ret_code