git-import-patches 590 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. import argparse
  3. import sys
  4. from lib import git
  5. from lib.patches import patch_from_dir
  6. def main(argv):
  7. parser = argparse.ArgumentParser()
  8. parser.add_argument("patch_dir",
  9. help="directory containing patches to apply")
  10. parser.add_argument("-3", "--3way",
  11. action="store_true", dest='threeway',
  12. help="use 3-way merge to resolve conflicts")
  13. args = parser.parse_args(argv)
  14. git.import_patches(
  15. repo='.',
  16. patch_data=patch_from_dir(args.patch_dir),
  17. threeway=args.threeway
  18. )
  19. if __name__ == '__main__':
  20. main(sys.argv[1:])