* script: Python3 compatibility for utf8 conversion The unicode() method has been renamed to str() in Python3, add a wrapper around it to support running against both versions. * script: don't require python2 for git-[import,export]-patches The scripts work just fine with python3 too, so use the generic python executable as the script interpreter. Most setups don't even require or provide python 2 anymore, so this saves one from having to install it just for the scripts.
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			585 B
			
		
	
	
	
		
			Python
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			585 B
			
		
	
	
	
		
			Python
		
	
	
		
			Executable file
		
	
	
	
	
#!/usr/bin/env python
 | 
						|
 | 
						|
import argparse
 | 
						|
import sys
 | 
						|
 | 
						|
from lib import git
 | 
						|
 | 
						|
def main(argv):
 | 
						|
  parser = argparse.ArgumentParser()
 | 
						|
  parser.add_argument("-o", "--output",
 | 
						|
      help="directory into which exported patches will be written",
 | 
						|
      required=True)
 | 
						|
  parser.add_argument("patch_range",
 | 
						|
      nargs='?',
 | 
						|
      help="range of patches to export. Defaults to all commits since the "
 | 
						|
           "most recent tag or remote branch.")
 | 
						|
  args = parser.parse_args(argv)
 | 
						|
 | 
						|
  git.export_patches('.', args.output, patch_range=args.patch_range)
 | 
						|
 | 
						|
 | 
						|
if __name__ == '__main__':
 | 
						|
  main(sys.argv[1:])
 |