Cache SVNRepositoryInfo object

Review Request #7229 — Created April 19, 2015 and submitted — Latest diff uploaded

Information

RBTools
master
d624fd7...

Reviewers

get_repository_info() produces an SVNRepositoryInfo object and also checks that the svn command line client exists, checks that GNU diff exists, and determines the SVN client version. None of this information is expected to change during during the course of a single invocation of 'rbt', yet multiple calls to get_repository_info() will always perform the same set of steps. When executing 'rbt diff/post' this is evident as get_repository_info() is called once when initially scanning for an SCM client and a second time when generating a diff. This leads to redundant work as the instantiation of the SVNRepositoryInfo object and other checks are performed twice.

SVNClient is updated to cache the resultant SVNRepositoryInfo object from get_repository_info() and subsequent calls to get_repository_info() will immediately return the cached object.

  • Executed 'rbt diff' in debug mode. Prior to the change, there were two sets of log messages for checks performed in get_repository_info(). After the change there is only one set.
  • Ran unit tests.
    Loading...