diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 22:49:52 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 22:59:15 +0200 |
commit | 0b3ecf2dcace76b65765ddf1901504b0b4861b08 (patch) | |
tree | 04fad7e2ac3f85afe7fe28a5e6907b8a88abfaba /lib/git/objects/commit.py | |
parent | 11b1f6edc164e2084e3ff034d3b65306c461a0be (diff) | |
download | gitpython-0b3ecf2dcace76b65765ddf1901504b0b4861b08.tar.gz |
commit.count: is an instance method now
repo: added head , tag and iter_trees methods for completeness
changes: headlines now sorted chronologically
Diffstat (limited to 'lib/git/objects/commit.py')
-rw-r--r-- | lib/git/objects/commit.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/git/objects/commit.py b/lib/git/objects/commit.py index 181cbb52..a68a7bed 100644 --- a/lib/git/objects/commit.py +++ b/lib/git/objects/commit.py @@ -101,16 +101,9 @@ class Commit(base.Object, Iterable, diff.Diffable): """ return self.message.split('\n', 1)[0] - @classmethod - def count(cls, repo, rev, paths='', **kwargs): + def count(self, paths='', **kwargs): """ - Count the number of commits reachable from this revision - - ``repo`` - is the Repo - - ``rev`` - revision specifier, see git-rev-parse for viable options + Count the number of commits reachable from this commit ``paths`` is an optinal path or a list of paths restricting the return value @@ -121,7 +114,7 @@ class Commit(base.Object, Iterable, diff.Diffable): Returns int """ - return len(repo.git.rev_list(rev, '--', paths, **kwargs).strip().splitlines()) + return len(self.repo.git.rev_list(self.id, '--', paths, **kwargs).strip().splitlines()) @classmethod def iter_items(cls, repo, rev, paths='', **kwargs): |