Home | History | Annotate | Download | only in site_utils

Lines Matching refs:repo

13   2. Skip updating a repo, e.g. autotest
15 3. Update a given repo to a specific commit
74 def clone_prod_branch(repo):
75 """Method to clone the prod branch for a given repo under /tmp/ dir.
77 @param repo: Name of the git repo to be cloned.
79 @returns path to the cloned repo.
83 repo_dir = '/tmp/%s' % repo
84 print 'Cloning %s prod branch under %s' % (repo, repo_dir)
87 git_repo = revision_control.GitRepo(repo_dir, GIT_URL[repo])
89 print 'Successfully cloned %s prod branch' % repo
93 def update_prod_branch(repo, repo_dir, hash_to_rebase):
94 """Method to update the prod branch of the given repo to the given hash.
96 @param repo: Name of the git repo to be updated.
97 @param repo_dir: path to the cloned repo.
105 print 'Updating %s prod branch.' % repo
109 print 'Successfully pushed %s prod branch!\n' % repo
117 'Fail to get pushed commits for repo %s from git push log: %s' %
118 (repo, result))
122 def get_pushed_commits(repo, repo_dir, pushed_commits_range):
125 @param repo: Name of the updated git repo.
126 @param repo_dir: path to the cloned repo.
134 print 'Getting pushed CLs for %s repo.' % repo
137 if repo == 'autotest':
140 print 'Successfully got pushed CLs for %s repo!\n' % repo
141 return '\n%s:\n%s\n%s\n' % (repo, get_commits_cmd, pushed_commits)
147 @raises subprocess.CalledProcessError on a repo command failure.
168 # update_log saves the git log of the updated repo.
170 for repo, hash_to_rebase in repos.iteritems():
171 repo_dir = clone_prod_branch(repo)
173 repo, repo_dir, hash_to_rebase)
174 update_log += get_pushed_commits(repo, repo_dir, push_commits_range)
189 print ('Deploy succeeds!!! Below is the push log of the updated repo:\n%s'