pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This patch makes indexapi use zope.interface which is now vendored with
mercurial.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2999
AFFECTED FILES
hgext/infinitepush/fileindexapi.py
hgext/infinitepush/indexapi.py
hgext/infinitepush/sqlindexapi.py
CHANGE DETAILS
diff --git a/hgext/infinitepush/sqlindexapi.py
b/hgext/infinitepush/sqlindexapi.py
--- a/hgext/infinitepush/sqlindexapi.py
+++ b/hgext/infinitepush/sqlindexapi.py
@@ -14,6 +14,10 @@
import warnings
import mysql.connector
+from mercurial.thirdparty.zope import (
+interface as zi,
+)
+
from . import indexapi
def _convertbookmarkpattern(pattern):
@@ -23,7 +27,8 @@
pattern = pattern[:-1] + '%'
return pattern
-class sqlindexapi(indexapi.indexapi):
+@zi.implementer(indexapi.indexapi)
+class sqlindexapi(object):
'''
Sql backend for infinitepush index. See schema.sql
'''
diff --git a/hgext/infinitepush/indexapi.py b/hgext/infinitepush/indexapi.py
--- a/hgext/infinitepush/indexapi.py
+++ b/hgext/infinitepush/indexapi.py
@@ -7,7 +7,11 @@
from __future__ import absolute_import
-class indexapi(object):
+from mercurial.thirdparty.zope import (
+interface as zi,
+)
+
+class indexapi(zi.Interface):
"""Class that manages access to infinitepush index.
This class is a context manager and all write operations (like
diff --git a/hgext/infinitepush/fileindexapi.py
b/hgext/infinitepush/fileindexapi.py
--- a/hgext/infinitepush/fileindexapi.py
+++ b/hgext/infinitepush/fileindexapi.py
@@ -15,11 +15,16 @@
import os
+from mercurial.thirdparty.zope import (
+interface as zi,
+)
+
from mercurial.utils import stringutil
from . import indexapi
-class fileindexapi(indexapi.indexapi):
+@zi.implementer(indexapi.indexapi)
+class fileindexapi(object):
def __init__(self, repo):
super(fileindexapi, self).__init__()
self._repo = repo
To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel