Defines an interface to create objects in the database
def set_ostream |
( |
|
self, |
|
|
|
stream |
|
) |
| |
Adjusts the stream to which all data should be sent when storing new objects
:param stream: if not None, the stream to use, if None the default stream
will be used.
:return: previously installed stream, or None if there was no override
:raise TypeError: if the stream doesn't have the supported functionality
Reimplemented in LooseObjectDB, MemoryDB, and GitDB.
def store |
( |
|
self, |
|
|
|
istream |
|
) |
| |
Create a new object in the database
:return: the input istream object with its sha set to its corresponding value
:param istream: IStream compatible instance. If its sha is already set
to a value, the object will just be stored in the our database format,
in which case the input stream is expected to be in object format ( header + contents ).
:raise IOError: if data could not be written
Reimplemented in LooseObjectDB, GitDB, and MemoryDB.