mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
amend: removing redundant if condition
There is needless checking for the new commit hash not being equal to the old commit hash. This condition will always be true at this point in the code path and thus, can be removed safely. This commit removes the redundant condition. Test Plan: ran the test suite. Differential Revision: https://phab.mercurial-scm.org/D594
This commit is contained in:
parent
16648b82d6
commit
2e3d37be51
@ -3173,13 +3173,14 @@ def amend(ui, repo, commitfunc, old, extra, pats, opts):
|
||||
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=''):
|
||||
|
Loading…
Reference in New Issue
Block a user