From 9ee31065abea645cbc2cf3e54b691d5983a228b2 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 11 Oct 2009 11:01:12 +0200 Subject: 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 --- lib/git/commit.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/git/commit.py') 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 -- cgit v1.2.1