commands = {
'add': stgit.commands.add,
'applied': stgit.commands.applied,
commands = {
'add': stgit.commands.add,
'applied': stgit.commands.applied,
'delete': stgit.commands.delete,
'diff': stgit.commands.diff,
'delete': stgit.commands.delete,
'diff': stgit.commands.diff,
'export': stgit.commands.export,
'files': stgit.commands.files,
'export': stgit.commands.export,
'files': stgit.commands.files,
'push': stgit.commands.push,
'refresh': stgit.commands.refresh,
'push': stgit.commands.push,
'refresh': stgit.commands.refresh,
'resolved': stgit.commands.resolved,
'rm': stgit.commands.rm,
'series': stgit.commands.series,
'resolved': stgit.commands.resolved,
'rm': stgit.commands.rm,
'series': stgit.commands.series,
+ if len(sys.argv) == 3 and sys.argv[2] in commands:
+ cmd = sys.argv[2]
+ sys.argv[2] = '--help';
+ else:
+ print_help()
+ sys.exit(0)
+ if cmd in ['-v', '--version', 'version']:
+ print 'Stacked GIT %s' % version
+ os.system('git --version')
+ print 'Python version %s' % sys.version
option_list = command.options)
options, args = parser.parse_args()
try:
option_list = command.options)
options, args = parser.parse_args()
try:
+ # 'clone' doesn't expect an already initialised GIT tree. A Series
+ # object will be created after the GIT tree is cloned
+ if cmd != 'clone':
+ if hasattr(options, 'branch') and options.branch:
+ command.crt_series = stack.Series(options.branch)
+ else:
+ command.crt_series = stack.Series()
+ stgit.commands.common.crt_series = command.crt_series
+
command.func(parser, options, args)
except (IOError, CmdException, stack.StackException, git.GitException), \
err:
print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
sys.exit(2)
command.func(parser, options, args)
except (IOError, CmdException, stack.StackException, git.GitException), \
err:
print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
sys.exit(2)