def get_repository_info(self):
        """
        Find out information about the current Bazaar branch (if any) and
        return it.
        """
        if not check_install(['bzr', 'help']):
            logging.debug('Unable to execute "bzr help": skipping Bazaar')
            return None

        bzr_info = execute(['bzr', 'info'], ignore_errors=True)

        if 'ERROR: Not a branch:' in bzr_info:
            # This is not a branch:
            repository_info = None
        else:
            # This is a branch, let's get its attributes:
            branch_match = re.search(self.BRANCH_REGEX, bzr_info, re.MULTILINE)

            path = branch_match.group('branch_path')
            if path == '.':
                path = os.getcwd()

            repository_info = RepositoryInfo(
                path=path,
                base_path='/',    # Diffs are always relative to the root.
                supports_parent_diffs=True)

        return repository_info
dataset/ETHPy150Open reviewboard/rbtools/rbtools/clients/bazaar.py/BazaarClient.get_repository_info/original