~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-16 14:01:20 UTC
  • mfrom: (3280.2.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080316140120-i3yq8yr1l66m11h7
Start 1.4 development

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 bzrlib import (
27
 
    config,
28
 
    osutils,
29
 
    )
 
26
import bzrlib
 
27
import bzrlib.config as config
 
28
from bzrlib import osutils
30
29
from bzrlib.errors import BzrError, BadCommitMessageEncoding
31
 
from bzrlib.trace import warning
 
30
from bzrlib.trace import warning, mutter
32
31
 
33
32
 
34
33
def _get_editor():
62
61
            ## mutter("trying editor: %r", (edargs +[filename]))
63
62
            x = call(edargs + [filename])
64
63
        except OSError, e:
65
 
            # We're searching for an editor, so catch safe errors and continue
66
 
            if e.errno in (errno.ENOENT, ):
67
 
                continue
68
 
            raise
 
64
           # We're searching for an editor, so catch safe errors and continue
 
65
           if e.errno in (errno.ENOENT, ):
 
66
               continue
 
67
           raise
69
68
        if x == 0:
70
69
            return True
71
70
        elif x == 127:
103
102
    """
104
103
 
105
104
    if not start_message is None:
106
 
        start_message = start_message.encode(osutils.get_user_encoding())
107
 
    infotext = infotext.encode(osutils.get_user_encoding(), 'replace')
 
105
        start_message = start_message.encode(bzrlib.user_encoding)
 
106
    infotext = infotext.encode(bzrlib.user_encoding, 'replace')
108
107
    return edit_commit_message_encoded(infotext, ignoreline, start_message)
109
108
 
110
109
 
145
144
        f = file(msgfilename, 'rU')
146
145
        try:
147
146
            try:
148
 
                for line in codecs.getreader(osutils.get_user_encoding())(f):
 
147
                for line in codecs.getreader(bzrlib.user_encoding)(f):
149
148
                    stripped_line = line.strip()
150
149
                    # strip empty line before the log message starts
151
150
                    if not started: