CodeRepository::getDiff() returns the diff as a string, or a numeric constant if it is unable to get the diff for any reason. The constant describes the reason the diff failed.
Currently the function can't tell the difference between an SVN/connection failure and an empty diff, and so returns self::DIFFRESULT_NoDataReturned in both cases.
The code should be updated so that it can tell the difference and return (e.g.) DIFFRESULT_ConnectionError if there was a connection failure, and DIFFRESULT_NoDataReturned if the diff is genuinely empty.
Brion had some suggestions about how this might be implemented, in http://www.mediawiki.org/wiki/Special:Code/MediaWiki/80822#c13364. Here is the relevant excerpt:
Re: the "can't tell difference between connection failure and empty diff", I think we can remedy that in the SubversionAdaptor classes:
- SubversionAdaptorPecl looks like it should throw an exception on failure, so already good?
- SubversionAdaptorShell should check the return code; a failure should give a non-zero return which we can parley into a nice exception ;)
- SubversionProxy should throw an exception on a bad return, but that could depend on whether the proxy actually returns an HTTP error code on error
Version: unspecified
Severity: normal