Add original file and patched file resources to the Web API
Review Request #3008 — Created March 25, 2012 and submitted
Adds resources for retrieving the original file, and the patched file from the Web API. These new resources are children of the File Diff Resource, and provide a way for external tools to retrieve full copies of source files from a review request. If the file represented by the FileDiffResource is new, the link to the OriginalFileResource will be removed. Alternatively, if the file is deleted, the link to the PatchedFileResource will be removed.
Tested manually on local dev. Ran unit tests.
Description | From | Last Updated |
---|---|---|
Always have the imports listed alphabetically. |
chipx86 | |
I know the others aren't like this, but "is_new" would feel better to me. |
chipx86 | |
You can remove the blank line inbetween these. |
chipx86 | |
Combine these. The summary is always right next to the """ |
chipx86 | |
Why not combine these? |
chipx86 | |
Put the # TODO on the previous line. |
chipx86 | |
Multi-line lists should have each entry on their own line, indented 4 spaces. |
chipx86 | |
Nope. |
chipx86 | |
Summary line. |
chipx86 | |
Not really true. We're only removing links if we're operating on an object. The resource itself may still be a … |
chipx86 | |
Just: "if obj:" |
chipx86 | |
I believe the only time that we will have an exception is when something goes very wrong. This means it's … |
chipx86 | |
In this particular case, we should catch/log per-function, since they're both pretty heavy-weight and we'll end up wanting more detail. |
chipx86 | |
Probably not necessary. In the context of this function, obj basically means the filediff. Let's just use obj directly. |
chipx86 |
-
-
I believe the only time that we will have an exception is when something goes very wrong. This means it's a problem in Review Board (or a server we talk to) and not a non-existent resource. So, we should return a 500 Internal Server Error instead. We should also log the error we get. Given that, the except: should be "expect Exception, e:" Same below.
-
In this particular case, we should catch/log per-function, since they're both pretty heavy-weight and we'll end up wanting more detail.
-
Probably not necessary. In the context of this function, obj basically means the filediff. Let's just use obj directly.
- Change Summary:
-
Updated to resolve the issues from Christian's review.
- Diff:
-
Revision 3 (+135 -2)