Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
8af9416
Moved push and fetch methods partly from remote to the gitcmdobjdb im…
Byron Apr 5, 2011
e77d2d0
Removed all parts of the reference implementation which doesn't requi…
Byron Apr 7, 2011
a12a761
Updated objects to use the ones defined in gitdb as basis. Only the s…
Byron Apr 7, 2011
a80f9af
configparser is now part of gitdb. Test still remains until it was re…
Byron Apr 25, 2011
3fe1a7f
Moved rev_parse code into gitdb, this probably broke pretty much here…
Byron Apr 29, 2011
9fc7b9a
Made most primal imports work, but stopped here as there are many mor…
Byron May 5, 2011
f54546a
Added async submodule, formerly required by gitdb (which is still a v…
Byron May 5, 2011
4177eef
Added all code from gitdb to gitpython. Next is to make it generally …
Byron May 5, 2011
56da804
removed gitdb submodule
Byron May 6, 2011
acf5e6e
replaced all gitdb strings with git
Byron May 6, 2011
7ae36c3
Started to fix imports - tests still have no chance to work as databa…
Byron May 6, 2011
cd26aae
Made repository paths methods a property to be compatible with the ex…
Byron May 10, 2011
0996049
Intermediate commit with quite some progress in order to put all extr…
Byron May 29, 2011
112bb16
Finished moving all repository methods to the respective interfaces a…
Byron May 29, 2011
024adf3
Fixed tests far enough to allow basic repository tests to be applied …
Byron May 30, 2011
1f71ed9
git cmd implementation of repository appears to work, at least this i…
Byron May 30, 2011
4ea529d
Fixed pure python implementation to run the default repository tests
Byron May 30, 2011
09a11c7
Fixed test_git.py
Byron May 30, 2011
2bfc2e9
Fixed test_loose.py
Byron May 30, 2011
c192638
Fixed all remaining python repository tests
Byron May 30, 2011
7fab60c
Fixed all of the object tests, except for the submodule handling whic…
Byron May 30, 2011
6f96058
Fixed remaining tests as good as possible. remote/fetch/pull and subm…
Byron May 30, 2011
4298468
Fixed ref-log related issue in the test suite to assure it will not g…
Byron Jun 1, 2011
cee55cb
Fixed symref tests to work on osx
Byron Jun 1, 2011
5426890
Fixed odb performance tests
Byron Jun 6, 2011
d103257
Fixed packed ODB test, in preparation for separating the type to allo…
Byron Jun 6, 2011
155158e
Added PackedDB test with generalized type to allows other implementat…
Byron Jun 6, 2011
47f14d5
Added loose object writing and reading performance tessts, in pure an…
Byron Jun 6, 2011
79b9dbd
Fixed performance commit object testing
Byron Jun 6, 2011
56a004b
Moved performance commit object test into the respective subfolder to…
Byron Jun 6, 2011
ce79835
Fixed performance pack writing tests. As they are actually depent on …
Byron Jun 6, 2011
a5497c4
Streams returned by git cmd db are now containing all the data right …
Byron Jun 6, 2011
3c12de3
Improved pack writing test to show that the pack generation can be li…
Byron Jun 6, 2011
65f2dd0
Fixed fetch/push/pull implementation. Next up is to integrate the con…
Byron Jun 7, 2011
63a0bbe
Added version_info property to git command
Byron Jun 7, 2011
09517bd
clone and clone_from methods now support the RemoteProgress interface…
Byron Jun 7, 2011
9bf3fde
First run in order to fix the remote handling. Cleaned up interfaces …
Byron Jun 7, 2011
93668b0
Fixed index checkout return code parsing to work with latest git version
Byron Jun 7, 2011
f7ca1ce
Submodule tests are nearly working. Only root module needs more atten…
Byron Jun 7, 2011
82793e5
Submodule tests are fully back and working
Byron Jun 7, 2011
fd5c46e
submodule now doesn't use hardcoded repository implementations anymor…
Byron Jun 7, 2011
410cf1e
The --progress flag will now automatically be used if possible when d…
Byron Jun 7, 2011
4786d19
Making comparisons with non-GitPython objects more tolerant.
May 19, 2011
ecd0fd4
Match any number of leading spaces in config values
jkeating Feb 14, 2011
ba825ea
Greatly improved robustness of config parser - it can now take pretty…
Byron Jun 7, 2011
f6897c7
Added additional opcodes to remote progress to make it compatible to …
Byron Jun 7, 2011
58a930a
Merge branch 'gitdbmerger'
Byron Jun 7, 2011
90e780a
log: non-existing logs no longer throw an exception, but are ignored.…
Byron Jun 7, 2011
24bc841
git.version_info now returns exactly 4 numbers
Byron Jun 7, 2011
7bc59ab
Improved debug assertion to provide proper path on which to run a git…
Byron Jun 7, 2011
4772fe0
pre-emptively moved all reference related tests into own package, to …
Byron Jun 8, 2011
ee9d6b9
util: Added test for iterable list, and implemented __contains__ and …
Byron Jun 8, 2011
74b13c5
symbolic reference handles different types for comparison more gracef…
Byron Jun 8, 2011
095013f
Fixed critical issue that would cause a string to be passed to metho…
Byron Jun 8, 2011
7076f43
Fixed submodule tests to go with either the old or the new version of…
Byron Jun 10, 2011
e00bf79
root submodule: Added parent_commit parameter for convenience. Fixed …
Byron Jun 13, 2011
4bf372d
test_submodule: Will now load everything into memory if smmap is pres…
Byron Jun 13, 2011
963bbd7
Made remote line parsing more stable. On windows it can be that we en…
Byron Jun 13, 2011
5a3b731
Submodule now uses a specialized method to remove its trees to allow …
Byron Jun 13, 2011
6660f61
fixed submodule test to work on windows
Byron Jun 13, 2011
a7ff2f0
Fixed incorrect gitmodules file which used gitdb once again, instead …
Byron Jun 13, 2011
b7ae99c
Fixed implementation of _version_info which didn't work for python 2.…
Byron Jun 13, 2011
87aa78c
refs: added constructor flag to allow refs to be instatiated from any…
Byron Jul 4, 2011
87c7a6f
Basic remote functionality moved to Reference type, as it can in fact…
Byron Jul 4, 2011
3379127
Fetch info can now deal much better with non-default ref specs, see #…
Byron Jul 4, 2011
da12df9
Merge branch 'remote-fixes'
Byron Jul 4, 2011
d37ef77
Added smmap as submodule, package initialization adjusted to assure i…
Byron Jul 5, 2011
21499d9
util: added global sliding memory manager
Byron Jul 5, 2011
f0c05ea
util: pick the type of memory manager based on the python version, to…
Byron Jul 5, 2011
bf638fd
Merge branch 'smmap'
Byron Jul 5, 2011
6507e4e
fixes python 2.6 compatibility issues
Byron Jul 5, 2011
f1a2a4c
Implemented GIT_PYTHON_GIT_EXECUTABLE including test and docs
Byron Jul 5, 2011
2baf8a4
cmd: on windows, we will now fallback to using git.cmd, as the defaul…
Byron Jul 6, 2011
690828c
Added basis for initial dulwich integration. Many basic issues should…
Byron Jul 6, 2011
80aa405
Added auto-skip mixin metacls, some serious brainfuck, if the require…
Byron Jul 7, 2011
d5038eb
removed now superfluous InstanceDecorator, as it was just complicatin…
Byron Jul 7, 2011
4bb5107
Initial version of the DulwichType inheritance. For now, it inherits …
Byron Jul 7, 2011
8b3b222
Added default performance tests - these should help to measure someth…
Byron Jul 7, 2011
b56764b
Fixed submodule related issues once again - is it ever going to end ?
Byron Jul 7, 2011
0906450
Added trivial implementation for info and stream methods - info is ve…
Byron Jul 7, 2011
6a10c8a
Removed cache in PureCompoundDB as it had the tendency to slow things…
Byron Jul 7, 2011
f4f330f
Added store support. Now the basic object IO is implemented, which sh…
Byron Jul 7, 2011
023dc12
Merge branch 'dulwich'
Byron Jul 7, 2011
16a1327
Added basic frame for pygit2 - it just needs some basic methods to be…
Byron Jul 8, 2011
a5a0fa2
Fixed up tests to actually use pygit2. Its worth noting that the perf…
Byron Jul 8, 2011
a848569
Merge branch 'pygit2'
Byron Jul 8, 2011
6e86f8a
Fixed consecutive lines with same blame info not appearing in blame.
devnev Jul 17, 2011
f362d10
Fixed 'Inappropriate ioctl for device' problem on posix systems
swallat Feb 2, 2012
d78a82d
Added test for backslahed/quoted values
ereOn Feb 8, 2012
2b7975c
Fixed quotes and backslashes handling in GitConfigParser
ereOn Feb 8, 2012
3cadd6f
Fixed a case were values containing \\" were not properly escaped
ereOn Feb 8, 2012
cb68f36
Fix fd leak on git cmd.
sugi May 8, 2012
f467834
Ignore signal exception on AutoInterrupt destructor.
sugi May 8, 2012
95878d2
Merge pull request #58 from sugi/cmd-fd-leak-fix
Byron May 8, 2012
91c04a1
Merge pull request #43 from swallat/master
Byron May 17, 2012
cd72d78
Merge pull request #46 from ereOn/master
Byron May 30, 2012
8dc98aa
detect renames in "git diff --raw" output
Jun 15, 2012
3da67f3
add tests for git.diff.Diff._index_from_raw_format()
Jun 16, 2012
864cf1a
Merge pull request #62 from P2000/p2000
Byron Jun 16, 2012
6b5f70c
submodules now use the http protocol to faciliate use in corporate ne…
Jul 23, 2012
c08f435
Make GitPython work on non English systems
FlorianLudwig Jul 24, 2012
011d89d
Merge pull request #68 from FlorianLudwig/master
Byron Jul 24, 2012
0703be6
Add an output_nostrip kwarg to Git.execute
znerol Oct 12, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
git cmd implementation of repository appears to work, at least this i…
…s what the test suggests. Pure python implementation still has some trouble, but this should be very fixable
  • Loading branch information
Byron committed May 30, 2011
commit 1f71ed94578799ee1667ba54b66a369e307f415b
30 changes: 18 additions & 12 deletions git/db/cmd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@

from git.util import (
bin_to_hex,
hex_to_bin
)
from git.db.compat import RepoCompatibilityInterface
from git.util import RemoteProgress
hex_to_bin,
RemoteProgress,
isfile,
join_path,
join,
Actor
)
from git.db.interface import FetchInfo as GitdbFetchInfo
from git.db.interface import PushInfo as GitdbPushInfo
from git.db.interface import HighLevelRepository

