backout: add a message after backout that need manual commit
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 08 Jan 2014 17:23:26 -0800
changeset 20276 6545770bd379
parent 20275 2123d27ff75d
child 20277 c05b968d05eb
backout: add a message after backout that need manual commit In some case Backout silently succeeded to back out but left all the change uncommitted. This may be confusing for user so this changeset add a note reminding to commit. Other backout case already actively informs the user about created commit.
mercurial/commands.py
tests/test-backout.t
tests/test-subrepo.t
--- a/mercurial/commands.py	Wed Jan 08 14:53:46 2014 -0800
+++ b/mercurial/commands.py	Wed Jan 08 17:23:26 2014 -0800
@@ -465,11 +465,17 @@
         if not opts.get('merge') and op1 != node:
             try:
                 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
-                stats = mergemod.update(repo, parent, True, True, False, node, False)
+                stats = mergemod.update(repo, parent, True, True, False,
+                                        node, False)
                 repo.setparents(op1, op2)
                 hg._showstats(repo, stats)
                 if stats[3]:
-                    repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
+                    repo.ui.status(_("use 'hg resolve' to retry unresolved "
+                                     "file merges\n"))
+                else:
+                    msg = _("changeset %s backed out, "
+                            "don't forget to commit.\n")
+                    ui.status(msg % short(node))
                 return stats[3] > 0
             finally:
                 ui.setconfig('ui', 'forcemerge', '')
--- a/tests/test-backout.t	Wed Jan 08 14:53:46 2014 -0800
+++ b/tests/test-backout.t	Wed Jan 08 17:23:26 2014 -0800
@@ -189,6 +189,7 @@
 without --merge
   $ hg backout -d '3 0' 1 --tool=true
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  changeset 22bca4c721e5 backed out, don't forget to commit.
   $ hg locate b
   b
   $ hg update -C tip
@@ -324,6 +325,7 @@
 without --merge
   $ hg backout -r 1 --tool=true
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  changeset bf1602f437f3 backed out, don't forget to commit.
   $ hg branch
   branch2
   $ hg status -A
--- a/tests/test-subrepo.t	Wed Jan 08 14:53:46 2014 -0800
+++ b/tests/test-subrepo.t	Wed Jan 08 17:23:26 2014 -0800
@@ -469,6 +469,7 @@
 
   $ hg backout ".^"
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  changeset c373c8102e68 backed out, don't forget to commit.
 
   $ hg up -C # discard changes
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved