HomePhabricator

[CodeReview] Modified CodeRepository::getDiff() so it now returns a bit more…

Authored by HappyDog.

Description

[CodeReview] Modified CodeRepository::getDiff() so it now returns a bit more information about problems that are encountered. This means we can give more meaningful output in svnImport.php (which I have done) and probably elsewhere as well (which I have not). Previously the function returned the diff as a string, or an empty string (or maybe null) if an error occurred. Now it returns a string containing the diff on success, or an integer value indicating the type of error on failure. These values are defined by the DIFFRESULT_* constants. All code that calls this function has been updated to handle these new return values.

Note that getDiff() used to call $revision->isDiffable(), but this just returns a boolean, without indicating why it is not diffable. I therefore had to semi-duplicate this code so we can report the reason properly (i.e. whether because there are no paths, or too many paths).

Details

Committed
HappyDogJan 21 2011, 5:16 PM
Parents
rECRE7e3cd2f1a8f1: CodeReview: Making the limit on the number of paths which we are able to diff…
Branches
Unknown
Tags
Unknown
ChangeId
None