Improve robustness of --svn-show-copies-as-adds option and respect included files

Review Request #6960 — Created Feb. 18, 2015 and submitted — Latest diff uploaded

Information

RBTools
master
bd7b63e...

Reviewers

This fixes Issue #3649 where previously history_scheduled_with_commit() did not respect explicitly included files when determining if an SVN changeset contained an addition-with-history. history_scheduled_with_commit() now adds included files to the call to svn status similar to how it is done for an SVN changelist.

In the process of fixing the issue I came across several other minor deficiencies related to the --svn-show-copies-as-adds option and I have also cleaned those up:

  1. The SVN client version is checked before doing anything related to --svn-show-copies-as-adds, as the underlying SVN argument (--show-copies-as-adds) did not come into existence until version 1.7.0.
  2. The existence of --svn-show-copies-as-adds is checked before calling history_scheduled_with_commit(). If the user has already specified this option then there is no point in doing additional work.
  3. In history_scheduled_with_commit() add '-q' argument to svn status call to suppress unversioned items. For working copies with unversioned items, the addition of this argument will result in fewer status lines to process.
  4. svn status reports details about files contained in changelists at the end of its output, after detailing all non-changelist files. In the case where we are not working with a changelist, return early when we get to the changelist "section" of the status output so as not to possibly incorrectly detect history from a changelist.
  5. In history_scheduled_with_commit() respect exclude_patterns so as not to possibly incorrectly detect history from an excluded file.

To support checking the SVN client version, is_valid_version() is relocated from rbtools/clients/git.py to rbtools/utils/checks.py. Moving to this common location allows the function to be used by both the git and SVN clients without duplicating code. The unit test related to this function (test_is_valid_version()) is also relocated to rbtools/utils/tests.py.

I've added unit tests which should exercise all aspects of these changes.