~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: Martin Pool
  • Date: 2005-10-06 10:53:12 UTC
  • mto: (1185.13.3)
  • mto: This revision was merged to the branch mainline in revision 1418.
  • Revision ID: mbp@sourcefrog.net-20051006105312-06320dbb986e4bb3
- test that we cannot join weaves with different ancestry

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    """Return a sequence of possible editor binaries for the current platform"""
28
28
    from bzrlib.osutils import _read_config_value
29
29
    
 
30
    try:
 
31
        yield os.environ["BZR_EDITOR"]
 
32
    except KeyError:
 
33
        pass
 
34
 
30
35
    e = _read_config_value("editor")
31
36
    if e is not None:
32
37
        yield e
34
39
    try:
35
40
        yield os.environ["EDITOR"]
36
41
    except KeyError:
37
 
        if os.name == "nt":
38
 
            yield "notepad.exe"
39
 
        elif os.name == "posix":
40
 
            yield "/usr/bin/vi"
 
42
        pass
 
43
 
 
44
    if os.name == "nt":
 
45
        yield "notepad.exe"
 
46
    elif os.name == "posix":
 
47
        yield "/usr/bin/vi"
41
48
 
42
49
 
43
50
def _run_editor(filename):
107
114
            msg.append(line)
108
115
            
109
116
        if len(msg) == 0:
110
 
            return None
 
117
            return ""
111
118
        # delete empty lines at the end
112
119
        del msg[lastline:]
113
120
        # add a newline at the end, if needed