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

Side by Side Diff: git_rebase_update.py

Issue 436963005: Added hyphen-only options (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fixed options in some calling code Created 6 years, 4 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 | « git_new_branch.py ('k') | git_reparent_branch.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 Tool to update all branches to have the latest changes from their upstreams. 7 Tool to update all branches to have the latest changes from their upstreams.
8 """ 8 """
9 9
10 import argparse 10 import argparse
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 git.remove_merge_base(branch) 163 git.remove_merge_base(branch)
164 git.get_or_create_merge_base(branch) 164 git.get_or_create_merge_base(branch)
165 165
166 return True 166 return True
167 167
168 168
169 def main(args=()): 169 def main(args=()):
170 parser = argparse.ArgumentParser() 170 parser = argparse.ArgumentParser()
171 parser.add_argument('--verbose', '-v', action='store_true') 171 parser.add_argument('--verbose', '-v', action='store_true')
172 parser.add_argument('--no_fetch', '-n', action='store_true', 172 parser.add_argument('--no_fetch', '--no-fetch', '-n',
173 action='store_true',
173 help='Skip fetching remotes.') 174 help='Skip fetching remotes.')
174 opts = parser.parse_args(args) 175 opts = parser.parse_args(args)
175 176
176 if opts.verbose: # pragma: no cover 177 if opts.verbose: # pragma: no cover
177 logging.getLogger().setLevel(logging.DEBUG) 178 logging.getLogger().setLevel(logging.DEBUG)
178 179
179 # TODO(iannucci): snapshot all branches somehow, so we can implement 180 # TODO(iannucci): snapshot all branches somehow, so we can implement
180 # `git rebase-update --undo`. 181 # `git rebase-update --undo`.
181 # * Perhaps just copy packed-refs + refs/ + logs/ to the side? 182 # * Perhaps just copy packed-refs + refs/ + logs/ to the side?
182 # * commit them to a secret ref? 183 # * commit them to a secret ref?
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 % (return_branch, root_branch) 243 % (return_branch, root_branch)
243 ) 244 )
244 git.run('checkout', root_branch) 245 git.run('checkout', root_branch)
245 git.set_config(STARTING_BRANCH_KEY, '') 246 git.set_config(STARTING_BRANCH_KEY, '')
246 247
247 return retcode 248 return retcode
248 249
249 250
250 if __name__ == '__main__': # pragma: no cover 251 if __name__ == '__main__': # pragma: no cover
251 sys.exit(main(sys.argv[1:])) 252 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « git_new_branch.py ('k') | git_reparent_branch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698