~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: Martin Pool
  • Date: 2006-03-20 09:02:42 UTC
  • mfrom: (1610.1.11 bzr.mbp.integration)
  • mto: This revision was merged to the branch mainline in revision 1616.
  • Revision ID: mbp@sourcefrog.net-20060320090242-b1e492be1b6bcb7e
[merge] my previous work, including pycurl regression

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
            break
68
68
    raise BzrError("Could not start any editor. "
69
69
                   "Please specify $EDITOR or use ~/.bzr.conf/editor")
70
 
                          
71
 
 
72
 
def edit_commit_message(infotext, ignoreline=None):
 
70
 
 
71
 
 
72
DEFAULT_IGNORE_LINE = "%(bar)s %(msg)s %(bar)s" % \
 
73
    { 'bar' : '-' * 14, 'msg' : 'This line and the following will be ignored' }
 
74
 
 
75
 
 
76
def edit_commit_message(infotext, ignoreline=DEFAULT_IGNORE_LINE):
73
77
    """Let the user edit a commit message in a temp file.
74
78
 
75
79
    This is run if they don't give a message or
81
85
        'bzr status'.
82
86
    """
83
87
    import tempfile
84
 
    
85
 
    if ignoreline is None:
86
 
        ignoreline = "-- This line and the following will be ignored --"
87
 
        
 
88
 
88
89
    try:
89
90
        tmp_fileno, msgfilename = tempfile.mkstemp(prefix='bzr_log.', dir=u'.')
90
91
        msgfile = os.close(tmp_fileno)