stack. They are listed in the order in which they were pushed, the
last one being the current (topmost) patch."""
-options = []
+options = [make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
help = 'Use FILE as a template'),
make_option('-r', '--range',
metavar = '[PATCH1][:[PATCH2]]',
- help = 'export patches between PATCH1 and PATCH2')]
+ help = 'export patches between PATCH1 and PATCH2'),
+ make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
else:
parser.error('incorrect number of arguments')
- if git.local_changes():
+ if not options.branch and git.local_changes():
print 'Warning: local changes in the tree. ' \
'You might want to commit them first'
options = [make_option('-s', '--stat',
help = 'show the diff stat',
- action = 'store_true')]
+ action = 'store_true'),
+ make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
the standard GIT id's like heads and tags, this command also accepts
'base' and '[<patch>]/(bottom | top)'."""
-options = []
+options = [make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
make_option('-u', '--smtp-user', metavar = 'USER',
help = 'username for SMTP authentication'),
make_option('-p', '--smtp-password', metavar = 'PASSWORD',
- help = 'username for SMTP authentication')]
+ help = 'username for SMTP authentication'),
+ make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def __get_maintainer():
Rename <oldpatch> into <newpatch> in a series."""
-options = []
+options = [make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
with a '+' and the unapplied ones with a '-'. The current patch is
prefixed with a '>'. Empty patches are prefixed with a '0'."""
-options = []
+options = [make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
Print the name of the current (topmost) patch."""
-options = []
+options = [make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
List the patches from the series which are not pushed onto the stack.
They are listed in the reverse order in which they were popped."""
-options = []
+options = [make_option('-b', '--branch',
+ help = 'use BRANCH instead of the default one')]
def func(parser, options, args):
sys.exit(0)
if not cmd in commands:
print >> sys.stderr, 'Unknown command: %s' % cmd
- print >> sys.stderr, ' Try "%s help" for a list of supported commands' \
- % prog
+ print >> sys.stderr, ' Try "%s help" for a list of supported ' \
+ 'commands' % prog
sys.exit(1)
# re-build the command line arguments
# 'clone' doesn't expect an already initialised GIT tree
if cmd == 'clone':
stgit.commands.common.crt_series = stack.Series('master')
+ elif hasattr(options, 'branch') and options.branch:
+ stgit.commands.common.crt_series = stack.Series(options.branch)
else:
stgit.commands.common.crt_series = stack.Series()
# the line below is a simple way to avoid an exception when