This is an archive of the discontinued Mercurial Phabricator instance.

changegroup: don't try to build changelog chunks if not required
ClosedPublic

Authored by pulkit on Jan 29 2019, 8:07 AM.

Details

Summary

When we extend a narrow clone without ellipsis, we don't download changelog
information because that's already present with the client. However we still try
to build that chunk stream. Building that chunk stream involves calling a lookup
function and store.emitrevisions() API. The lookup function is called len(cl)
number of times.

On large repositories, where len(cl) is in millions, calling that lookup
function is not a good idea. Also it's not required to use the
store.emitrevisons() API because we already have nodes present which we can use.

This patch short-circuits state building logic if we are processing a
non-ellipsis case and changelog is not required.

This saves up ~20 seconds on our internal repo for a single extend call.

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.Jan 29 2019, 8:07 AM
This revision was automatically updated to reflect the committed changes.