

def _vcs_add(script, version_pkg_path, vcs='git'):
    if (vcs == 'git'):
        script.run('git', 'init', cwd=version_pkg_path)
        script.run('git', 'add', '.', cwd=version_pkg_path)
        script.run('git', 'commit', '-q', '--author', 'pip <pypa-dev@googlegroups.com>', '-am', 'initial version', cwd=version_pkg_path)
    elif (vcs == 'hg'):
        script.run('hg', 'init', cwd=version_pkg_path)
        script.run('hg', 'add', '.', cwd=version_pkg_path)
        script.run('hg', 'commit', '-q', '--user', 'pip <pypa-dev@googlegroups.com>', '-m', 'initial version', cwd=version_pkg_path)
    elif (vcs == 'svn'):
        repo_url = _create_svn_repo(script, version_pkg_path)
        script.run('svn', 'checkout', repo_url, 'pip-test-package', cwd=script.scratch_path)
        checkout_path = (script.scratch_path / 'pip-test-package')
        checkout_path = checkout_path.replace('c:', 'C:')
        version_pkg_path = checkout_path
    elif (vcs == 'bazaar'):
        script.run('bzr', 'init', cwd=version_pkg_path)
        script.run('bzr', 'add', '.', cwd=version_pkg_path)
        script.run('bzr', 'whoami', 'pip <pypa-dev@googlegroups.com>', cwd=version_pkg_path)
        script.run('bzr', 'commit', '-q', '--author', 'pip <pypa-dev@googlegroups.com>', '-m', 'initial version', cwd=version_pkg_path)
    else:
        raise ValueError(('Unknown vcs: %r' % vcs))
    return version_pkg_path

dataset/ETHPy150Open pypa/pip/tests/lib/__init__.py _vcs_add/original