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
Fixed remaining tests as good as possible. remote/fetch/pull and subm…
…odule tests need some more work. Also, the tests need to be reorganized and move closer to their actual location within gitpython. Hence the refs tests go to git.test.refs, etc
  • Loading branch information
Byron committed May 30, 2011
commit 6f960586feccff8c1f2c717765eb0a5e8b9cd6f3
2 changes: 1 addition & 1 deletion git/objects/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from cStringIO import StringIO

from util import parse_date
from time import altzone
from time import altzone, time

import os
import sys
Expand Down
17 changes: 13 additions & 4 deletions git/test/db/cmd/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
from git.test.lib import rorepo_dir
from git.test.db.base import RepoBase

# immport test
from git.db.cmd.base import *
from git.db.cmd.complex import *
from git.util import bin_to_hex
from git.exc import BadObject

from git.db.complex import CmdCompatibilityGitDB

class TestBase(RepoBase):
RepoCls = CmdCompatibilityGitDB

def test_basics(self):
pass
gdb = self.rorepo

# partial to complete - works with everything
hexsha = bin_to_hex(gdb.partial_to_complete_sha_hex("0.1.6"))
assert len(hexsha) == 40

assert bin_to_hex(gdb.partial_to_complete_sha_hex(hexsha[:20])) == hexsha

# fails with BadObject
for invalid_rev in ("0000", "bad/ref", "super bad"):
self.failUnlessRaises(BadObject, gdb.partial_to_complete_sha_hex, invalid_rev)
11 changes: 0 additions & 11 deletions git/test/db/py/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@
from git.test.lib import rorepo_dir
from git.test.db.base import RepoBase

# import test
from git.db.py.base import *
from git.db.py.loose import *
from git.db.py.mem import *
from git.db.py.pack import *
from git.db.py.ref import *
from git.db.py.resolve import *
from git.db.py.submodule import *
from git.db.py.transport import *
from git.db.py.complex import *

from git.db.complex import PureCompatibilityGitDB

class TestPyDBBase(RepoBase):
Expand Down
6 changes: 6 additions & 0 deletions git/test/lib/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ class TestBase(TestCase):
self.failUnlessRaises(...)
"""

@classmethod
def setUpAll(cls):
"""This method is only called to provide the most basic functionality
Subclasses may just override it or implement it differently"""
cls.rorepo = Repo(rorepo_dir())

def _make_file(self, rela_path, data, repo=None):
"""
Create a file at the given path relative to our repository, filled
Expand Down
6 changes: 1 addition & 5 deletions git/test/objects/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
with_rw_repo,
StringProcessAdapter,
)
from git.repo import Repo

class TestObjectBase(TestBase):
"""Provides a default read-only repository in the rorepo member"""

@classmethod
def setUpAll(cls):
cls.rorepo = Repo(rorepo_dir())
pass
6 changes: 3 additions & 3 deletions git/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from git.test.lib import TestBase
from git import *
from git.test.lib import TestBase, fixture_path
import StringIO
from git.config import *
from copy import copy
from ConfigParser import NoSectionError

class TestBase(TestCase):
class TestConfig(TestBase):

def _to_memcache(self, file_path):
fp = open(file_path, "r")
Expand Down
25 changes: 0 additions & 25 deletions git/test/test_db.py

This file was deleted.

11 changes: 9 additions & 2 deletions git/test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from git.test.lib import TestBase
from git import *
from git.test.lib import (
TestBase,
StringProcessAdapter,
fixture,
assert_equal,
assert_true
)

from git.diff import *

class TestDiff(TestBase):

