This is an archive of the discontinued Mercurial Phabricator instance.

cmdutil: remove the redundant commit during amend
AbandonedPublic

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

Details

Reviewers
durham
Group Reviewers
hg-reviewers
Summary

There was an extra commit made during the amend operation to track the
changes to the working copy. However, this logic was written a long time back
and newer API's make this extra commit redundant. Therefore, I am removing the
extra commit. After this change, I noticed that

  • Execution time of the cmdutil.amend improved by over 40%.
  • Execution time of "hg commit --amend" improved by over 20%.
Test Plan

I ensured that the all the hg tests passed after the change. I had
to fix a few tests which were aware of the extra commit made during the amend.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

singhsrb created this revision.Aug 31 2017, 10:01 PM
durham accepted this revision.Sep 1 2017, 3:23 PM
durham added a subscriber: durham.

This series went through an initial review internally as well. Just fyi that there's been some eyes on it already.

singhsrb added inline comments.Sep 1 2017, 6:13 PM
mercurial/cmdutil.py
3083

This code can be optimized by passing the matcher to copies.pathcopies. That will ensure that we are only computing the copies for only the files to be amended.

singhsrb updated this revision to Diff 1562.Sep 1 2017, 6:15 PM

This patch needs does not apply on @ (on top of the others in this series), so it probably needs to be rebased.

singhsrb abandoned this revision.Sep 5 2017, 9:01 PM

Rebased this change on 'hg-committed' repo. Please see D636 instead.