This is an archive of the discontinued Mercurial Phabricator instance.

copytrace: add a a new config to limit the number of drafts in heuristics
ClosedPublic

Authored by pulkit on Sep 21 2017, 8:19 AM.

Details

Summary

The heuristics options tries to the default full copytracing algorithm if both
the source and destination branches contains of non-public changesets only. But
this can be slow in cases when we have a lot of drafts.

This patch adds a new config option experimental.copytrace.sourcecommitlimit
which defaults to 100. This value will be the limit of number of drafts from c1
to base. Incase there are more changesets even though they are draft, the
heuristics algorithm will be used.

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

pulkit created this revision.Sep 21 2017, 8:19 AM
pulkit updated this revision to Diff 1967.Sep 21 2017, 12:37 PM
yuja requested changes to this revision.Sep 25 2017, 9:48 AM
yuja added a subscriber: yuja.
yuja added inline comments.
mercurial/copies.py
394

Can you make it use the new config registrar?

397

Perhaps this loop needs sanity check we've added for
_heuristicscopytracing().

BTW, can't we use revset to count the number of commits?

This revision now requires changes to proceed.Sep 25 2017, 9:48 AM
pulkit updated this revision to Diff 2084.Sep 26 2017, 8:49 AM
yuja requested changes to this revision.Sep 26 2017, 9:19 AM
yuja added inline comments.
mercurial/copies.py
393

Oops. repo isn't passed to this function.

Write tests?

This revision now requires changes to proceed.Sep 26 2017, 9:19 AM
pulkit planned changes to this revision.Sep 26 2017, 9:47 AM
pulkit added inline comments.
mercurial/copies.py
393

Ah, my bad. Thanks for catching. Yeah will include tests in the next version.

pulkit updated this revision to Diff 2089.Sep 26 2017, 11:05 AM
This revision was automatically updated to reflect the committed changes.