# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1558239233 18000
#      Sat May 18 23:13:53 2019 -0500
# Node ID cef9eaae9f5fe389e417a473538c022ca7feed91
# Parent  60c2da676e077e57c99b11cf5bc0c944e7cfbdfd
compat: drop compatibility check for ignore module

diff --git a/hggit/__init__.py b/hggit/__init__.py
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -59,14 +59,6 @@
     # We only *use* the exchange module in hg 3.2+, so this is safe
     pass
 
-# COMPAT: hg 3.5 - ignore module was removed
-try:
-    from mercurial import ignore
-    ignore.readpats
-    ignoremod = True
-except (AttributeError, ImportError):
-    ignoremod = False
-
 # COMPAT: hg 3.0 - revset.baseset was added
 baseset = set
 try:
@@ -224,15 +216,10 @@
     if not isinstance(repo, gitrepo.gitrepo):
 
         if (getattr(dirstate, 'rootcache', False) and
-            (not ignoremod or getattr(ignore, 'readpats', False)) and
             hgutil.safehasattr(repo, 'vfs') and
             os.path.exists(compat.gitvfs(repo).join('git'))):
             # only install our dirstate wrapper if it has a hope of working
             import gitdirstate
-            if ignoremod:
-                def ignorewrap(orig, *args, **kwargs):
-                    return gitdirstate.gignore(*args, **kwargs)
-                extensions.wrapfunction(ignore, 'ignore', ignorewrap)
             dirstate.dirstate = gitdirstate.gitdirstate
 
         klass = hgrepo.generate_repo_subclass(repo.__class__)
diff --git a/hggit/gitdirstate.py b/hggit/gitdirstate.py
--- a/hggit/gitdirstate.py
+++ b/hggit/gitdirstate.py
@@ -13,14 +13,6 @@
 
 import compat
 
-# COMPAT: hg 3.5 - ignore module was removed
-try:
-    from mercurial import ignore
-    ignore.readpats
-    ignoremod = True
-except (AttributeError, ImportError):
-    ignoremod = False
-
 # COMPAT: hg 2.9 - pathauditor moved to pathutil
 try:
     from mercurial import pathutil
@@ -78,11 +70,7 @@
 
 def gignore(root, files, warn, extrapatterns=None):
     allpats = []
-    pats = []
-    if ignoremod:
-        pats = ignore.readpats(root, files, warn)
-    else:
-        pats = [(f, ['include:%s' % f]) for f in files]
+    pats = [(f, ['include:%s' % f]) for f in files]
     for f, patlist in pats:
         allpats.extend(patlist)
 
@@ -97,11 +85,9 @@
             try:
                 matchmod.match(root, '', [], patlist)
             except error.Abort, inst:
-                if not ignoremod:
-                    # in this case, patlist is ['include: FILE'], and
-                    # inst[0] should already include FILE
-                    raise
-                raise error.Abort('%s: %s' % (f, inst[0]))
+                # in this case, patlist is ['include: FILE'], and
+                # inst[0] should already include FILE
+                raise
         if extrapatterns:
             try:
                 matchmod.match(root, '', [], extrapatterns)