This is an archive of the discontinued Mercurial Phabricator instance.

cmdutil: removing redundant if condition in amend
ClosedPublic

Authored by singhsrb on Aug 31 2017, 10:01 PM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

singhsrb created this revision.Aug 31 2017, 10:01 PM
singhsrb edited the summary of this revision. (Show Details)Sep 1 2017, 6:18 PM
singhsrb edited the test plan for this revision. (Show Details)
singhsrb retitled this revision from cmdutil: remove redundant if block and fix indentation in amend to cmdutil: removing redundant if condition in amend.
singhsrb updated this revision to Diff 1564.
martinvonz added inline comments.
mercurial/cmdutil.py
3155–3164

Ah, it's this stuff that makes the check unnecessary, I suppose. So the check was probably made unnecessary in commit a8aba292.

3166–3176

Since you're modifying this area, could you also clean this up using the ui.configoverride() context manager? (Obviously in a follow-up; it's not necessary for this series.)

This revision was automatically updated to reflect the committed changes.