reviewboard.diffviewer.models.diffcommit¶
DiffCommit model definition.
- class SerializedDiffCommit¶
Bases:
TypedDict
Serialized version of a DiffCommit.
New in version 7.0.
- id: int¶
The PK of the
DiffCommit
object.
- __annotations__ = {'author_name': ForwardRef('str', module='reviewboard.diffviewer.models.diffcommit'), 'commit_id': ForwardRef('str', module='reviewboard.diffviewer.models.diffcommit'), 'commit_message': ForwardRef('str', module='reviewboard.diffviewer.models.diffcommit'), 'id': ForwardRef('int', module='reviewboard.diffviewer.models.diffcommit'), 'parent_id': ForwardRef('str', module='reviewboard.diffviewer.models.diffcommit')}¶
- __optional_keys__ = frozenset({})¶
- __orig_bases__ = (<function TypedDict>,)¶
- __required_keys__ = frozenset({'author_name', 'commit_id', 'commit_message', 'id', 'parent_id'})¶
- __total__ = True¶
- class DiffCommit(*args, **kwargs)¶
Bases:
Model
A 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.
- NAME_MAX_LENGTH = 256¶
The maximum length of the author_name and committer_name fields.
- EMAIL_MAX_LENGTH = 256¶
The maximum length of the author_email and committer_email fields.
- ISO_DATE_FORMAT = '%Y-%m-%d %H:%M:%S%z'¶
The date format that this model uses.
- filename¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- diffset¶
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.parent
is aForwardManyToOneDescriptor
instance.
- author_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- author_email¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- author_date_utc¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- author_date_offset¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- committer_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- committer_email¶
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¶
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¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- commit_message¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- commit_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- parent_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- last_modified¶
A timestamp used for generating HTTP caching headers.
- extra_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects: ClassVar[DiffCommitManager] = <reviewboard.diffviewer.managers.DiffCommitManager object>¶
- property author¶
The author’s name and e-mail address.
This is formatted as
author_name <author_email>
.
- property author_date¶
The author date in its original timezone.
- property committer¶
The committer’s name and e-mail address (if applicable).
This will be formatted as
committer_name <committer_email>
if bothcommitter_name
andcommitter_email
are set. Otherwise, it be whichever is defined. If neither are defined, this will beNone
.
- property committer_date¶
The committer date in its original timezone.
If the commit has no committer, this will be
None
.
- summary¶
The first line of the commit message.
- commit_message_body¶
The body of a commit message.
This will contain the content following a commit summary, if any.
New in version 6.0.
- Type:
- summary_truncated¶
The first line of the commit message, truncated to 80 characters.
- serialize() SerializedDiffCommit ¶
Serialize to a dictionary.
- Returns:
A dictionary representing this commit.
- Return type:
- get_total_line_counts()¶
Return the total line counts of all child FileDiffs.
- __str__()¶
Return a human-readable representation of the commit.
- Returns:
The commit ID and its summary (if available).
- Return type:
- __annotations__ = {'objects': 'ClassVar[DiffCommitManager]'}¶
- diffset_id¶
- files¶
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.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_extra_data_json()¶
- get_next_by_author_date_utc(*, field=<django.db.models.fields.DateTimeField: author_date_utc>, is_next=True, **kwargs)¶
- get_next_by_last_modified(*, field=<django.db.models.fields.DateTimeField: last_modified>, is_next=True, **kwargs)¶
- get_previous_by_author_date_utc(*, field=<django.db.models.fields.DateTimeField: author_date_utc>, is_next=False, **kwargs)¶
- get_previous_by_last_modified(*, field=<django.db.models.fields.DateTimeField: last_modified>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- set_extra_data_json(json)¶