OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, repo, binsha, tree=None, author=None, authored_date=None, author_tz_offset=None, committer=None, committed_date=None, committer_tz_offset=None, message=None, parents=None, encoding=None, gpgsig=None) |
def | replace (self, **kwargs) |
def | authored_datetime (self) |
def | committed_datetime (self) |
def | summary (self) |
def | count (self, paths='', **kwargs) |
def | name_rev (self) |
def | iter_items (cls, repo, rev, paths='', **kwargs) |
def | iter_parents (self, paths='', **kwargs) |
def | stats (self) |
def | create_from_tree (cls, repo, tree, message, parent_commits=None, head=False, author=None, committer=None, author_date=None, commit_date=None) |
![]() | |
def | __init__ (self, repo, binsha) |
def | new (cls, repo, id) |
def | new_from_sha (cls, repo, sha1) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __hash__ (self) |
def | __str__ (self) |
def | __repr__ (self) |
def | hexsha (self) |
def | data_stream (self) |
def | stream_data (self, ostream) |
![]() | |
def | list_items (cls, repo, *args, **kwargs) |
def | iter_items (cls, repo, *args, **kwargs) |
![]() | |
def | diff (self, other=Index, paths=None, create_patch=False, **kwargs) |
![]() | |
def | list_traverse (self, *args, **kwargs) |
def | traverse (self, predicate=lambda i, True d, prune=lambda i, False d, depth=-1, branch_first=True, visit_once=True, ignore_self=1, as_edge=False) |
Data Fields | |
tree | |
author | |
authored_date | |
author_tz_offset | |
committer | |
committed_date | |
committer_tz_offset | |
message | |
parents | |
encoding | |
gpgsig | |
![]() | |
repo | |
binsha | |
size | |
Static Public Attributes | |
env_author_date | |
env_committer_date | |
conf_encoding | |
default_encoding | |
type | |
![]() | |
NULL_HEX_SHA | |
NULL_BIN_SHA | |
TYPES | |
type | |
Wraps a git Commit object. This class will act lazily on some of its attributes and will query the value on demand only if it involves calling the git binary.
def __init__ | ( | self, | |
repo, | |||
binsha, | |||
tree = None , |
|||
author = None , |
|||
authored_date = None , |
|||
author_tz_offset = None , |
|||
committer = None , |
|||
committed_date = None , |
|||
committer_tz_offset = None , |
|||
message = None , |
|||
parents = None , |
|||
encoding = None , |
|||
gpgsig = None |
|||
) |
Instantiate a new Commit. All keyword arguments taking None as default will be implicitly set on first query. :param binsha: 20 byte sha1 :param parents: tuple( Commit, ... ) is a tuple of commit ids or actual Commits :param tree: Tree Tree object :param author: Actor is the author Actor object :param authored_date: int_seconds_since_epoch is the authored DateTime - use time.gmtime() to convert it into a different format :param author_tz_offset: int_seconds_west_of_utc is the timezone that the authored_date is in :param committer: Actor is the committer string :param committed_date: int_seconds_since_epoch is the committed DateTime - use time.gmtime() to convert it into a different format :param committer_tz_offset: int_seconds_west_of_utc is the timezone that the committed_date is in :param message: string is the commit message :param encoding: string encoding of the message, defaults to UTF-8 :param parents: List or tuple of Commit objects which are our parent(s) in the commit dependency graph :return: git.Commit :note: Timezone information is in the same format and in the same sign as what time.altzone returns. The sign is inverted compared to git's UTC timezone.
def authored_datetime | ( | self | ) |
def committed_datetime | ( | self | ) |
def count | ( | self, | |
paths = '' , |
|||
** | kwargs | ||
) |
Count the number of commits reachable from this commit :param paths: is an optional path or a list of paths restricting the return value to commits actually containing the paths :param kwargs: Additional options to be passed to git-rev-list. They must not alter the output style of the command, or parsing will yield incorrect results :return: int defining the number of reachable commits
def create_from_tree | ( | cls, | |
repo, | |||
tree, | |||
message, | |||
parent_commits = None , |
|||
head = False , |
|||
author = None , |
|||
committer = None , |
|||
author_date = None , |
|||
commit_date = None |
|||
) |
Commit the given tree, creating a commit object. :param repo: Repo object the commit should be part of :param tree: Tree object or hex or bin sha the tree of the new commit :param message: Commit message. It may be an empty string if no message is provided. It will be converted to a string in any case. :param parent_commits: Optional Commit objects to use as parents for the new commit. If empty list, the commit will have no parents at all and become a root commit. If None , the current head commit will be the parent of the new commit object :param head: If True, the HEAD will be advanced to the new commit automatically. Else the HEAD will remain pointing on the previous commit. This could lead to undesired results when diffing files. :param author: The name of the author, optional. If unset, the repository configuration is used to obtain this value. :param committer: The name of the committer, optional. If unset, the repository configuration is used to obtain this value. :param author_date: The timestamp for the author field :param commit_date: The timestamp for the committer field :return: Commit object representing the new commit :note: Additional information about the committer and Author are taken from the environment or from the git configuration, see git-commit-tree for more information
def iter_items | ( | cls, | |
repo, | |||
rev, | |||
paths = '' , |
|||
** | kwargs | ||
) |
Find all commits matching the given criteria. :param repo: is the Repo :param rev: revision specifier, see git-rev-parse for viable options :param paths: is an optional path or list of paths, if set only Commits that include the path or paths will be considered :param kwargs: optional keyword arguments to git rev-list where ``max_count`` is the maximum number of commits to fetch ``skip`` is the number of commits to skip ``since`` all commits since i.e. '1970-01-01' :return: iterator yielding Commit items
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
def name_rev | ( | self | ) |
:return: String describing the commits hex sha based on the closest Reference. Mostly useful for UI purposes
def replace | ( | self, | |
** | kwargs | ||
) |
Create new commit object from existing commit object. Any values provided as keyword arguments will replace the corresponding attribute in the new object.
def stats | ( | self | ) |
Create a git stat from changes between this commit and its first parent or from all changes done if this is the very first commit. :return: git.Stats
def summary | ( | self | ) |
:return: First line of the commit message
author |
author_tz_offset |
authored_date |
committed_date |
committer |
committer_tz_offset |
|
static |
|
static |
encoding |
|
static |
|
static |
gpgsig |
message |
parents |
tree |
|
static |