D594: cmdutil: removing redundant if condition in amend
singhsrb (Saurabh Singh)
phabricator at mercurial-scm.org
Fri Sep 1 22:19:06 UTC 2017
singhsrb updated this revision to Diff 1564.
singhsrb edited the summary of this revision.
singhsrb edited the test plan for this revision.
singhsrb retitled this revision from "cmdutil: remove redundant if block and fix indentation in amend" to "cmdutil: removing redundant if condition in amend".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D594?vs=1526&id=1564
REVISION DETAIL
https://phab.mercurial-scm.org/D594
AFFECTED FILES
mercurial/cmdutil.py
CHANGE DETAILS
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3171,13 +3171,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=''):
To: singhsrb, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list