| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,8 +96,9 @@ def store_async(self, reader): | |||
| 96 | 96 | class PureRootPathDB(RootPathDB): | |
| 97 | 97 | ||
| 98 | 98 | def __init__(self, root_path): | |
| 99 | - super(PureRootPathDB, self).__init__(root_path) | ||
| 100 | 99 | self._root_path = root_path | |
| 100 | + super(PureRootPathDB, self).__init__(root_path) | ||
| 101 | + | ||
| 101 | 102 | ||
| 102 | 103 | ||
| 103 | 104 | #{ Interface | |
@@ -127,8 +128,8 @@ class PureCompoundDB(CompoundDB, PureObjectDBR, LazyMixin, CachingDB): | |||
| 127 | 128 | def _set_cache_(self, attr): | |
| 128 | 129 | if attr == '_dbs': | |
| 129 | 130 | self._dbs = list() | |
| 130 | - elif attr == '_db_cache': | ||
| 131 | - self._db_cache = dict() | ||
| 131 | + elif attr == '_obj_cache': | ||
| 132 | + self._obj_cache = dict() | ||
| 132 | 133 | else: | |
| 133 | 134 | super(PureCompoundDB, self)._set_cache_(attr) | |
| 134 | 135 | ||
@@ -138,14 +139,14 @@ def _db_query(self, sha): | |||
| 138 | 139 | # most databases use binary representations, prevent converting | |
| 139 | 140 | # it everytime a database is being queried | |
| 140 | 141 | try: | |
| 141 | - return self._db_cache[sha] | ||
| 142 | + return self._obj_cache[sha] | ||
| 142 | 143 | except KeyError: | |
| 143 | 144 | pass | |
| 144 | 145 | # END first level cache | |
| 145 | 146 | ||
| 146 | 147 | for db in self._dbs: | |
| 147 | 148 | if db.has_object(sha): | |
| 148 | - self._db_cache[sha] = db | ||
| 149 | + self._obj_cache[sha] = db | ||
| 149 | 150 | return db | |
| 150 | 151 | # END for each database | |
| 151 | 152 | raise BadObject(sha) | |
@@ -181,7 +182,7 @@ def databases(self): | |||
| 181 | 182 | ||
| 182 | 183 | def update_cache(self, force=False): | |
| 183 | 184 | # something might have changed, clear everything | |
| 184 | - self._db_cache.clear() | ||
| 185 | + self._obj_cache.clear() | ||
| 185 | 186 | stat = False | |
| 186 | 187 | for db in self._dbs: | |
| 187 | 188 | if isinstance(db, CachingDB): | |
@@ -191,8 +192,6 @@ def update_cache(self, force=False): | |||
| 191 | 192 | return stat | |
| 192 | 193 | ||
| 193 | 194 | def partial_to_complete_sha_hex(self, partial_hexsha): | |
| 194 | - databases = self.databases() | ||
| 195 | - | ||
| 196 | 195 | len_partial_hexsha = len(partial_hexsha) | |
| 197 | 196 | if len_partial_hexsha % 2 != 0: | |
| 198 | 197 | partial_binsha = hex_to_bin(partial_hexsha + "0") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | __all__ = ('PureGitODB', 'PurePartialGitDB', 'PureCompatibilityGitDB') | |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | - class PureGitODB(PureRootPathDB, PureObjectDBW, PureCompoundDB): | ||
| 41 | + class PureGitODB(PureRootPathDB, PureObjectDBW, PureCompoundDB, PureAlternatesFileMixin): | ||
| 42 | 42 | """A git-style object-only database, which contains all objects in the 'objects' | |
| 43 | 43 | subdirectory. | |
| 44 | 44 | :note: The type needs to be initialized on the ./objects directory to function, | |
@@ -105,7 +105,7 @@ def set_ostream(self, ostream): | |||
| 105 | 105 | ||
| 106 | 106 | class PurePartialGitDB(PureGitODB, | |
| 107 | 107 | PureRepositoryPathsMixin, PureConfigurationMixin, | |
| 108 | - PureReferencesMixin, PureSubmoduleDB, PureAlternatesFileMixin, | ||
| 108 | + PureReferencesMixin, PureSubmoduleDB, | ||
| 109 | 109 | PureIndexDB, PureTransportDB | |
| 110 | 110 | # HighLevelRepository Currently not implemented ! | |
| 111 | 111 | ): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,8 +31,8 @@ def _update_dbs_from_ref_file(self): | |||
| 31 | 31 | dbcls = self.ObjectDBCls | |
| 32 | 32 | if dbcls is None: | |
| 33 | 33 | # late import | |
| 34 | - from complex import PureGitODB # TODO: This should be a configurable for flexibility | ||
| 35 | - dbcls = PureGitODB | ||
| 34 | + import complex | ||
| 35 | + dbcls = complex.PureGitODB | ||
| 36 | 36 | # END get db type | |
| 37 | 37 | ||
| 38 | 38 | # try to get as many as possible, don't fail if some are unavailable | |
| Back | FazBrowse Home | New Git URL |
0 commit comments