~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

add a clean target

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
 
 
35
30
    e = _read_config_value("editor")
36
31
    if e is not None:
37
32
        yield e
39
34
    try:
40
35
        yield os.environ["EDITOR"]
41
36
    except KeyError:
42
 
        pass
43
 
 
44
 
    if os.name == "nt":
45
 
        yield "notepad.exe"
46
 
    elif os.name == "posix":
47
 
        yield "/usr/bin/vi"
 
37
        if os.name == "nt":
 
38
            yield "notepad.exe"
 
39
        elif os.name == "posix":
 
40
            yield "/usr/bin/vi"
48
41
 
49
42
 
50
43
def _run_editor(filename):
114
107
            msg.append(line)
115
108
            
116
109
        if len(msg) == 0:
117
 
            return ""
 
110
            return None
118
111
        # delete empty lines at the end
119
112
        del msg[lastline:]
120
113
        # add a newline at the end, if needed