reviewboard.diffviewer.models.diffcommit¶
DiffCommit model definition.
-
class
DiffCommit(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelA representation of a commit from a version control system.
A DiffSet on a Review Request that represents a commit history will have one or more DiffCommits. Each DiffCommit will have one or more associated FileDiffs (which also belong to the parent DiffSet).
The information stored herein is intended to fully represent the state of a single commit in that history. The series of DiffCommits can be used to re-create the original series of commits posted for review.
-
filename[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
diffset[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parentis aForwardManyToOneDescriptorinstance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
committer_name[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
committer_email[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
committer_date_utc[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
committer_date_offset[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
commit_message[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
commit_id[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
parent_id[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
extra_data[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
The author’s name and e-mail address.
This is formatted as
author_name <author_email>.
The author date in its original timezone.
-
committer[source]¶ The committer’s name and e-mail address (if applicable).
This will be formatted as
committer_name <committer_email>if bothcommitter_nameandcommitter_emailare set. Otherwise, it be whichever is defined. If neither are defined, this will beNone.
-
committer_date[source]¶ The committer date in its original timezone.
If the commit has no committer, this will be
None.
-
serialize()[source]¶ Serialize to a dictionary.
Returns: A dictionary representing this commit. Return type: dict
-
get_total_line_counts()[source]¶ Return the total line counts of all child FileDiffs.
Returns: A dictionary with the following keys: raw_insert_countraw_delete_countinsert_countdelete_countreplace_countequal_counttotal_line_count
Each entry maps to the sum of that line count type for all child
FileDiffs.Return type: dict
-
__unicode__()[source]¶ Return a human-readable representation of the commit.
Returns: The commit ID and its summary (if available). Return type: unicode
-
diffset_id[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
files[source]¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-