Repo that stores refs, objects, and named files in memory.

MemoryRepos are always bare: they have no working tree and no index, since those have a stronger dependency on the filesystem.

Method __init__ Open a repository.
Method set_description Set the description for this repository.
Method get_description Retrieve the description for this repository.
Method get_named_file Get a file from the control dir with a specific name.
Method open_index Fail to open index for this repo, since it is bare.
Method get_config Retrieve the config object.
Class Method init_bare Create a new bare repository in memory.
Method _append_reflog Undocumented
Method _determine_file_mode Probe the file-system to determine whether permissions can be trusted.
Method _put_named_file Write a file to the control dir with the given name and contents.

Inherited from BaseRepo:

Instance Variable object_store Dictionary-like object for accessing the objects
Instance Variable refs Dictionary-like object with the refs in this repository
Method fetch Fetch objects into another repository.
Method fetch_pack_data Fetch the pack data required for a set of revisions.
Method fetch_objects Fetch the missing objects required for a set of revisions.
Method get_graph_walker Retrieve a graph walker.
Method get_refs Get dictionary with all refs.
Method head Return the SHA1 pointed at by HEAD.
Method get_object Retrieve the object with the specified SHA.
Method get_parents Retrieve the parents of a specific commit.
Method get_config_stack Return a config stack for this repository.
Method get_shallow Get the set of shallow commits.
Method update_shallow Update the list of shallow objects.
Method get_peeled Get the peeled value of a ref.
Method get_walker Obtain a walker for this repository.
Method __getitem__ Retrieve a Git object by SHA1 or ref.
Method __contains__ Check if a specific Git object or ref is present.
Method __setitem__ Set a ref.
Method __delitem__ Remove a ref.
Method do_commit Create a new commit.
Method _init_files Initialize a default set of named files.
Method _get_object Undocumented
Method _get_user_identity Determine the identity to use for new commits.
Method _add_graftpoints Add or modify graftpoints
Method _remove_graftpoints Remove graftpoints
def __init__(self):

Open a repository.

This shouldn't be called directly, but rather through one of the base classes, such as MemoryRepo or Repo.

Parametersobject_storeObject store to use
refsRefs container to use
def _append_reflog(self, *args):
Undocumented
def set_description(self, description):
Set the description for this repository.
ParametersdescriptionText to set as description for this repository.
def get_description(self):
Retrieve the description for this repository.
ReturnsString with the description of the repository as set by the user.
def _determine_file_mode(self):
Probe the file-system to determine whether permissions can be trusted.
ReturnsTrue if permissions can be trusted, False otherwise.
def _put_named_file(self, path, contents):
Write a file to the control dir with the given name and contents.
ParameterspathThe path to the file, relative to the control dir.
contentsA string to write to the file.
def get_named_file(self, path):

Get a file from the control dir with a specific name.

Although the filename should be interpreted as a filename relative to the control dir in a disk-baked Repo, the object returned need not be pointing to a file in that location.

ParameterspathThe path to the file, relative to the control dir.
ReturnsAn open file object, or None if the file does not exist.
def open_index(self):
Fail to open index for this repo, since it is bare.
RaisesNoIndexPresentRaised when no index is present
def get_config(self):
Retrieve the config object.
ReturnsConfigFile object.
@classmethod
def init_bare(cls, objects, refs):
Create a new bare repository in memory.
ParametersobjectsObjects for the new repository, as iterable
refsRefs as dictionary, mapping names to object SHA1s
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.