Expand Down
6 changes: 3 additions & 3 deletions git/test/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module with examples from the tutorial section of the docs"""
from lib import *
from git import IStream
from git.db.py import PureLooseObjectODB
from lib import TestBase, fixture_path
from git.base import IStream
from git.db.py.loose import PureLooseObjectODB
from git.util import pool

from cStringIO import StringIO
Expand Down
2 changes: 1 addition & 1 deletion git/test/test_fun.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from git.test.lib import TestBase
from git.test.lib import TestBase, with_rw_repo
from git.objects.fun import (
traverse_tree_recursive,
traverse_trees_recursive,
Expand Down
141 changes: 75 additions & 66 deletions git/test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,89 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

import os, sys
from git.test.lib import TestBase
from git.test.lib import (
TestBase,
patch_object,
raises,
assert_equal,
assert_true,
assert_match,
fixture_path
)
from git import Git, GitCommandError

class TestGit(TestCase):

@classmethod
def setUpAll(cls):
cls.git = Git(cls.rorepo.working_dir)
class TestGit(TestBase):

@classmethod
def setUpAll(cls):
super(TestGit, cls).setUpAll()
cls.git = Git(cls.rorepo.working_dir)

@patch_object(Git, 'execute')
def test_call_process_calls_execute(self, git):
git.return_value = ''
self.git.version()
assert_true(git.called)
assert_equal(git.call_args, ((['git', 'version'],), {}))
@patch_object(Git, 'execute')
def test_call_process_calls_execute(self, git):
git.return_value = ''
self.git.version()
assert_true(git.called)
assert_equal(git.call_args, ((['git', 'version'],), {}))

@raises(GitCommandError)
def test_it_raises_errors(self):
self.git.this_does_not_exist()
@raises(GitCommandError)
def test_it_raises_errors(self):
self.git.this_does_not_exist()


def test_it_transforms_kwargs_into_git_command_arguments(self):
assert_equal(["-s"], self.git.transform_kwargs(**{'s': True}))
assert_equal(["-s5"], self.git.transform_kwargs(**{'s': 5}))
def test_it_transforms_kwargs_into_git_command_arguments(self):
assert_equal(["-s"], self.git.transform_kwargs(**{'s': True}))
assert_equal(["-s5"], self.git.transform_kwargs(**{'s': 5}))

assert_equal(["--max-count"], self.git.transform_kwargs(**{'max_count': True}))
assert_equal(["--max-count=5"], self.git.transform_kwargs(**{'max_count': 5}))
assert_equal(["--max-count"], self.git.transform_kwargs(**{'max_count': True}))
assert_equal(["--max-count=5"], self.git.transform_kwargs(**{'max_count': 5}))

assert_equal(["-s", "-t"], self.git.transform_kwargs(**{'s': True, 't': True}))
assert_equal(["-s", "-t"], self.git.transform_kwargs(**{'s': True, 't': True}))

def test_it_executes_git_to_shell_and_returns_result(self):
assert_match('^git version [\d\.]{2}.*$', self.git.execute(["git","version"]))
def test_it_executes_git_to_shell_and_returns_result(self):
assert_match('^git version [\d\.]{2}.*$', self.git.execute(["git","version"]))

def test_it_accepts_stdin(self):
filename = fixture_path("cat_file_blob")
fh = open(filename, 'r')
assert_equal("70c379b63ffa0795fdbfbc128e5a2818397b7ef8",
self.git.hash_object(istream=fh, stdin=True))
fh.close()
def test_it_accepts_stdin(self):
filename = fixture_path("cat_file_blob")
fh = open(filename, 'r')
assert_equal("70c379b63ffa0795fdbfbc128e5a2818397b7ef8",
self.git.hash_object(istream=fh, stdin=True))
fh.close()

@patch_object(Git, 'execute')
def test_it_ignores_false_kwargs(self, git):
# this_should_not_be_ignored=False implies it *should* be ignored
output = self.git.version(pass_this_kwarg=False)
assert_true("pass_this_kwarg" not in git.call_args[1])
def test_persistent_cat_file_command(self):
# read header only
import subprocess as sp
hexsha = "b2339455342180c7cc1e9bba3e9f181f7baa5167"
g = self.git.cat_file(batch_check=True, istream=sp.PIPE,as_process=True)
g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
obj_info = g.stdout.readline()
# read header + data
g = self.git.cat_file(batch=True, istream=sp.PIPE,as_process=True)
g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
obj_info_two = g.stdout.readline()
assert obj_info == obj_info_two
# read data - have to read it in one large chunk
size = int(obj_info.split()[2])
data = g.stdout.read(size)
terminating_newline = g.stdout.read(1)
# now we should be able to read a new object
g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
assert g.stdout.readline() == obj_info
# same can be achived using the respective command functions
hexsha, typename, size = self.git.get_object_header(hexsha)
hexsha, typename_two, size_two, data = self.git.get_object_data(hexsha)
assert typename == typename_two and size == size_two
@patch_object(Git, 'execute')
def test_it_ignores_false_kwargs(self, git):
# this_should_not_be_ignored=False implies it *should* be ignored
output = self.git.version(pass_this_kwarg=False)
assert_true("pass_this_kwarg" not in git.call_args[1])
def test_persistent_cat_file_command(self):
# read header only
import subprocess as sp
hexsha = "b2339455342180c7cc1e9bba3e9f181f7baa5167"
g = self.git.cat_file(batch_check=True, istream=sp.PIPE,as_process=True)
g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
obj_info = g.stdout.readline()
# read header + data
g = self.git.cat_file(batch=True, istream=sp.PIPE,as_process=True)
g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
obj_info_two = g.stdout.readline()
assert obj_info == obj_info_two
# read data - have to read it in one large chunk
size = int(obj_info.split()[2])
data = g.stdout.read(size)
terminating_newline = g.stdout.read(1)
# now we should be able to read a new object
g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
assert g.stdout.readline() == obj_info
# same can be achived using the respective command functions
hexsha, typename, size = self.git.get_object_header(hexsha)
hexsha, typename_two, size_two, data = self.git.get_object_data(hexsha)
assert typename == typename_two and size == size_two
48 changes: 46 additions & 2 deletions git/test/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,53 @@
module, by importing using from x import *"""

# perform the actual imports
import os

from nose import SkipTest
from git import *

def import_all(topdir, topmodule='git', skip = "test"):
base = os.path.basename
join = os.path.join
init_script = '__init__.py'
prev_cwd = os.getcwd()
try:
os.chdir(os.path.dirname(topdir))
for root, dirs, files in os.walk(base(topdir)):
if init_script not in files:
del(dirs[:])
continue
#END ignore non-packages

if skip in root:
continue
#END handle ignores

for relafile in files:
if not relafile.endswith('.py'):
continue
if relafile == init_script:
continue
module_path = join(root, os.path.splitext(relafile)[0]).replace("/", ".").replace("\\", ".")

m = __import__(module_path, globals(), locals(), [""])
try:
attrlist = m.__all__
for attr in attrlist:
assert hasattr(m, attr), "Invalid item in %s.__all__: %s" % (module_path, attr)
#END veriy
except AttributeError:
pass
# END try each listed attribute
#END for each file in dir
#END for each item
finally:
os.chdir(prev_cwd)
#END handle previous currentdir



class TestDummy(object):
def test_base(self):
raise SkipTest("todo")
dn = os.path.dirname
# NOTE: i don't think this is working, as the __all__ variable is not used in this case
import_all(dn(dn(__file__)))
8 changes: 7 additions & 1 deletion git/test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from git.test.lib import TestBase
from git.test.lib import (
TestBase,
with_rw_repo,
fixture_path,
fixture
)
from git import *
import inspect
import os
import sys
import tempfile
import glob
import shutil
import time
from stat import *

class TestIndex(TestBase):
Expand Down
Loading