~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: Martin Pool
  • Date: 2005-09-01 11:27:20 UTC
  • Revision ID: mbp@sourcefrog.net-20050901112720-f5ccb6b6627991de
- work properly when $EDITOR contains multiple words

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
 
42
42
def _run_editor(filename):
43
 
    """Try to execute an editor to edit the commit message. Returns True on success,
44
 
    False on failure"""
 
43
    """Try to execute an editor to edit the commit message."""
45
44
    for e in _get_editor():
46
 
        x = os.spawnvp(os.P_WAIT, e, (e, filename))
 
45
        edargs = e.split(' ')
 
46
        x = os.spawnvp(os.P_WAIT, edargs[0],
 
47
                       edargs + [filename])
47
48
        if x == 0:
48
49
            return True
49
50
        elif x == 127:
50
51
            continue
51
52
        else:
52
53
            break
53
 
    raise BzrError("Could not start any editor. Please specify $EDITOR or use ~/.bzr.conf/editor")
54
 
    return False
 
54
    raise BzrError("Could not start any editor. "
 
55
                   "Please specify $EDITOR or use ~/.bzr.conf/editor")
55
56
                          
56
57
 
57
58
def edit_commit_message(infotext, ignoreline=None):