summaryrefslogtreecommitdiff
path: root/git/db/py/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-05-30 01:23:28 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-05-30 01:23:28 +0200
commit112bb1672d6b28f203e7839e320b985486636800 (patch)
tree755fb8dcab211678697f6e03cf37122592b7c573 /git/db/py/base.py
parent0996049122842a343e0ea7fbbecafddb2b4ba9d3 (diff)
downloadgitpython-112bb1672d6b28f203e7839e320b985486636800.tar.gz
Finished moving all repository methods to the respective interfaces and implementations. It seems theoretically work together now, although it clearly is much more complex than ever before.
The repo package was slimmed down to being a module once again, which is only there for compatability actually
Diffstat (limited to 'git/db/py/base.py')
-rw-r--r--git/db/py/base.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/git/db/py/base.py b/git/db/py/base.py
index cc326c27..74b8beb9 100644
--- a/git/db/py/base.py
+++ b/git/db/py/base.py
@@ -20,6 +20,7 @@ from git.util import (
is_git_dir
)
+from git.index import IndexFile
from git.config import GitConfigParser
from git.exc import (
BadObject,
@@ -35,7 +36,8 @@ import os
__all__ = ( 'PureObjectDBR', 'PureObjectDBW', 'PureRootPathDB', 'PureCompoundDB',
- 'PureConfigurationMixin', 'PureRepositoryPathsMixin', 'PureAlternatesFileMixin')
+ 'PureConfigurationMixin', 'PureRepositoryPathsMixin', 'PureAlternatesFileMixin',
+ 'PureIndexDB')
class PureObjectDBR(ObjectDBR):
@@ -386,6 +388,16 @@ class PureConfigurationMixin(ConfigurationMixin):
#} END interface
+class PureIndexDB(IndexDB):
+ #{ Configuration
+ IndexCls = IndexFile
+ #} END configuration
+
+ @property
+ def index(self):
+ return self.IndexCls(self)
+
+
class PureAlternatesFileMixin(object):
"""Utility able to read and write an alternates file through the alternates property
It needs to be part of a type with the git_dir or db_path property.