return
except transaction.TransactionHalted:
pass
- trans.run(iw)
+ return trans.run(iw)
def func(parser, options, args):
stack = directory.repository.current_stack
+ list(stack.patchorder.unapplied)))
if len(patches) < 2:
raise common.CmdException('Need at least two patches')
- _coalesce(stack, stack.repository.default_iw(),
- options.name, options.message, options.save_template, patches)
+ return _coalesce(stack, stack.repository.default_iw(), options.name,
+ options.message, options.save_template, patches)
pass
else:
raise common.CmdException('Patch "%s" does not exist' % patch)
- trans.run(iw)
+ return trans.run(iw)
-from stgit import exception
+from stgit import exception, utils
from stgit.out import *
from stgit.lib import git
self.__stack.patchorder.applied = self.__applied
self.__stack.patchorder.unapplied = self.__unapplied
+ if self.__error:
+ return utils.STGIT_CONFLICT
+ else:
+ return utils.STGIT_SUCCESS
+
def __halt(self, msg):
self.__error = msg
raise TransactionHalted(msg)
else:
command.crt_series = Series()
- command.func(parser, options, args)
+ ret = command.func(parser, options, args)
except (StgException, IOError, ParsingError, NoSectionError), err:
out.error(str(err), title = '%s %s' % (prog, cmd))
if debug_level > 0:
except KeyboardInterrupt:
sys.exit(utils.STGIT_GENERAL_ERROR)
- sys.exit(utils.STGIT_SUCCESS)
+ sys.exit(ret or utils.STGIT_SUCCESS)
STGIT_SUCCESS = 0 # everything's OK
STGIT_GENERAL_ERROR = 1 # seems to be non-command-specific error
STGIT_COMMAND_ERROR = 2 # seems to be a command that failed
+STGIT_CONFLICT = 3 # merge conflict, otherwise OK
def strip_leading(prefix, s):
"""Strip leading prefix from a string. Blow up if the prefix isn't