diff hggit/__init__.py @ 1134:d75d704772d1

compat: support hg 4.7 demandimport.IGNORES API with fallback to 4.6 API This uses try-except to have a fastpath for the 4.7 API. Thanks to Pierre-Yves David.
author Arne Babenhauserheide <bab@draketo.de>
date Tue, 18 Sep 2018 21:52:09 +0200
parents 70c9dfdb0bc1
children c4703246f350
line wrap: on
line diff
--- a/hggit/__init__.py	Mon May 28 10:08:42 2018 +0200
+++ b/hggit/__init__.py	Tue Sep 18 21:52:09 2018 +0200
@@ -73,9 +73,12 @@
     # baseset was added in hg 3.0
     pass
 
-demandimport.ignore.extend([
-    'collections',
-])
+try:
+    demandimport.IGNORES.add('collections')
+except AttributeError as e:  # pre 4.7 API
+    demandimport.ignore.extend([
+        'collections',
+    ])
 
 __version__ = '0.8.11'