When updating reviews using post-review I'm getting the following error
(company specifics scrubbed):
totoro:~/src mtt$ post-review -r 31 -d
>>> Repository info 'Path: http://..., Base path: /..., Supports
changesets: False'
>>> HTTP GETting /api/json/reviewrequests/31/
Traceback (most recent call last):
File "/Users/mtt/Applications/bin/post-review", line 893, in <module>
main(sys.argv[1:])
File "/Users/mtt/Applications/bin/post-review", line 875, in main
submit_as=options.submit_as)
File "/Users/mtt/Applications/bin/post-review", line 658, in tempt_fate
review_request = server.get_review_request(options.rid)
File "/Users/mtt/Applications/bin/post-review", line 141, in
get_review_request
rsp = self.api_get('/api/json/reviewrequests/%s/' % rid)
File "/Users/mtt/Applications/bin/post-review", line 213, in api_get
return self.process_json(self.http_get(path))
File "/Users/mtt/Applications/bin/post-review", line 197, in http_get
rsp = urllib2.urlopen(url).read()
File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 121, in urlopen
return _opener.open(url, data)
File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 366, in open
protocol = req.get_type()
File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 241, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /api/json/reviewrequests/31/
This is happening because the HTTP GET code builds the URL in a different
way to the HTTP POST code and omits the http://server prefix. I suspect
this is happening in my case because I have a server specified in my
~/.reviewboardrc without the http:// bit
I've attached a patch which uses the same code for both and allows me to
post a review update.