Submitter | phabricator |
---|---|
Date | March 7, 2020, 9:45 p.m. |
Message ID | <differential-rev-PHID-DREV-p5ya7jtnwlks2vju5hgh-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/45611/ |
State | Superseded |
Headers | show |
Comments
pulkit added inline comments. INLINE COMMENTS > index.py:19 > +try: > + import pygit2 > +except ImportError: IIUC, we should access some attribute to trigger demandimport. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D8261/new/ REVISION DETAIL https://phab.mercurial-scm.org/D8261 To: durin42, #hg-reviewers Cc: pulkit, mercurial-devel
Patch
diff --git a/hgext/git/index.py b/hgext/git/index.py --- a/hgext/git/index.py +++ b/hgext/git/index.py @@ -4,8 +4,6 @@ import os import sqlite3 -import pygit2 - from mercurial.i18n import _ from mercurial import ( @@ -15,6 +13,13 @@ pycompat, ) +# This looks goofy, but it appeases test-check-imports which has funny +# ideas about where this import belongs. +try: + import pygit2 +except ImportError: + raise + from . import gitutil