graft: remark on empty graft
authorMatt Mackall <mpm@selenic.com>
Sun, 06 May 2012 14:15:17 -0500
changeset 16600 b54f3c502e63
parent 16599 4b73f4ba27ca
child 16601 0c98820be15c
graft: remark on empty graft
mercurial/commands.py
tests/test-graft.t
--- a/mercurial/commands.py	Fri May 04 17:27:14 2012 -0500
+++ b/mercurial/commands.py	Sun May 06 14:15:17 2012 -0500
@@ -2719,8 +2719,10 @@
             date = ctx.date()
             if opts.get('date'):
                 date = opts['date']
-            repo.commit(text=ctx.description(), user=user,
+            node = repo.commit(text=ctx.description(), user=user,
                         date=date, extra=extra, editor=editor)
+            if node is None:
+                ui.status(_('graft for revision %s is empty\n') % ctx.rev())
     finally:
         wlock.release()
 
--- a/tests/test-graft.t	Fri May 04 17:27:14 2012 -0500
+++ b/tests/test-graft.t	Sun May 06 14:15:17 2012 -0500
@@ -132,6 +132,7 @@
    b: local copied/moved to a -> m
   preserving b for resolve of b
   updating: b 1/1 files (100.00%)
+  graft for revision 1 is empty
   grafting revision 5
     searching for copies back to rev 1
   resolving manifests