Backport branch for r1621978 group, changelist filtering fixes for WC diffs.
Changes r1621978,r1621981 are merged from trunk, and conflicts resolved.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.8.x-r1621978@1622021 13f79535-47bb-0310-9956-ffa450edef68
Merge the 1.8.x-r1621978 branch:

 * r1621978, r1621981
   Fix changelist filtering for repos-WC and WC-WC diffs.
   Justification:
     Changelist filtering, enabled by "svn diff --cl foo" for example, was
     broken (it crashed in common cases) and incomplete even if the crash
     were avoided. See email thread "Segmentation fault during diff generation"
     starting at <http://svn.haxx.se/dev/archive-2014-08/0325.shtml>.
   Branch:
     ^/subversion/branches/1.8.x-r1621978
   Votes:
     +1: julianfoad, rhuijben, philip


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.8.x@1640851 13f79535-47bb-0310-9956-ffa450edef68
* STATUS: Vote for external/upgrade fix.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.8.x@1640948 13f79535-47bb-0310-9956-ffa450edef68