73
73
for candidate, candidate_source in _get_editor():
74
74
edargs = cmdline.split(candidate)
76
## mutter("trying editor: %r", (edargs +[filename]))
77
76
x = call(edargs + [filename])
78
77
except OSError as e:
79
78
if candidate_source is not None:
121
120
:return: commit message or None.
124
if not start_message is None:
123
if start_message is not None:
125
124
start_message = start_message.encode(osutils.get_user_encoding())
126
125
infotext = infotext.encode(osutils.get_user_encoding(), 'replace')
127
126
return edit_commit_message_encoded(infotext, ignoreline, start_message)
307
306
These are all empty initially.
309
308
Hooks.__init__(self, "breezy.msgeditor", "hooks")
310
self.add_hook('set_commit_message',
311
"Set a fixed commit message. "
312
"set_commit_message is called with the "
313
"breezy.commit.Commit object (so you can also change e.g. revision "
314
"properties by editing commit.builder._revprops) and the message "
315
"so far. set_commit_message must return the message to use or None"
316
" if it should use the message editor as normal.", (2, 4))
317
self.add_hook('commit_message_template',
318
"Called when a commit message is being generated. "
319
"commit_message_template is called with the breezy.commit.Commit "
320
"object and the message that is known so far. "
321
"commit_message_template must return a new message to use (which "
322
"could be the same as it was given). When there are multiple "
323
"hooks registered for commit_message_template, they are chained "
324
"with the result from the first passed into the second, and so "
310
'set_commit_message',
311
"Set a fixed commit message. "
312
"set_commit_message is called with the "
313
"breezy.commit.Commit object (so you can also change e.g. "
314
"revision properties by editing commit.builder._revprops) and the "
315
"message so far. set_commit_message must return the message to "
316
"use or None if it should use the message editor as normal.",
319
'commit_message_template',
320
"Called when a commit message is being generated. "
321
"commit_message_template is called with the breezy.commit.Commit "
322
"object and the message that is known so far. "
323
"commit_message_template must return a new message to use (which "
324
"could be the same as it was given). When there are multiple "
325
"hooks registered for commit_message_template, they are chained "
326
"with the result from the first passed into the second, and so "
328
330
hooks = MessageEditorHooks()