Patchwork D594: cmdutil: removing redundant if condition in amend

login
register
mail settings
Submitter phabricator
Date Sept. 2, 2017, 6:22 a.m.
Message ID <995cd238c02e712a293f7d139638a760@localhost.localdomain>
Download mbox | patch
Permalink /patch/23619/
State Not Applicable
Headers show

Comments

phabricator - Sept. 2, 2017, 6:22 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG270a574ccac9: cmdutil: removing redundant if condition in amend (authored by singhsrb).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D594?vs=1564&id=1572

REVISION DETAIL
  https://phab.mercurial-scm.org/D594

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: singhsrb, #hg-reviewers
Cc: martinvonz, mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3173,13 +3173,14 @@ 
             newid = repo.commitctx(new)
         finally:
             repo.ui.setconfig('phases', 'new-commit', ph, 'amend')
-        if newid != old.node():
-            # Reroute the working copy parent to the new changeset
-            repo.setparents(newid, nullid)
-            mapping = {old.node(): (newid,)}
-            if node:
-                mapping[node] = ()
-            scmutil.cleanupnodes(repo, mapping, 'amend')
+
+        # Reroute the working copy parent to the new changeset
+        repo.setparents(newid, nullid)
+        mapping = {old.node(): (newid,)}
+        if node:
+            mapping[node] = ()
+        scmutil.cleanupnodes(repo, mapping, 'amend')
+
     return newid
 
 def commiteditor(repo, ctx, subs, editform=''):