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

Commit690828c

Browse files
committed
Added basis for initial dulwich integration. Many basic issues should surface while integrating this
1 parent2baf8a4 commit690828c

File tree

6 files changed

+52
-2
lines changed

6 files changed

+52
-2
lines changed

‎git/db/dulwich/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Dulwich module initialization"""
2+
3+
definit_dulwich():
4+
""":raise ImportError: if dulwich is not present"""
5+
try:
6+
importdulwich
7+
exceptImportError:
8+
raiseImportError("Could not find 'dulwich' in the PYTHONPATH - dulwich functionality is not available")
9+
#END handle dulwich import
10+
11+
12+
13+
init_dulwich()

‎git/db/dulwich/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Module with some basic database implementations"""
2+
3+
4+
__all__= []
5+
6+

‎git/test/db/dulwich/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
2+
#
3+
# This module is part of GitDB and is released under
4+
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php

‎git/test/db/dulwich/test_base.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
2+
#
3+
# This module is part of GitDB and is released under
4+
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
5+
fromgit.test.db.baseimportRepoBase
6+
fromgit.db.compleximportPureCompatibilityGitDB
7+
8+
try:
9+
importgit.db.dulwich# import test
10+
11+
classTestPyDBBase(RepoBase):
12+
13+
RepoCls=PureCompatibilityGitDB
14+
15+
#def test_basics(self):
16+
#pass
17+
18+
exceptImportError:
19+
del(RepoBase)
20+
importwarnings
21+
warnings.warn("Skipped all dulwich tests as they are not in the path")
22+
#END handle import

‎git/test/db/lib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def setUpAll(cls):
7070
each test type has its own repository
7171
"""
7272
ifcls.needs_ro_repo:
73-
assertcls.RepoClsisnotNone,"RepoCls class member must be set"
73+
ifclsisnotTestDBBase:
74+
assertcls.RepoClsisnotNone,"RepoCls class member must be set in %s"%cls
7475
cls.rorepo=cls.RepoCls(rorepo_dir())
7576
#END handle rorepo
7677

‎git/test/lib/helper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ def __new__(metacls, name, bases, clsdict):
207207
new_type=super(GlobalsItemDeletorMetaCls,metacls).__new__(metacls,name,bases,clsdict)
208208
ifname!=metacls.ModuleToDelete:
209209
mod=__import__(new_type.__module__,globals(),locals(),new_type.__module__)
210-
delattr(mod,metacls.ModuleToDelete)
210+
try:
211+
delattr(mod,metacls.ModuleToDelete)
212+
exceptAttributeError:
213+
pass
214+
#END skip case that people import our base without actually using it
211215
#END handle deletion
212216
returnnew_type
213217

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp