[PATCH] convert: use pygit2 if available, to improve performance

Matt Mackall mpm at selenic.com
Thu Apr 5 17:03:34 CDT 2012


On Thu, 2012-04-05 at 14:53 -0700, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1333662769 25200
> # Branch stable
> # Node ID d6a14f098965261ca2e1722d711bf9f7789ae3c2
> # Parent  4d875bb546dc03db33630f5388d7e04939c386a0
> convert: use pygit2 if available, to improve performance

check-code sez:

hgext/convert/git.py:154 (bryano at 16370):
 >         return self.repo[rev.decode('hex')].data, self.modecache[(name,rev)]
 missing whitespace after ,

As check-code is run by the test-suite, it rats out folks who submit
patches without running tests.

> +def convert_git(ui, path, rev=None):
> +    try:
> +        return convert_git_pygit2(ui, path, rev)
> +    except nopygit2:
> +        return convert_git_plain(ui, path, rev)

This probably wants a ui.note("using pygit2\n") or similar so that we
can diagnose people's inevitable complaints of "I installed pygit2 but
it's still slow!"

Hopefully Patrick will give some further feedback.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list