comparison hgext/git/gitlog.py @ 44484:ec54b3d2af0b

git: don't fail import when pygit2 is not install `test-duplicateoptions.py` was failing on py2 for be because I didn't have pygit2 installed. It failed because we depend on pygit2 at import time. This patch makes it so we successfully load the git extension even if pygit2 doesn't exist -- we just won't be able to use it in that case. Differential Revision: https://phab.mercurial-scm.org/D8268
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 09 Mar 2020 11:18:33 -0700
parents 8b5f5d8ad783
children 8bfc6cc8e480
comparison
equal deleted inserted replaced
44483:2e464925f662 44484:ec54b3d2af0b
1 from __future__ import absolute_import 1 from __future__ import absolute_import
2
3 import pygit2
4 2
5 from mercurial.i18n import _ 3 from mercurial.i18n import _
6 4
7 from mercurial import ( 5 from mercurial import (
8 ancestor, 6 ancestor,
22 from . import ( 20 from . import (
23 gitutil, 21 gitutil,
24 index, 22 index,
25 manifest as gitmanifest, 23 manifest as gitmanifest,
26 ) 24 )
25
26 pygit2 = gitutil.get_pygit2()
27 27
28 28
29 class baselog(object): # revlog.revlog): 29 class baselog(object): # revlog.revlog):
30 """Common implementations between changelog and manifestlog.""" 30 """Common implementations between changelog and manifestlog."""
31 31