How to use the vcstool.clients.vcs_base.which function in vcstool

To help you get started, we’ve selected a few vcstool examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dirk-thomas / vcstool / vcstool / clients / bzr.py View on Github external
branch = line[len(prefix):]
                break
        if not branch:
            result['output'] = 'Could not determine parent branch',
            result['returncode'] = 1
            return result
        result['output'] = branch
        return result

    def _check_executable(self):
        assert BzrClient._executable is not None, \
            "Could not find 'bzr' executable"


if not BzrClient._executable:
    BzrClient._executable = which('bzr')
github dirk-thomas / vcstool / vcstool / clients / hg.py View on Github external
result = self._run_command(_cmd)
                if not result['returncode'] and result['output'] == 'off':
                    return
                HgClient._config_color = True

        # inject arguments to force colorization
        if HgClient._config_color:
            cmd[1:1] = '--color', 'always'

    def _check_executable(self):
        assert HgClient._executable is not None, \
            "Could not find 'hg' executable"


if not HgClient._executable:
    HgClient._executable = which('hg')
github dirk-thomas / vcstool / vcstool / clients / svn.py View on Github external
command.url

        return {
            'cmd': cmd,
            'cwd': self.path,
            'output': output,
            'returncode': None
        }

    def _check_executable(self):
        assert SvnClient._executable is not None, \
            "Could not find 'svn' executable"


if not SvnClient._executable:
    SvnClient._executable = which('svn')
github dirk-thomas / vcstool / vcstool / clients / git.py View on Github external
if GitClient._config_color_is_auto is None:
            _cmd = [GitClient._executable, 'config', '--get', 'color.ui']
            result = self._run_command(_cmd)
            GitClient._config_color_is_auto = result['output'] in ['', 'auto']

        # inject arguments to force colorization
        if GitClient._config_color_is_auto:
            cmd[1:1] = '-c', 'color.ui=always'

    def _check_executable(self):
        assert GitClient._executable is not None, \
            "Could not find 'git' executable"


if not GitClient._executable:
    GitClient._executable = which('git')