summaryrefslogtreecommitdiff
path: root/lib/git/objects
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-29 18:28:31 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-29 18:28:31 +0200
commit160081b9a7ca191afbec077c4bf970cfd9070d2c (patch)
tree5e47a446919fbdd5f7a9a82b6944dc2f1b32bdba /lib/git/objects
parent6917ae4ce9eaa0f5ea91592988c1ea830626ac3a (diff)
downloadgitpython-160081b9a7ca191afbec077c4bf970cfd9070d2c.tar.gz
Updated and fixed sphinx API docs, which included one quick skim-through
Diffstat (limited to 'lib/git/objects')
-rw-r--r--lib/git/objects/blob.py3
-rw-r--r--lib/git/objects/commit.py2
-rw-r--r--lib/git/objects/tree.py14
-rw-r--r--lib/git/objects/utils.py8
4 files changed, 15 insertions, 12 deletions
diff --git a/lib/git/objects/blob.py b/lib/git/objects/blob.py
index 8263e9a2..d0ef54c7 100644
--- a/lib/git/objects/blob.py
+++ b/lib/git/objects/blob.py
@@ -28,7 +28,8 @@ class Blob(base.IndexObject):
@property
def mime_type(self):
- """ :return:String describing the mime type of this file (based on the filename)
+ """
+ :return: String describing the mime type of this file (based on the filename)
:note: Defaults to 'text/plain' in case the actual file type is unknown. """
guesses = None
if self.path:
diff --git a/lib/git/objects/commit.py b/lib/git/objects/commit.py
index f88bb0e8..11263e07 100644
--- a/lib/git/objects/commit.py
+++ b/lib/git/objects/commit.py
@@ -182,11 +182,11 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
def iter_parents(self, paths='', **kwargs):
"""Iterate _all_ parents of this commit.
+
:param paths:
Optional path or list of paths limiting the Commits to those that
contain at least one of the paths
:param kwargs: All arguments allowed by git-rev-list
-
:return: Iterator yielding Commit objects which are parents of self """
# skip ourselves
skip = kwargs.get("skip", 1)
diff --git a/lib/git/objects/tree.py b/lib/git/objects/tree.py
index 056d3da9..64725128 100644
--- a/lib/git/objects/tree.py
+++ b/lib/git/objects/tree.py
@@ -23,8 +23,8 @@ from gitdb.util import (
__all__ = ("TreeModifier", "Tree")
class TreeModifier(object):
- """A utility class providing methods to alter the underlying cache in a list-like
- fashion.
+ """A utility class providing methods to alter the underlying cache in a list-like fashion.
+
Once all adjustments are complete, the _cache, which really is a refernce to
the cache of a tree, will be sorted. Assuring it will be in a serializable state"""
__slots__ = '_cache'
@@ -57,6 +57,7 @@ class TreeModifier(object):
exists, nothing will be done, but a ValueError will be raised if the
sha and mode of the existing item do not match the one you add, unless
force is True
+
:param sha: The 20 or 40 byte sha of the item to add
:param mode: int representing the stat compatible mode of the item
:param force: If True, an item with your name and information will overwrite
@@ -203,10 +204,11 @@ class Tree(IndexObject, diff.Diffable, utils.Traversable, utils.Serializable):
@property
def cache(self):
- """:return: An object allowing to modify the internal cache. This can be used
- to change the tree's contents. When done, make sure you call ``set_done``
- on the tree modifier, or serialization behaviour will be incorrect.
- See the ``TreeModifier`` for more information on how to alter the cache"""
+ """
+ :return: An object allowing to modify the internal cache. This can be used
+ to change the tree's contents. When done, make sure you call ``set_done``
+ on the tree modifier, or serialization behaviour will be incorrect.
+ See the ``TreeModifier`` for more information on how to alter the cache"""
return TreeModifier(self._cache)
def traverse( self, predicate = lambda i,d: True,
diff --git a/lib/git/objects/utils.py b/lib/git/objects/utils.py
index c0ddd6e6..fd648f09 100644
--- a/lib/git/objects/utils.py
+++ b/lib/git/objects/utils.py
@@ -103,15 +103,15 @@ def verify_utctz(offset):
def parse_date(string_date):
"""
Parse the given date as one of the following
+
* Git internal format: timestamp offset
* RFC 2822: Thu, 07 Apr 2005 22:13:13 +0200.
* ISO 8601 2005-04-07T22:13:13
- The T can be a space as well
+ The T can be a space as well
- :return: Tuple(int(timestamp), int(offset), both in seconds since epoch
+ :return: Tuple(int(timestamp), int(offset)), both in seconds since epoch
:raise ValueError: If the format could not be understood
- :note: Date can also be YYYY.MM.DD, MM/DD/YYYY and DD.MM.YYYY
- """
+ :note: Date can also be YYYY.MM.DD, MM/DD/YYYY and DD.MM.YYYY"""
# git time
try:
if string_date.count(' ') == 1 and string_date.rfind(':') == -1: