diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 11:01:12 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 11:01:12 +0200 |
commit | 9ee31065abea645cbc2cf3e54b691d5983a228b2 (patch) | |
tree | 21e38d54e5a69d2983906f6ac30e6322ed9a7ef1 /lib/git/commit.py | |
parent | 8430529e1a9fb28d8586d24ee507a8195c370fa5 (diff) | |
download | gitpython-9ee31065abea645cbc2cf3e54b691d5983a228b2.tar.gz |
Intermediate commit: commit,tree and blob objects now derive from object - test is in place which still fails on purpose. Need to integrate tags which can be objects or just a special form of a ref
Diffstat (limited to 'lib/git/commit.py')
-rw-r--r-- | lib/git/commit.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/git/commit.py b/lib/git/commit.py index 14e1ba68..73fb8e7a 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -8,12 +8,12 @@ import re import time from actor import Actor -from base import LazyMixin from tree import Tree import diff import stats +import base -class Commit(LazyMixin): +class Commit(base.Object): """ Wraps a git Commit object. @@ -23,6 +23,9 @@ class Commit(LazyMixin): # precompiled regex re_actor_epoch = re.compile(r'^.+? (.*) (\d+) .*$') + # object configuration + type = "commit" + def __init__(self, repo, id, tree=None, author=None, authored_date=None, committer=None, committed_date=None, message=None, parents=None): """ @@ -58,10 +61,7 @@ class Commit(LazyMixin): Returns git.Commit """ - LazyMixin.__init__(self) - - self.repo = repo - self.id = id + super(Commit,self).__init__(repo, id, "commit") self.parents = None self.tree = None self.author = author @@ -87,6 +87,7 @@ class Commit(LazyMixin): Called by LazyMixin superclass when the first uninitialized member needs to be set as it is queried. """ + super(Commit, self).__bake__() temp = Commit.find_all(self.repo, self.id, max_count=1)[0] self.parents = temp.parents self.tree = temp.tree |