The patch adds the stgit.main.main handling of this exception as well.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
from stgit.git import GitException
from stgit.commands.common import CmdException
from stgit.gitmergeonefile import GitMergeException
from stgit.git import GitException
from stgit.commands.common import CmdException
from stgit.gitmergeonefile import GitMergeException
+ from stgit.utils import EditorException
try:
debug_level = int(os.environ['STGIT_DEBUG_LEVEL'])
try:
debug_level = int(os.environ['STGIT_DEBUG_LEVEL'])
command.func(parser, options, args)
except (IOError, ParsingError, NoSectionError, CmdException,
command.func(parser, options, args)
except (IOError, ParsingError, NoSectionError, CmdException,
- StackException, GitException, GitMergeException), err:
+ StackException, GitException, GitMergeException,
+ EditorException), err:
print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
if debug_level:
raise
print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
if debug_level:
raise
os.rename(os.path.join(basedir, file1), full_file2)
remove_dirs(basedir, os.path.dirname(file1))
os.rename(os.path.join(basedir, file1), full_file2)
remove_dirs(basedir, os.path.dirname(file1))
+class EditorException(Exception):
+ pass
+
def call_editor(filename):
"""Run the editor on the specified filename."""
def call_editor(filename):
"""Run the editor on the specified filename."""
sys.stdout.flush()
err = os.system(editor)
if err:
sys.stdout.flush()
err = os.system(editor)
if err:
- raise Exception, 'editor failed, exit code: %d' % err
+ raise EditorException, 'editor failed, exit code: %d' % err