From 4a534eba97db3c2cfb2926368756fd633d25c056 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 20 Oct 2009 12:24:47 +0200 Subject: Added frame for index implementation and testing --- TODO | 2 ++ lib/git/__init__.py | 2 +- lib/git/index.py | 17 +++++++++++++++++ test/git/test_index.py | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lib/git/index.py create mode 100644 test/git/test_index.py diff --git a/TODO b/TODO index 0915806d..b6e8d10c 100644 --- a/TODO +++ b/TODO @@ -57,6 +57,8 @@ Tree * Should return submodules during iteration ( identifies as commit ) * Work through test and check for test-case cleanup and completeness ( what about testing whether it raises on invalid input ? ). See 6dc7799d44e1e5b9b77fd19b47309df69ec01a99 + - Also assure that the test-case setup is a bit more consistent ( Derive from TestCase, possibly + make repo a class member instead of an instance member * Derive from Iterable, simple pipe it through to Commit objects and iterate using commit.tree. diff --git a/lib/git/__init__.py b/lib/git/__init__.py index 75ce887b..e3043dc9 100644 --- a/lib/git/__init__.py +++ b/lib/git/__init__.py @@ -19,7 +19,7 @@ from git.cmd import Git from git.repo import Repo from git.stats import Stats from git.remote import Remote - +from git.index import * __all__ = [ name for name, obj in locals().items() if not (name.startswith('_') or inspect.ismodule(obj)) ] diff --git a/lib/git/index.py b/lib/git/index.py new file mode 100644 index 00000000..1c531712 --- /dev/null +++ b/lib/git/index.py @@ -0,0 +1,17 @@ +# index.py +# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# +# This module is part of GitPython and is released under +# the BSD License: http://www.opensource.org/licenses/bsd-license.php +""" +Module containing Index implementation, allowing to perform all kinds of index +manipulations such as querying and merging. +""" + +class Index(object): + """ + Implements an Index that can be manipulated using a native implementation in + order to safe git command function calls wherever possible. + + It provides custom merging facilities and to create custom commits. + """ diff --git a/test/git/test_index.py b/test/git/test_index.py new file mode 100644 index 00000000..f58405d2 --- /dev/null +++ b/test/git/test_index.py @@ -0,0 +1,17 @@ +# test_index.py +# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# +# This module is part of GitPython and is released under +# the BSD License: http://www.opensource.org/licenses/bsd-license.php + +from test.testlib import * +from git import * + +class TestTree(TestCase): + + @classmethod + def setUpAll(cls): + cls.repo = Repo(GIT_REPO) + + def test_base(self): + self.fail("TODO") -- cgit v1.2.3