changeset 23506:dc82f1a7436d

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)
author Mads Kiilerich <madski@unity3d.com>
date Tue, 09 Dec 2014 03:38:23 +0100
parents bd5dbb8a05c8
children 67045b5a903a
files mercurial/commands.py tests/test-graft.t
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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