changeset 44438:f0021fbedea9

cleanup: remove redundant clearing of mergestate in rebase and shelve `repo.commit()` now clears the merge state even if it ends up not creating a commit because there were no changes to commit. Differential Revision: https://phab.mercurial-scm.org/D8197
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 28 Feb 2020 11:32:27 -0800
parents 6a34e438461b
children 5a5aee8ba980
files hgext/rebase.py mercurial/shelve.py
diffstat 2 files changed, 0 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Feb 28 11:32:02 2020 -0800
+++ b/hgext/rebase.py	Fri Feb 28 11:32:27 2020 -0800
@@ -548,11 +548,6 @@
                     date=date,
                 )
 
-            if newnode is None:
-                # If it ended up being a no-op commit, then the normal
-                # merge state clean-up path doesn't happen, so do it
-                # here. Fix issue5494
-                mergemod.mergestate.clean(repo)
             return newnode
 
     def _rebasenode(self, tr, rev, allowdivergence, progressfn):
--- a/mercurial/shelve.py	Fri Feb 28 11:32:02 2020 -0800
+++ b/mercurial/shelve.py	Fri Feb 28 11:32:27 2020 -0800
@@ -827,10 +827,6 @@
                 )
 
         if newnode is None:
-            # If it ended up being a no-op commit, then the normal
-            # merge state clean-up path doesn't happen, so do it
-            # here. Fix issue5494
-            merge.mergestate.clean(repo)
             shelvectx = state.pendingctx
             msg = _(
                 b'note: unshelved changes already existed '
@@ -1031,10 +1027,6 @@
             )
 
         if newnode is None:
-            # If it ended up being a no-op commit, then the normal
-            # merge state clean-up path doesn't happen, so do it
-            # here. Fix issue5494
-            merge.mergestate.clean(repo)
             shelvectx = tmpwctx
             msg = _(
                 b'note: unshelved changes already existed '