diff mercurial/dirstate.py @ 42931:d459cd8ea42d

interfaces: introduce an interface for dirstate implementations As usual with adding interface definitions, this describes the way things are, not the way we'd like things to be. There are some clear problems in the interface right now (eg ._map leaks in a few places), but I have plans to clean those up. There are also many missing docstrings, but again, we'll make a second pass to clean that up. Differential Revision: https://phab.mercurial-scm.org/D6836
author Augie Fackler <augie@google.com>
date Tue, 10 Sep 2019 09:21:38 -0400
parents 749ef8c31187
children 2372284d9457
line wrap: on
line diff
--- a/mercurial/dirstate.py	Tue Sep 10 09:41:58 2019 -0400
+++ b/mercurial/dirstate.py	Tue Sep 10 09:21:38 2019 -0400
@@ -27,6 +27,11 @@
     util,
 )
 
+from .interfaces import (
+    dirstate as intdirstate,
+    util as interfaceutil,
+)
+
 parsers = policy.importmod(r'parsers')
 rustmod = policy.importrust(r'dirstate')
 
@@ -55,6 +60,7 @@
         os.close(tmpfd)
         vfs.unlink(tmpname)
 
+@interfaceutil.implementer(intdirstate.idirstate)
 class dirstate(object):
 
     def __init__(self, opener, ui, root, validate, sparsematchfn):