Cache SVNRepositoryInfo object
Review Request #7229 — Created April 19, 2015 and submitted — Latest diff uploaded
get_repository_info()
produces anSVNRepositoryInfo
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 toget_repository_info()
will always perform the same set of steps. When executing 'rbt diff/post' this is evident asget_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 theSVNRepositoryInfo
object and other checks are performed twice.
SVNClient
is updated to cache the resultantSVNRepositoryInfo
object fromget_repository_info()
and subsequent calls toget_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.