class documentation
class Tree(ShaFile):
A Git tree object
Class Method | from |
Open a SHA file from disk. |
Method | __contains__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Don't call this directly |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __setitem__ |
Set a tree entry by name. |
Method | add |
Add an entry to the tree. |
Method | as |
Return a string representing this object, fit for display. |
Method | check |
Check this object for internal consistency. |
Method | items |
Return the sorted entries in this tree. |
Method | iteritems |
Iterate over entries. |
Method | lookup |
Look up an object in a Git tree. |
Class Variable | __slots__ |
Undocumented |
Class Variable | type |
Undocumented |
Class Variable | type |
Undocumented |
Method | _deserialize |
Grab the entries in the tree |
Method | _serialize |
Undocumented |
Instance Variable | _entries |
Undocumented |
Instance Variable | _needs |
Undocumented |
Inherited from ShaFile
:
Class Method | from |
Get the contents of a SHA file on disk. |
Class Method | from |
Create a ShaFile from a string. |
Static Method | from |
Creates an object of the indicated type from the raw chunks given. |
Static Method | from |
Creates an object of the indicated type from the raw string given. |
Method | __bytes__ |
Return raw string serialization of this object. |
Method | __eq__ |
Return True if the SHAs of the two objects match. |
Method | __hash__ |
Return unique hash for this object. |
Method | __le__ |
Check whether SHA of this object is less than or equal to the other. |
Method | __lt__ |
Return whether SHA of this object is less than the other. |
Method | __ne__ |
Check whether this object does not match the other. |
Method | __repr__ |
Undocumented |
Method | as |
Return string representing the object in the experimental format. |
Method | as |
Return chunks representing the object in the experimental format. |
Method | as |
Return chunks with serialization of the object. |
Method | as |
Return raw string with serialization of the object. |
Method | copy |
Create a new copy of this SHA1 object from its raw string |
Method | raw |
Returns the length of the raw string of this object. |
Method | set |
Set the contents of this object from a list of chunks. |
Method | set |
Set the contents of this object from a serialized string. |
Method | sha |
The SHA1 object that is the name of this object. |
Property | id |
The hex SHA of this object. |
Class Method | _is |
Undocumented |
Class Method | _parse |
Undocumented |
Static Method | _parse |
Parse a legacy object, creating it but not reading the file. |
Static Method | _parse |
Parse a new style object, creating it but not reading the file. |
Method | _check |
Check that the object has a given member variable. |
Method | _header |
Undocumented |
Method | _parse |
Parse a legacy object, setting the raw string. |
Method | _parse |
Parse a new style object, setting self._text. |
Instance Variable | _chunked |
Undocumented |
Instance Variable | _sha |
Undocumented |
Set a tree entry by name.
Parameters | |
name | The name of the entry, as a string. |
value | A tuple of (mode, hexsha), where mode is the mode of the entry as an integral type and hexsha is the hex SHA of the entry as a string. |
Add an entry to the tree.
Parameters | |
name | The name of the entry, as a string. |
mode | The mode of the entry as an integral type. Not all possible modes are supported by git; see check() for details. |
hexsha | The hex SHA of the entry as a string. |
overrides
dulwich.objects.ShaFile.as_pretty_string
Return a string representing this object, fit for display.
overrides
dulwich.objects.ShaFile.check
Check this object for internal consistency.
Raises | |
ObjectFormatException | if the object is malformed in some way |
Iterate over entries.
Returns: Iterator over (name, mode, sha) tuples
Parameters | |
name | If True, iterate in name order instead of tree order. |
Look up an object in a Git tree.
Returns: A tuple of (mode, SHA) of the resulting path.
Parameters | |
lookup | Callback for retrieving object by SHA1 |
path | Path to lookup |