graft: give helpful warning for empty grafts
It was just showing a status message with the internal revision number.
Instead, show a warning like
note: graft of 27:
3aaa8b6725f0 "28" created no changes to commit
(message tweaked in-flight by mpm)
--- a/mercurial/commands.py Tue Dec 09 03:38:23 2014 +0100
+++ b/mercurial/commands.py Tue Dec 09 03:38:23 2014 +0100
@@ -3495,7 +3495,8 @@
node = repo.commit(text=message, user=user,
date=date, extra=extra, editor=editor)
if node is None:
- ui.status(_('graft for revision %s is empty\n') % ctx.rev())
+ ui.warn(_('note: graft of %s created no changes to commit\n') %
+ desc)
finally:
wlock.release()
--- a/tests/test-graft.t Tue Dec 09 03:38:23 2014 +0100
+++ b/tests/test-graft.t Tue Dec 09 03:38:23 2014 +0100
@@ -717,3 +717,4 @@
$ hg tag -f something
$ hg graft -qr 27
$ hg graft -qf 27
+ note: graft of 27:3aaa8b6725f0 "28" created no changes to commit