/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/msgeditor.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from subprocess import call
24
24
import sys
25
25
 
26
 
from breezy import (
 
26
from . import (
27
27
    cmdline,
28
28
    config,
29
29
    osutils,
31
31
    transport,
32
32
    ui,
33
33
    )
34
 
from breezy.errors import BzrError, BadCommitMessageEncoding
35
 
from breezy.hooks import Hooks
 
34
from .errors import BzrError, BadCommitMessageEncoding
 
35
from .hooks import Hooks
 
36
from .sixish import (
 
37
    StringIO,
 
38
    )
36
39
 
37
40
 
38
41
def _get_editor():
65
68
        try:
66
69
            ## mutter("trying editor: %r", (edargs +[filename]))
67
70
            x = call(edargs + [filename])
68
 
        except OSError, e:
 
71
        except OSError as e:
69
72
            if candidate_source is not None:
70
73
                # We tried this editor because some user configuration (an
71
74
                # environment variable or config file) said to try it.  Let
203
206
        if msgfilename is not None:
204
207
            try:
205
208
                os.unlink(msgfilename)
206
 
            except IOError, e:
 
209
            except IOError as e:
207
210
                trace.warning(
208
211
                    "failed to unlink %s: %s; ignored", msgfilename, e)
209
212
 
255
258
    # TODO: Rather than running the status command, should prepare a draft of
256
259
    # the revision to be committed, then pause and ask the user to
257
260
    # confirm/write a message.
258
 
    from StringIO import StringIO       # must be unicode-safe
259
 
    from breezy.status import show_tree_status
 
261
    from .status import show_tree_status
260
262
    status_tmp = StringIO()
261
263
    show_tree_status(working_tree, specific_files=specific_files,
262
264
                     to_file=status_tmp, verbose=True)
274
276
    # TODO: Rather than running the status command, should prepare a draft of
275
277
    # the revision to be committed, then pause and ask the user to
276
278
    # confirm/write a message.
277
 
    from StringIO import StringIO       # must be unicode-safe
278
 
    from breezy.diff import show_diff_trees
 
279
    from .diff import show_diff_trees
279
280
 
280
281
    template = make_commit_message_template(working_tree, specific_files)
281
282
    template = template.encode(output_encoding, "replace")