graft: give helpful warning for empty grafts
authorMads Kiilerich <madski@unity3d.com>
Tue, 09 Dec 2014 03:38:23 +0100
changeset 23506 dc82f1a7436d
parent 23505 bd5dbb8a05c8
child 23507 67045b5a903a
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)
mercurial/commands.py
tests/test-graft.t
--- 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