Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: recipe_modules/git/example.py

Issue 2369073002: git recipe_module: git new-branch. (Closed)
Patch Set: Review. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « recipe_modules/git/api.py ('k') | recipe_modules/git/example.expected/basic.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 'git', 6 'git',
7 'recipe_engine/path', 7 'recipe_engine/path',
8 'recipe_engine/platform', 8 'recipe_engine/platform',
9 'recipe_engine/properties', 9 'recipe_engine/properties',
10 'recipe_engine/raw_io', 10 'recipe_engine/raw_io',
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 # If you need to run more arbitrary git commands, you can use api.git itself, 60 # If you need to run more arbitrary git commands, you can use api.git itself,
61 # which behaves like api.step(), but automatically sets the name of the step. 61 # which behaves like api.step(), but automatically sets the name of the step.
62 api.git('status', cwd=api.path['checkout']) 62 api.git('status', cwd=api.path['checkout'])
63 63
64 api.git('status', name='git status can_fail_build', 64 api.git('status', name='git status can_fail_build',
65 can_fail_build=True) 65 can_fail_build=True)
66 66
67 api.git('status', name='git status cannot_fail_build', 67 api.git('status', name='git status cannot_fail_build',
68 can_fail_build=False) 68 can_fail_build=False)
69 69
70 # You should run git new-branch before you upload something with git cl.
71 api.git.new_branch('refactor') # Upstream is origin/master by default.
72 # And use upstream kwarg to set up different upstream for tracking.
73 api.git.new_branch('feature', upstream='refactor')
74
70 # You can use api.git.rebase to rebase the current branch onto another one 75 # You can use api.git.rebase to rebase the current branch onto another one
71 api.git.rebase(name_prefix='my repo', branch='origin/master', 76 api.git.rebase(name_prefix='my repo', branch='origin/master',
72 dir_path=api.path['checkout'], 77 dir_path=api.path['checkout'],
73 remote_name=api.properties.get('remote_name')) 78 remote_name=api.properties.get('remote_name'))
74 79
75 if api.properties.get('cat_file', None): 80 if api.properties.get('cat_file', None):
76 step_result = api.git.cat_file_at_commit(api.properties['cat_file'], 81 step_result = api.git.cat_file_at_commit(api.properties['cat_file'],
77 api.properties['revision'], 82 api.properties['revision'],
78 stdout=api.raw_io.output()) 83 stdout=api.raw_io.output())
79 if 'TestOutput' in step_result.stdout: 84 if 'TestOutput' in step_result.stdout:
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 api.properties(count_objects_can_fail_build=True)) 148 api.properties(count_objects_can_fail_build=True))
144 yield ( 149 yield (
145 api.test('cat-file_test') + 150 api.test('cat-file_test') +
146 api.step_data('git cat-file abcdef12345:TestFile', 151 api.step_data('git cat-file abcdef12345:TestFile',
147 stdout=api.raw_io.output('TestOutput')) + 152 stdout=api.raw_io.output('TestOutput')) +
148 api.properties(revision='abcdef12345', cat_file='TestFile')) 153 api.properties(revision='abcdef12345', cat_file='TestFile'))
149 154
150 yield ( 155 yield (
151 api.test('git-cache-checkout') + 156 api.test('git-cache-checkout') +
152 api.properties(use_git_cache=True)) 157 api.properties(use_git_cache=True))
OLDNEW
« no previous file with comments | « recipe_modules/git/api.py ('k') | recipe_modules/git/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698