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

Side by Side Diff: git_rebase_update.py

Issue 264423002: Make git rebase-update more responsive. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Make rebase-update stream fetch output Created 6 years, 7 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 | « no previous file | testing_support/git_test_utils.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 # TODO(iannucci): assert that the tags are in the remote fetch refspec 57 # TODO(iannucci): assert that the tags are in the remote fetch refspec
58 fetch_args = ['--all'] 58 fetch_args = ['--all']
59 else: 59 else:
60 fetch_args.append('--multiple') 60 fetch_args.append('--multiple')
61 fetch_args.extend(remotes) 61 fetch_args.extend(remotes)
62 # TODO(iannucci): Should we fetch git-svn? 62 # TODO(iannucci): Should we fetch git-svn?
63 63
64 if not fetch_args: # pragma: no cover 64 if not fetch_args: # pragma: no cover
65 print 'Nothing to fetch.' 65 print 'Nothing to fetch.'
66 else: 66 else:
67 out, err = git.run_with_stderr('fetch', *fetch_args) 67 git.run_with_stderr('fetch', *fetch_args, stdout=sys.stdout,
68 for data, stream in zip((out, err), (sys.stdout, sys.stderr)): 68 stderr=sys.stderr)
69 if data:
70 print >> stream, data
71 69
72 70
73 def remove_empty_branches(branch_tree): 71 def remove_empty_branches(branch_tree):
74 tag_set = git.tags() 72 tag_set = git.tags()
75 ensure_root_checkout = git.once(lambda: git.run('checkout', git.root())) 73 ensure_root_checkout = git.once(lambda: git.run('checkout', git.root()))
76 74
77 deletions = set() 75 deletions = set()
78 downstreams = collections.defaultdict(list) 76 downstreams = collections.defaultdict(list)
79 for branch, parent in git.topo_iter(branch_tree, top_down=False): 77 for branch, parent in git.topo_iter(branch_tree, top_down=False):
80 downstreams[parent].append(branch) 78 downstreams[parent].append(branch)
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 % (return_branch, root_branch) 242 % (return_branch, root_branch)
245 ) 243 )
246 git.run('checkout', root_branch) 244 git.run('checkout', root_branch)
247 git.set_config(STARTING_BRANCH_KEY, '') 245 git.set_config(STARTING_BRANCH_KEY, '')
248 246
249 return retcode 247 return retcode
250 248
251 249
252 if __name__ == '__main__': # pragma: no cover 250 if __name__ == '__main__': # pragma: no cover
253 sys.exit(main(sys.argv[1:])) 251 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | testing_support/git_test_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698