evolve: show a message when evolution leads to no changes to commit
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 28 Mar 2018 14:11:13 +0530
changeset 3636 92a2d3217de9
parent 3635 debd2f974be5
child 3637 1b9c2720faee
evolve: show a message when evolution leads to no changes to commit In case of orphan resolution, evolution may result in no changes to commit. This patch adds a use message in such cases. This is same as the rebase behavior.
hgext3rd/evolve/evolvecmd.py
tests/test-evolve-continue.t
tests/test-stabilize-result.t
--- a/hgext3rd/evolve/evolvecmd.py	Wed Mar 28 13:48:34 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Mar 28 14:11:13 2018 +0530
@@ -578,6 +578,9 @@
         for book in oldbookmarks:
             bmchanges.append((book, nodenew))
     else:
+        if category == 'orphan':
+            repo.ui.status(_("evolution of %d:%s created no changes "
+                             "to commit\n") % (orig.rev(), orig))
         compat.createmarkers(repo, [(repo[nodesrc], ())], operation='evolve')
         # Behave like rebase, move bookmarks to dest
         for book in oldbookmarks:
@@ -1299,6 +1302,9 @@
     # resolving conflicts can lead to empty wdir and node can be None in
     # those cases
     ctx = repo[evolvestate['current']]
+    if node is None:
+        repo.ui.status(_("evolution of %d:%s created no changes"
+                         " to commit\n") % (ctx.rev(), ctx))
     newctx = repo[node] if node is not None else repo['.']
     compat.createmarkers(repo, [(ctx, (newctx,))], operation='evolve')
 
--- a/tests/test-evolve-continue.t	Wed Mar 28 13:48:34 2018 +0530
+++ b/tests/test-evolve-continue.t	Wed Mar 28 14:11:13 2018 +0530
@@ -128,9 +128,9 @@
   continue: hg evolve --continue
   $ hg diff
 
-XXX: maybe we should add a message here about evolve resulting in no commit
   $ hg evolve --continue
   evolving 7:ad0a59d83efe "added e"
+  evolution of 7:ad0a59d83efe created no changes to commit
 
   $ hg glog
   @  8:00a5c774cc37 added d
--- a/tests/test-stabilize-result.t	Wed Mar 28 13:48:34 2018 +0530
+++ b/tests/test-stabilize-result.t	Wed Mar 28 14:11:13 2018 +0530
@@ -40,6 +40,8 @@
   perform evolve? [Ny] y
   hg rebase -r cce2c55b8965 -d fb9d051ec0a4
   resolving manifests
+  evolution of 2:cce2c55b8965 created no changes to commit
+
   $ glog --hidden
   @  3:fb9d051ec0a4@default(draft) bk:[changea] changea
   |