예제 #1
0
def upgrade_sdk(path):
    venv_bin = os.path.join(path, 'venv', 'bin')
    os.environ['PATH'] = ':'.join(x for x in os.environ['PATH'].split(':')
                                  if x != venv_bin)
    with chdir(path):
        check_call(['git', 'pull', REPO_URL, RELEASE_BRANCH])

    args = ['python', os.path.join(path, 'install.py')]
    os.execvp('python', args)
예제 #2
0
def get_remote_revision(path):
    with chdir(path):
        check_call(['git', 'fetch', REPO_URL, RELEASE_BRANCH],
                   stderr=open('/dev/null', 'w'))
        return Popen(['git', 'rev-parse', 'FETCH_HEAD'],
                     stdout=PIPE).communicate()[0].strip()
예제 #3
0
def get_local_revision(path):
    with chdir(path):
        return Popen(['git', 'rev-parse', 'HEAD'],
                     stdout=PIPE).communicate()[0].strip()