[PATCH] share: don't recreate the source repo each time

Yuya Nishihara yuya at tcha.org
Tue Jul 12 10:21:32 EDT 2016

On Mon, 11 Jul 2016 13:40:39 -0700, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1468269602 25200
> #      Mon Jul 11 13:40:02 2016 -0700
> # Node ID 6696a8a974423d6ba363fa1f32e683509132d1f0
> # Parent  4b16a5bd99484cac96ade9af76e6deee1fc57b54
> share: don't recreate the source repo each time
> Previously, every time you asked for the source repo of a shared working copy it
> would recreate the repo object, which required calling reposetup. With certain
> extension enabled, this can be quite expensive, and it can happen many times
> (for instance, share attaches a post transaction hook to update bookmarks that
> triggers this).
> The fix is to just cache the repo object instead of constantly recreating it.

Seems fine to me. Queued, thanks.

Perhaps we'd better to add a formal API to cache shared source, but it's
unclear to me whether or not the whole repo should be kept. We might want
to cache the source bmstore and features set, instead.

More information about the Mercurial-devel mailing list