record: make the m key open an editor for the commit message (
issue5667)
With the former crecord extension, the user could edit the commit
message while he was de-/selecting hunks. By pressing 'm', an editor
showed up to edit the commit message.
With record being part of mercurial, this feature is not available
anymore. However, the help text still mentions it.
As the infrastructure needed is still present, this feature is quite
easily ported from the crecord extension to mercurial.
It seems there is no test coverage for record ui, so I tested this patch
manually on my local machine.
#!/usr/bin/env python
from __future__ import absolute_import, print_function
from mercurial import (
commands,
localrepo,
ui as uimod,
)
u = uimod.ui.load()
print('% creating repo')
repo = localrepo.localrepository(u, '.', create=True)
f = open('test.py', 'w')
try:
f.write('foo\n')
finally:
f.close
print('% add and commit')
commands.add(u, repo, 'test.py')
commands.commit(u, repo, message='*')
commands.status(u, repo, clean=True)
print('% change')
f = open('test.py', 'w')
try:
f.write('bar\n')
finally:
f.close()
# this would return clean instead of changed before the fix
commands.status(u, repo, clean=True, modified=True)