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)
This commit is contained in:
Mads Kiilerich 2014-12-09 03:38:23 +01:00
parent d138d31de7
commit 5877ceecfe
2 changed files with 3 additions and 1 deletions

View File

@ -3495,7 +3495,8 @@ def graft(ui, repo, *revs, **opts):
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()

View File

@ -717,3 +717,4 @@ Empty graft
$ hg tag -f something
$ hg graft -qr 27
$ hg graft -qf 27
note: graft of 27:3aaa8b6725f0 "28" created no changes to commit