reviewboard.reviews.views.download_diff¶
Views for downloading diffs.
- class DownloadDiffFileView(**kwargs)[source]¶
Bases:
ReviewRequestViewMixin
,View
Downloads an original or modified file from a diff.
This will fetch the file from a FileDiff, optionally patching it, and return the result as an HttpResponse.
- get(request: HttpRequest, revision: int, filediff_id: int, *args, **kwargs) HttpResponse [source]¶
Handle HTTP GET requests for this view.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.revision (
int
) – The revision of the diff to download the file from.filediff_id (
int
) – The ID of the FileDiff corresponding to the file to download.*args (
tuple
) – Positional arguments passed to the handler.**kwargs (
dict
) – Keyword arguments passed to the handler.
- Returns:
The HTTP response to send to the client.
- Return type:
- __annotations__ = {}¶
- class DownloadRawDiffView(**kwargs)[source]¶
Bases:
ReviewRequestViewMixin
,View
View for downloading a raw diff from a review request.
This will generate a single raw diff file spanning all the FileDiffs in a diffset for the revision specified in the URL.
- get(request: HttpRequest, revision: Optional[int] = None, *args, **kwargs) HttpResponse [source]¶
Handle HTTP GET requests for this view.
This will generate the raw diff file and send it to the client.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.revision (
int
, optional) – The revision of the diff to download. Defaults to the latest revision.*args (
tuple
) – Positional arguments passed to the handler.**kwargs (
dict
) – Keyword arguments passed to the handler.
- Returns:
The HTTP response to send to the client.
- Return type:
- __annotations__ = {}¶
- class ReviewsDownloadPatchErrorBundleView(**kwargs)[source]¶
Bases:
DownloadPatchErrorBundleView
,ReviewsDiffFragmentView
A view to download the patch error bundle.
This view allows users to download a bundle containing data to help debug issues when a patch fails to apply. The bundle will contain the diff, the original file (as returned by the SCMTool), and the rejects file, if applicable.
- __annotations__ = {}¶