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

Commit08457a7

Browse files
committed
Added python 2.4 support: Repo will now use the original GitCmdObjectDB in python 2.4, as the pure python implementation cannot work without memory maps
1 parent3288a24 commit08457a7

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

‎lib/git/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def _init_externals():
2929
fromgit.refsimport*
3030
fromgit.diffimport*
3131
fromgit.excimport*
32+
fromgit.dbimport*
3233
fromgit.cmdimportGit
3334
fromgit.repoimportRepo
3435
fromgit.remoteimport*

‎lib/git/db.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def __init__(self, root_path, git):
3434
self._git=git
3535

3636
definfo(self,sha):
37-
t=self._git.get_object_header(bin_to_hex(sha))
38-
returnOInfo(*t)
37+
hexsha,typename,size=self._git.get_object_header(bin_to_hex(sha))
38+
returnOInfo(hex_to_bin(hexsha),typename,size)
3939

4040
defstream(self,sha):
4141
"""For now, all lookup is done by git itself"""
42-
t=self._git.stream_object_data(bin_to_hex(sha))
43-
returnOStream(*t)
42+
hexsha,typename,size,stream=self._git.stream_object_data(bin_to_hex(sha))
43+
returnOStream(hex_to_bin(hexsha),typename,size,stream)
4444

4545

4646
# { Interface

‎lib/git/ext/gitdb

Submodule gitdb updated from f534e6e to 18152fe

‎lib/git/repo/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
importsys
3535
importre
3636

37+
DefaultDBType=GitDB
38+
ifsys.version_info[1]<5:# python 2.4 compatiblity
39+
DefaultDBType=GitCmdObjectDB
40+
# END handle python 2.4
41+
3742

3843
__all__= ('Repo', )
3944

@@ -66,7 +71,7 @@ class Repo(object):
6671
# represents the configuration level of a configuration file
6772
config_level= ("system","global","repository")
6873

69-
def__init__(self,path=None,odbt=GitDB):
74+
def__init__(self,path=None,odbt=DefaultDBType):
7075
"""Create a new Repo instance
7176
7277
:param path: is the path to either the root git directory or the bare git repo::

‎test/git/test_repo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,3 +545,10 @@ def test_rev_parse(self):
545545

546546
# cannot handle rev-log for now
547547
self.failUnlessRaises(ValueError,rev_parse,"hi@there")
548+
549+
deftest_repo_odbtype(self):
550+
target_type=GitDB
551+
ifsys.version_info[1]<5:
552+
target_type=GitCmdObjectDB
553+
assertisinstance(self.rorepo.odb,target_type)
554+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp