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

Commitf4f330f

Browse files
committed
Added store support. Now the basic object IO is implemented, which shall be enough for the first batch of work
1 parent6a10c8a commitf4f330f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎git/db/dulwich/complex.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717
#from git.db.interface import ObjectDBW, ObjectDBR
1818
fromdulwich.repoimportRepoasDulwichRepo
19+
fromdulwich.objectsimportShaFile
1920

2021
fromgit.baseimportOInfo,OStream
21-
fromgit.funimporttype_id_to_type_map
22+
fromgit.funimporttype_id_to_type_map,type_to_type_id_map
2223

2324
fromcStringIOimportStringIO
2425
importos
@@ -57,7 +58,16 @@ def stream(self, binsha):
5758
returnOStream(binsha,type_id_to_type_map[type_id],len(uncomp_data),StringIO(uncomp_data))
5859

5960
#}END object dbr
61+
62+
#{ Object DBW
63+
64+
defstore(self,istream):
65+
obj=ShaFile.from_raw_string(type_to_type_id_map[istream.type],istream.read())
66+
self._dw_repo.object_store.add_object(obj)
67+
istream.binsha=obj.sha().digest()
68+
returnistream
6069

70+
#}END object dbw
6171

6272
classDulwichGitDB(PureRepositoryPathsMixin,PureConfigurationMixin,
6373
PureReferencesMixin,PureSubmoduleDB,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp