Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0906450

Browse files
committed
Added trivial implementation for info and stream methods - info is very inefficient, but can't help it. Basic repo tests don't work as dulwich ignores alternate files
1 parentb56764b commit0906450

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎git/db/dulwich/complex.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#from git.db.interface import ObjectDBW, ObjectDBR
1818
fromdulwich.repoimportRepoasDulwichRepo
1919

20+
fromgit.baseimportOInfo,OStream
21+
fromgit.funimporttype_id_to_type_map
22+
23+
fromcStringIOimportStringIO
2024
importos
2125

2226

@@ -42,6 +46,18 @@ def __getattr__(self, attr):
4246
returngetattr(self._dw_repo,attr)
4347
#END handle attr
4448

49+
#{ Object DBR
50+
51+
definfo(self,binsha):
52+
type_id,uncomp_data=self._dw_repo.object_store.get_raw(binsha)
53+
returnOInfo(binsha,type_id_to_type_map[type_id],len(uncomp_data))
54+
55+
defstream(self,binsha):
56+
type_id,uncomp_data=self._dw_repo.object_store.get_raw(binsha)
57+
returnOStream(binsha,type_id_to_type_map[type_id],len(uncomp_data),StringIO(uncomp_data))
58+
59+
#}END object dbr
60+
4561

4662
classDulwichGitDB(PureRepositoryPathsMixin,PureConfigurationMixin,
4763
PureReferencesMixin,PureSubmoduleDB,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp