public static function open($repositoryPath, $svn = null)
    {
        $svn = Binary::ensure($svn);

        if (!is_string($repositoryPath)) {
            throw new \InvalidArgumentException(sprintf(
                '"%s" is not a valid path', $repositoryPath
            ));
        }

        $repositoryRoot = self::findRepositoryRoot($svn, $repositoryPath);

        if ($repositoryRoot === null) {
            throw new \InvalidArgumentException(sprintf(
                '"%s" is not a valid SVN repository', $repositoryPath
            ));
        }

        return new static($repositoryRoot, $svn);
    }