from git.util import join_path
from git.util import join
from git.cmd import Git
from git.refs import (
Reference,
RemoteReference,
SymbolicReference,
TagReference
)

from git.objects.commit import Commit
import re
import os
import sys


Expand Down Expand Up @@ -472,6 +473,11 @@ class CmdHighLevelRepository(HighLevelRepository):
re_author_committer_start = re.compile(r'^(author|committer)')
re_tab_full_line = re.compile(r'^\t(.*)$')

#{ Configuration
CommitCls = Commit
GitCls = Git
#} END configuration

def daemon_export():
def _get_daemon_export(self):
filename = join(self.git_dir, self.DAEMON_EXPORT_FILE)
Expand Down Expand Up @@ -588,7 +594,7 @@ def blame(self, rev, file):
sha = info['id']
c = commits.get(sha)
if c is None:
c = Commit( self, hex_to_bin(sha),
c = self.CommitCls( self, hex_to_bin(sha),
author=Actor._from_string(info['author'] + ' ' + info['author_email']),
authored_date=info['author_date'],
committer=Actor._from_string(info['committer'] + ' ' + info['committer_email']),
Expand Down Expand Up @@ -619,9 +625,9 @@ def init(cls, path=None, mkdir=True, **kwargs):
os.makedirs(path, 0755)

# git command automatically chdir into the directory
git = Git(path)
git = cls.GitCls(path)
output = git.init(**kwargs)
return Repo(path)
return cls(path)

@classmethod
def _clone(cls, git, url, path, **kwargs):
Expand Down Expand Up @@ -686,7 +692,7 @@ def clone_from(cls, url, to_path, **kwargs):
"""
:param kwargs: see the ``clone`` method
For more information, see the respective method in the HighLevelRepository"""
return cls._clone(type(self.git)(os.getcwd()), url, to_path, **kwargs)
return cls._clone(cls.GitCls(os.getcwd()), url, to_path, **kwargs)

def archive(self, ostream, treeish=None, prefix=None, **kwargs):
"""For all args see HighLevelRepository interface
Expand Down
13 changes: 1 addition & 12 deletions git/db/cmd/complex.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Module with our own git implementation - it uses the git command"""

from git.db.compat import RepoCompatibilityInterface
from git.db.py.complex import PureGitDB

from base import *


__all__ = ['GitCmdDB', 'CmdCompatibilityGitDB', 'CmdPartialGitDB']
__all__ = ['CmdPartialGitDB']


class CmdPartialGitDB( GitCommandMixin, CmdObjectDBRMixin, CmdTransportMixin,
Expand All @@ -16,12 +14,3 @@ class CmdPartialGitDB( GitCommandMixin, CmdObjectDBRMixin, CmdTransportMixin,
implementations"""
pass


class CmdGitDB(CmdPartialGitDB, PureGitDB):
"""A database which fills in its missing implementation using the pure python
implementation"""
pass


class CmdCompatibilityGitDB(CmdGitDB, RepoCompatibilityInterface):
"""Command git database with the compatabilty interface added for 0.3x code"""
19 changes: 16 additions & 3 deletions git/db/complex.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
"""Module with many useful complex databases with different useful combinations of primary implementations"""

from py.complex import PureGitDB
from py.complex import PurePartialGitDB
from cmd.complex import CmdPartialGitDB
from compat import RepoCompatibilityInterface

__all__ = ['CmdPartialGitDB', 'PureGitDB', 'PureCmdGitDB']
__all__ = ['CmdGitDB', 'PureGitDB', 'CmdCompatibilityGitDB', 'PureCompatibilityGitDB']

class PureCmdGitDB(PureGitDB, CmdPartialGitDB, RepoCompatibilityInterface):
class CmdGitDB(CmdPartialGitDB, PurePartialGitDB):
"""A database which uses primarily the git command implementation, but falls back
to pure python where it is more feasible"""

class CmdCompatibilityGitDB(RepoCompatibilityInterface, CmdGitDB):
"""A database which fills in its missing implementation using the pure python
implementation"""
pass

class PureGitDB(PurePartialGitDB, CmdPartialGitDB):
"""A repository which uses the pure implementation primarily, but falls back
on using the git command for high-level functionality"""

class PureCompatibilityGitDB(RepoCompatibilityInterface, PureGitDB):
"""Repository which uses the pure implementation primarily, but falls back
to the git command implementation. Please note that the CmdGitDB does it
the opposite way around."""
9 changes: 6 additions & 3 deletions git/db/py/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from git.util import (
pool,
join,
isfile,
normpath,
abspath,
dirname,
Expand All @@ -25,7 +26,8 @@
from git.exc import (
BadObject,
AmbiguousObjectName,
InvalidDBRoot
InvalidGitRepositoryError,
NoSuchPathError
)

from async import ChannelThreadTask
Expand Down Expand Up @@ -240,7 +242,7 @@ def _initialize(self, path):
epath = abspath(expandvars(expanduser(path or os.getcwd())))

if not exists(epath):
raise InvalidDBRoot(epath)
raise NoSuchPathError(epath)
#END check file

self._working_tree_dir = None
Expand All @@ -264,7 +266,7 @@ def _initialize(self, path):
# END while curpath

if self._git_path is None:
raise InvalidDBRoot(epath)
raise InvalidGitRepositoryError(epath)
# END path not found

self._bare = self._git_path.endswith(self.repo_dir)
Expand Down Expand Up @@ -351,6 +353,7 @@ class PureConfigurationMixin(ConfigurationMixin):

def __init__(self, *args, **kwargs):
"""Verify prereqs"""
super(PureConfigurationMixin, self).__init__(*args, **kwargs)
assert hasattr(self, 'git_dir')

def _path_at_level(self, level ):
Expand Down
16 changes: 8 additions & 8 deletions git/db/py/complex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of PureGitDB and is released under
# This module is part of PurePartialGitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.db.interface import HighLevelRepository
from base import (
Expand All @@ -12,7 +12,7 @@
PureAlternatesFileMixin,
PureIndexDB,
)

from transport import PureTransportDB
from resolve import PureReferencesMixin

from loose import PureLooseObjectODB
Expand All @@ -35,14 +35,14 @@
)
import os

__all__ = ('PureGitODB', 'PureGitDB', 'PureCompatibilityGitDB')
__all__ = ('PureGitODB', 'PurePartialGitDB', 'PureCompatibilityGitDB')


class PureGitODB(PureRootPathDB, PureObjectDBW, PureCompoundDB):
"""A git-style object-only database, which contains all objects in the 'objects'
subdirectory.
:note: The type needs to be initialized on the ./objects directory to function,
as it deals solely with object lookup. Use a PureGitDB type if you need
as it deals solely with object lookup. Use a PurePartialGitDB type if you need
reference and push support."""
# Configuration
PackDBCls = PurePackedODB
Expand Down Expand Up @@ -103,10 +103,10 @@ def set_ostream(self, ostream):



class PureGitDB(PureGitODB,
class PurePartialGitDB(PureGitODB,
PureRepositoryPathsMixin, PureConfigurationMixin,
PureReferencesMixin, PureSubmoduleDB, PureAlternatesFileMixin,
PureIndexDB,
PureIndexDB, PureTransportDB
# HighLevelRepository Currently not implemented !
):
"""Git like database with support for object lookup as well as reference resolution.
Expand All @@ -119,10 +119,10 @@ class PureGitDB(PureGitODB,
def __init__(self, root_path):
"""Initialize ourselves on the .git directory, or the .git/objects directory."""
PureRepositoryPathsMixin._initialize(self, root_path)
super(PureGitDB, self).__init__(self.objects_dir)
super(PurePartialGitDB, self).__init__(self.objects_dir)



class PureCompatibilityGitDB(PureGitDB, RepoCompatibilityInterface):
class PureCompatibilityGitDB(PurePartialGitDB, RepoCompatibilityInterface):
"""Pure git database with a compatability layer required by 0.3x code"""

3 changes: 1 addition & 2 deletions git/db/py/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ def tags(self):
return self.TagReferenceCls.list_items(self)

def tag(self, name):
return self.tags[name]

return self.TagReferenceCls(self, self.TagReferenceCls.to_full_path(name))

def commit(self, rev=None):
if rev is None:
Expand Down
4 changes: 2 additions & 2 deletions git/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class UnsupportedOperation(ODBError):
"""Thrown if the given operation cannot be supported by the object database"""


class InvalidGitRepositoryError(GitPythonError):
class InvalidGitRepositoryError(InvalidDBRoot):
""" Thrown if the given repository appears to have an invalid format. """


class NoSuchPathError(GitPythonError):
class NoSuchPathError(InvalidDBRoot):
""" Thrown if a path could not be access by the system. """


Expand Down
17 changes: 13 additions & 4 deletions git/objects/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
join_path_native,
stream_copy
)

from git.db.interface import RepositoryPathsMixin
from git.exc import UnsupportedOperation
from git.typ import ObjectType

_assertion_msg_format = "Created object %r whose python type %r disagrees with the acutal git object type %r"
Expand Down Expand Up @@ -173,7 +174,15 @@ def abspath(self):
Absolute path to this index object in the file system ( as opposed to the
.path field which is a path relative to the git repository ).

The returned path will be native to the system and contains '\' on windows. """
assert False, "Only works if repository is not bare - provide this check in an interface"
return join_path_native(dirname(self.odb.root_path()), self.path)
The returned path will be native to the system and contains '\' on windows.
:raise UnsupportedOperation: if underlying odb does not support the required method to obtain a working dir"""
# TODO: Here we suddenly need something better than a plain object database
# which indicates our odb should better be named repo !
root = ''
if isinstance(self.odb, RepositoryPathsMixin):
root = self.odb.working_tree_dir
else:
raise UnsupportedOperation("Cannot provide absolute path from a database without Repository path support")
#END handle odb type
return join_path_native(root, self.path)

2 changes: 1 addition & 1 deletion git/objects/submodule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class UpdateProgress(RemoteProgress):
# IndexObject comes via util module, its a 'hacky' fix thanks to pythons import
# mechanism which cause plenty of trouble of the only reason for packages and
# modules is refactoring - subpackages shoudn't depend on parent packages
class Submodule(Iterable, Traversable, RepoAliasMixin):
class Submodule(util.IndexObject, Iterable, Traversable, RepoAliasMixin):
"""Implements access to a git submodule. They are special in that their sha
represents a commit in the submodule's repository which is to be checked out
at the path of this instance.
Expand Down
2 changes: 1 addition & 1 deletion git/refs/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, repo, path):
Path relative to the .git/ directory pointing to the ref in question, i.e.
refs/heads/master"""
if not path.startswith(self._common_path_default+'/'):
raise ValueError("Cannot instantiate %r from path %s" % ( self.__class__.__name__, path ))
raise ValueError("Cannot instantiate %r from path %s, maybe use %s.to_full_path(name) to safely generate a valid full path from a name" % ( self.__class__.__name__, path, type(self).__name__))
super(Reference, self).__init__(repo, path)


Expand Down
6 changes: 3 additions & 3 deletions git/refs/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def set_commit(self, commit, logmsg = None):
is_invalid_type = commit.object.type != self.CommitCls.type
else:
try:
is_invalid_type = self.repo.resolve(commit).type != self.CommitCls.type
is_invalid_type = self.repo.resolve_object(commit).type != self.CommitCls.type
except BadObject:
raise ValueError("Invalid object: %s" % commit)
#END handle exception
Expand Down Expand Up @@ -293,7 +293,7 @@ def set_reference(self, ref, logmsg = None):
write_value = ref.hexsha
elif isinstance(ref, basestring):
try:
obj = self.repo.resolve(ref+"^{}") # optionally deref tags
obj = self.repo.resolve_object(ref+"^{}") # optionally deref tags
write_value = obj.hexsha
except BadObject:
raise ValueError("Could not extract object from %s" % ref)
Expand Down Expand Up @@ -481,7 +481,7 @@ def _create(cls, repo, path, resolve, reference, force, logmsg=None):
elif isinstance(reference, SymbolicReference):
target = reference.object.hexsha
else:
target = repo.resolve(str(reference))
target = repo.resolve_object(str(reference))
#END handle resoltion
#END need resolution

Expand Down
2 changes: 1 addition & 1 deletion git/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""This module is just to maintain compatibility to git-python 0.3x"""

from git.db.cmd.complex import CmdCompatibilityGitDB
from git.db.complex import CmdCompatibilityGitDB


import warnings
Expand Down
Loading