#NEWLINE# def parse_args( ) : #NEWLINE# #INDENT# versionMessage = '%prog {0} (http://pypi.python.org/pypi/sapling/{0})' . format ( version ( ) ) #NEWLINE# usage = '\n    %prog (-dv --python-git-db) --list\n    %prog (-dv --python-git-db) --split [splitname...]' #NEWLINE# epilog = 'Happy splitting!' #NEWLINE# parser = optparse . OptionParser ( usage = usage , version = versionMessage , epilog = epilog ) #NEWLINE# parser . add_option ( '-d' , '--debug' , dest = 'debug' , action = 'store_true' , default = False , help = 'Prints extra debugging information.' ) #NEWLINE# parser . add_option ( '-v' , '--verbose' , dest = 'verbose' , action = 'store_true' , default = False , help = 'Prints extra information.' ) #NEWLINE# parser . add_option ( '--python-git-db' , dest = 'native' , action = 'store_false' , default = True , help = 'Specifies the python implementation of the git object database should be used instead of the native one - can speed operations when repository has few large files.' ) #NEWLINE# install = optparse . OptionGroup ( parser , 'Install sap as a git subcommand' ) #NEWLINE# install . add_option ( '--install' , dest = 'subcommand' , action = 'store_const' , const = 'install' , help = 'Installs the git sap command if not installed already.' ) #NEWLINE# install . add_option ( '-f' , '--force' , dest = 'force' , action = 'store_true' , default = False , help = 'Forces a re-install of the git sap command.' ) #NEWLINE# install . add_option ( '-s' , '--show' , dest = 'show' , action = 'store_true' , default = False , help = "Does not perform an install, instead shows the path of the binary git sap' calls into." ) #NEWLINE# parser . add_option_group ( epilog ) #NEWLINE# list = optparse . OptionGroup ( parser , 'List configured splits for the current git repo' ) #NEWLINE# list . add_option ( '--list' , dest = 'subcommand' , default = 'list' , action = 'store_const' , const = 'list' , help = 'Lists splits defined in .saplings if any.' ) #NEWLINE# parser . add_option_group ( list ) #NEWLINE# split = optparse . OptionGroup ( parser , 'Split new commits out that affect one or more splits' ) #NEWLINE# split . add_option ( '--split' , dest = 'subcommand' , action = 'store_const' , const = 'split' , help = 'Populates branches with commits intersecting the specified splits. If a --branch is not specified, arguments are treated as split names definied in the .saplings config.' ) #NEWLINE# split . add_option ( '-b' , '--branch' , dest = 'branch' , help = 'Specifies a branch to split to, arguments are treated as the patterns to split.' ) #NEWLINE# split . add_option ( '-n' , '--dry-run' , dest = 'dry_run' , action = 'store_true' , default = False , help = 'Does not perform a split, instead just lists the commits that would be split.' ) #NEWLINE# parser . add_option_group ( split ) #NEWLINE# ( options , args ) = parser . parse_args ( ) #NEWLINE# return ( options , args , parser . error )