|
OpenQuizz
Une application de gestion des contenus pédagogiques
|
Functions | |
| def | hook_path (name, git_dir) |
| def | run_commit_hook (name, index, *args) |
| def | stat_mode_to_index_mode (mode) |
| def | write_cache (entries, stream, extension_data=None, ShaStreamCls=IndexFileSHA1Writer) |
| def | read_header (stream) |
| def | entry_key (*entry) |
| def | read_cache (stream) |
| def | write_tree_from_cache (entries, odb, sl, si=0) |
| def | aggressive_tree_merge (odb, tree_shas) |
Variables | |
| S_IFGITLINK | |
| CE_NAMEMASK_INV | |
| def git.index.fun.aggressive_tree_merge | ( | odb, | |
| tree_shas | |||
| ) |
:return: list of BaseIndexEntries representing the aggressive merge of the given
trees. All valid entries are on stage 0, whereas the conflicting ones are left
on stage 1, 2 or 3, whereas stage 1 corresponds to the common ancestor tree,
2 to our tree and 3 to 'their' tree.
:param tree_shas: 1, 2 or 3 trees as identified by their binary 20 byte shas
If 1 or two, the entries will effectively correspond to the last given tree
If 3 are given, a 3 way merge is performed
| def git.index.fun.entry_key | ( | * | entry | ) |
:return: Key suitable to be used for the index.entries dictionary :param entry: One instance of type BaseIndexEntry or the path and the stage
| def git.index.fun.hook_path | ( | name, | |
| git_dir | |||
| ) |
:return: path to the given named hook in the given git repository directory
| def git.index.fun.read_cache | ( | stream | ) |
Read a cache file from the given stream :return: tuple(version, entries_dict, extension_data, content_sha) * version is the integer version number * entries dict is a dictionary which maps IndexEntry instances to a path at a stage * extension_data is '' or 4 bytes of type + 4 bytes of size + size bytes * content_sha is a 20 byte sha on all cache file contents
| def git.index.fun.read_header | ( | stream | ) |
Return tuple(version_long, num_entries) from the given stream
| def git.index.fun.run_commit_hook | ( | name, | |
| index, | |||
| * | args | ||
| ) |
Run the commit hook of the given name. Silently ignores hooks that do not exist. :param name: name of hook, like 'pre-commit' :param index: IndexFile instance :param args: arguments passed to hook file :raises HookExecutionError:
| def git.index.fun.stat_mode_to_index_mode | ( | mode | ) |
Convert the given mode from a stat call to the corresponding index mode and return it
| def git.index.fun.write_cache | ( | entries, | |
| stream, | |||
extension_data = None, |
|||
ShaStreamCls = IndexFileSHA1Writer |
|||
| ) |
Write the cache represented by entries to a stream
:param entries: **sorted** list of entries
:param stream: stream to wrap into the AdapterStreamCls - it is used for
final output.
:param ShaStreamCls: Type to use when writing to the stream. It produces a sha
while writing to it, before the data is passed on to the wrapped stream
:param extension_data: any kind of data to write as a trailer, it must begin
a 4 byte identifier, followed by its size ( 4 bytes )
| def git.index.fun.write_tree_from_cache | ( | entries, | |
| odb, | |||
| sl, | |||
si = 0 |
|||
| ) |
Create a tree from the given sorted list of entries and put the respective
trees into the given object database
:param entries: **sorted** list of IndexEntries
:param odb: object database to store the trees in
:param si: start index at which we should start creating subtrees
:param sl: slice indicating the range we should process on the entries list
:return: tuple(binsha, list(tree_entry, ...)) a tuple of a sha and a list of
tree entries being a tuple of hexsha, mode, name
| CE_NAMEMASK_INV |
| S_IFGITLINK |