misery got a fish trophy!
Avoid error message on "New Review Request page" for Mercurial < 3.9
Review Request #8778 — Created Feb. 24, 2017 and submitted
If the repository hosting uses a Mercurial 3.7 it is possible to get branches (/json-branches/) with the JSON API of hgweb. But it leads to an error if reviewboard tries to fetch "/json-log/?rev=" as it is not implemented. Also avoid an error if Mercurial is really old and does not support to get branches in JSON style with "/json-branches/". Bugs closed: 4524
Opened "New Review Request page" and check if branch and commit list
works properly and does not contain errors.Tested versions: 2.6.2, 3.0, 3.7.3, 4.1
Description | From | Last Updated |
---|---|---|
This doesn't quite look right to me, but I'm very unfamiliar with the code. In line 321 contents is treated … |
SE seb | |
A similar problem here. When I look at the original 3.7 map file for the json style, it looks to … |
SE seb | |
Col: 80 E501 line too long (90 > 79 characters) |
reviewbot | |
"type" is a reserved word in python. Can you change this variable name? |
david | |
Add a blank line between these two. |
david | |
Add a blank line between these two. |
david | |
Should we do the check here before json.loads? |
david |
-
-
This doesn't quite look right to me, but I'm very unfamiliar with the code. In line 321 contents is treated as a json string which makes me believe it is simply the body of the HTTP response. However, in line 315 you are using in as though it was a dictionary?
-
A similar problem here. When I look at the original 3.7 map file for the json style, it looks to me as though the 'not yet implemented' is returned as a json string. So it would seem much safer to test for the returned content-type in whatever way is correct (see comment above) and then do something like
json_contents = json.loads(contents) if not json_contents == 'not yet implemented'
or similar. Otherwise you ran into trouble if the response has any characters escaped for instance (although I don't know why it ever would).
- Commit:
-
1a27502c4035d15b31291e8a4a134d062bdd53e8c20980a2392d1ea191cf7720a661de94ec74e83d
- People:
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/hg.py reviewboard/scmtools/core.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/hg.py reviewboard/scmtools/core.py