git-import-patches 587 B

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