11# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
22#
3- # This module is part of GitDB and is released under
3+ # This module is part of PureGitDB and is released under
44# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55from base import (
6- CompoundDB ,
7- ObjectDBW ,
8- RootPathDBBase ,
9- RepositoryPathsMixin ,
10- ConfigurationMixin ,
6+ PureCompoundDB ,
7+ PureObjectDBW ,
8+ PureRootPathDB ,
9+ PureRepositoryPathsMixin ,
10+ PureConfigurationMixin ,
1111 )
1212
13- from resolve import NameResolvePureMixin
13+ from resolve import PureReferencesMixin
1414
15- from loose import LooseObjectDB
16- from pack import PackedDB
17- from ref import ReferenceDB
15+ from loose import PureLooseObjectODB
16+ from pack import PurePackedODB
17+ from ref import PureReferenceDB
1818
1919from gitdb .util import (
2020 LazyMixin ,
2929 )
3030import os
3131
32- __all__ = ('GitODB ' , 'GitDB ' )
32+ __all__ = ('PureGitODB ' , 'PureGitDB ' )
3333
3434
35- class GitODB ( RootPathDBBase , ObjectDBW , CompoundDB ):
35+ class PureGitODB ( PureRootPathDB , PureObjectDBW , PureCompoundDB ):
3636 """A git-style object-only database, which contains all objects in the 'objects'
3737 subdirectory.
3838 :note: The type needs to be initialized on the ./objects directory to function,
39- as it deals solely with object lookup. Use a GitDB type if you need
39+ as it deals solely with object lookup. Use a PureGitDB type if you need
4040 reference and push support."""
4141 # Configuration
42- PackDBCls = PackedDB
43- LooseDBCls = LooseObjectDB
44- ReferenceDBCls = ReferenceDB
42+ PackDBCls = PurePackedODB
43+ LooseDBCls = PureLooseObjectODB
44+ PureReferenceDBCls = PureReferenceDB
4545
4646 # Directories
4747 packs_dir = 'pack'
@@ -50,15 +50,15 @@ class GitODB(RootPathDBBase, ObjectDBW, CompoundDB):
5050
5151 def __init__ (self , root_path ):
5252 """Initialize ourselves on a git ./objects directory"""
53- super (GitODB , self ).__init__ (root_path )
53+ super (PureGitODB , self ).__init__ (root_path )
5454
5555 def _set_cache_ (self , attr ):
5656 if attr == '_dbs' or attr == '_loose_db' :
5757 self ._dbs = list ()
5858 loose_db = None
5959 for subpath , dbcls in ((self .packs_dir , self .PackDBCls ),
6060 (self .loose_dir , self .LooseDBCls ),
61- (self .alternates_dir , self .ReferenceDBCls )):
61+ (self .alternates_dir , self .PureReferenceDBCls )):
6262 path = self .db_path (subpath )
6363 if os .path .exists (path ):
6464 self ._dbs .append (dbcls (path ))
@@ -79,10 +79,10 @@ def _set_cache_(self, attr):
7979 # finally set the value
8080 self ._loose_db = loose_db
8181 else :
82- super (GitODB , self )._set_cache_ (attr )
82+ super (PureGitODB , self )._set_cache_ (attr )
8383 # END handle attrs
8484
85- #{ ObjectDBW interface
85+ #{ PureObjectDBW interface
8686
8787 def store (self , istream ):
8888 return self ._loose_db .store (istream )
@@ -96,7 +96,7 @@ def set_ostream(self, ostream):
9696 #} END objectdbw interface
9797
9898
99- class GitDB ( GitODB , RepositoryPathsMixin , ConfigurationMixin , NameResolvePureMixin ):
99+ class PureGitDB ( PureGitODB , PureRepositoryPathsMixin , PureConfigurationMixin , PureReferencesMixin ):
100100 """Git like database with support for object lookup as well as reference resolution.
101101 Our rootpath is set to the actual .git directory (bare on unbare).
102102
@@ -106,8 +106,8 @@ class GitDB(GitODB, RepositoryPathsMixin, ConfigurationMixin, NameResolvePureMix
106106
107107 def __init__ (self , root_path ):
108108 """Initialize ourselves on the .git directory, or the .git/objects directory."""
109- RepositoryPathsMixin ._initialize (self , root_path )
110- super (GitDB , self ).__init__ (self .objects_path ())
109+ PureRepositoryPathsMixin ._initialize (self , root_path )
110+ super (PureGitDB , self ).__init__ (self .objects_path ())
111111
112112
113113
0 commit comments