Skip to content

Commit 7ae36c3

Browse files
committed
Started to fix imports - tests still have no chance to work as database changed drastically. Now the actual work begins
1 parent acf5e6e commit 7ae36c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1461
-91
lines changed

doc/source/changes.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@ Changelog
44

55
NEXT
66
====
7+
* ### Class Renames ###
8+
9+
* Renamed **GitCmdObjectDB** to **CmdGitDB** (analogue to **PureCmdDB**)
10+
711
* ### Interface Changes ###
12+
813
* SymbolicReference
14+
915
* object_binsha property added
10-
* Blob Type
11-
* Added mode constants to ease the manual creation of blobs
16+
17+
* Blob Type
18+
19+
* Added mode constants to ease the manual creation of blobs
1220

1321
* ### Module Changes ###
22+
1423
* Removed rev_parse function from git.repo.fun - the respective functionality is available only through the repository's rev_parse method, which might in turn translate to any implementation.
1524

1625
0.3.1 Beta 2

git/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def _init_externals():
3737
from git.exc import *
3838
from git.db import *
3939
from git.cmd import Git
40-
from git.repo import Repo
4140
from git.remote import *
4241
from git.index import *
42+
from git.repo import Repo
4343
from git.util import (
4444
LockFile,
4545
BlockingLockFile,

git/db/cmd/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11

2+
from complex import *

git/db/cmd/git.py renamed to git/db/cmd/complex.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Module with our own git implementation - it uses the git command"""
2-
from exc import (
2+
from git.exc import (
33
GitCommandError,
44
BadObject
5-
)
5+
)
66

77
from git.base import (
88
OInfo,
@@ -13,10 +13,7 @@
1313
bin_to_hex,
1414
hex_to_bin
1515
)
16-
from git.db.py import (
17-
PureGitDB,
18-
PureLooseObjectODB
19-
)
16+
from git.db.py.loose import PureLooseObjectODB
2017
from git.util import RemoteProgress
2118
from git.db.py.base import TransportDB
2219
from git.db.interface import FetchInfo as GitdbFetchInfo
@@ -25,18 +22,18 @@
2522
from git.util import join_path
2623
from git.util import join
2724

28-
from refs import (
29-
Reference,
30-
RemoteReference,
31-
SymbolicReference,
32-
TagReference
33-
)
25+
from git.refs import (
26+
Reference,
27+
RemoteReference,
28+
SymbolicReference,
29+
TagReference
30+
)
3431

3532
import re
3633
import sys
3734

3835

39-
__all__ = ('GitCmdObjectDB', 'PureGitDB', 'RemoteProgress' )
36+
__all__ = ('CmdGitDB', 'RemoteProgress' )
4037

4138

4239
class PushInfo(GitdbPushInfo):
@@ -269,7 +266,7 @@ def _from_line(cls, repo, line, fetch_line):
269266
return cls(remote_local_ref, flags, note, old_commit_binsha)
270267

271268

272-
class GitCmdObjectDB(PureLooseObjectODB, TransportDB):
269+
class CmdGitDB(PureLooseObjectODB, TransportDB):
273270
"""A database representing the default git object store, which includes loose
274271
objects, pack files and an alternates file
275272
@@ -279,7 +276,7 @@ class GitCmdObjectDB(PureLooseObjectODB, TransportDB):
279276
"""
280277
def __init__(self, root_path, git):
281278
"""Initialize this instance with the root and a git command"""
282-
super(GitCmdObjectDB, self).__init__(root_path)
279+
super(CmdGitDB, self).__init__(root_path)
283280
self._git = git
284281

285282
@classmethod

git/db/py/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,4 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55

6-
from base import *
7-
from loose import *
8-
from mem import *
9-
from pack import *
10-
from git import *
11-
from ref import *
12-
from resolve import *
13-
from transport import *
6+
from complex import *

git/db/py/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55
"""Contains basic implementations for the interface building blocks"""
6-
76
from git.db.interface import *
87

98
from git.util import (
File renamed without changes.

git/db/py/mem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55
"""Contains the MemoryDatabase implementation"""
6-
from loose import PureLooseObjectODB
76
from base import (
87
PureObjectDBR,
98
PureObjectDBW
109
)
11-
10+
from loose import PureLooseObjectODB
1211
from git.base import (
1312
OStream,
1413
IStream,

git/db/py/ref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _update_dbs_from_ref_file(self):
3131
dbcls = self.ObjectDBCls
3232
if dbcls is None:
3333
# late import
34-
from git import PureGitODB
34+
from complex import PureGitODB # TODO: This should be a configurable for flexibility
3535
dbcls = PureGitODB
3636
# END get db type
3737

git/db/py/resolve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
from git.db.interface import ReferencesMixin
55
from git.exc import BadObject
6-
from git.ref import SymbolicReference
7-
from git.object.base import Object
6+
from git.refs import SymbolicReference
7+
from git.objects.base import Object
88
from git.util import (
99
join,
1010
isdir,

git/index/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
)
6464

6565
from git.base import IStream
66-
from git.db.py import PureMemoryDB
66+
from git.db.py.mem import PureMemoryDB
6767
from git.util import to_bin_sha
6868
from itertools import izip
6969

git/objects/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
__all__ = ('Commit', )
3737

38-
class Commit(GitDB_Commit, Diffable, Iterable, RepoAliasMixin, base.Object, Traversable, Serializable):
38+
class Commit(Diffable, Iterable, RepoAliasMixin, base.Object, Traversable, Serializable):
3939
"""Wraps a git Commit object.
4040
4141
This class will act lazily on some of its attributes and will query the

git/objects/submodule/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from git.util import RepoAliasMixin
2-
from git.object.submodule import Submodule as GitDB_Submodule
32
import util
43
from util import (
54
mkhead,
@@ -55,7 +54,7 @@ class UpdateProgress(RemoteProgress):
5554
# IndexObject comes via util module, its a 'hacky' fix thanks to pythons import
5655
# mechanism which cause plenty of trouble of the only reason for packages and
5756
# modules is refactoring - subpackages shoudn't depend on parent packages
58-
class Submodule(GitDB_Submodule, Iterable, Traversable, RepoAliasMixin):
57+
class Submodule(Iterable, Traversable, RepoAliasMixin):
5958
"""Implements access to a git submodule. They are special in that their sha
6059
represents a commit in the submodule's repository which is to be checked out
6160
at the path of this instance.

git/objects/tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from git.typ import ObjectType
99
from base import IndexObject
1010
from blob import Blob
11-
from submodule import Submodule
11+
from submodule.base import Submodule
1212

1313
from fun import (
1414
tree_entries_from_data,

0 commit comments

Comments
 (0)