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

Side by Side Diff: git_rebase_update.py

Issue 1566343002: Fix rebase-update on windows on git-svn repos. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: nocover Created 4 years, 11 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_common.py ('k') | no next file » | 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 return return_branch, workdir 43 return return_branch, workdir
44 44
45 45
46 def fetch_remotes(branch_tree): 46 def fetch_remotes(branch_tree):
47 """Fetches all remotes which are needed to update |branch_tree|.""" 47 """Fetches all remotes which are needed to update |branch_tree|."""
48 fetch_tags = False 48 fetch_tags = False
49 remotes = set() 49 remotes = set()
50 tag_set = git.tags() 50 tag_set = git.tags()
51 fetchspec_map = {} 51 fetchspec_map = {}
52 all_fetchspec_configs = git.run( 52 all_fetchspec_configs = git.config_regexp(r'^remote\..*\.fetch')
53 'config', '--get-regexp', r'^remote\..*\.fetch').strip() 53 for fetchspec_config in all_fetchspec_configs:
54 for fetchspec_config in all_fetchspec_configs.splitlines():
55 key, _, fetchspec = fetchspec_config.partition(' ') 54 key, _, fetchspec = fetchspec_config.partition(' ')
56 dest_spec = fetchspec.partition(':')[2] 55 dest_spec = fetchspec.partition(':')[2]
57 remote_name = key.split('.')[1] 56 remote_name = key.split('.')[1]
58 fetchspec_map[dest_spec] = remote_name 57 fetchspec_map[dest_spec] = remote_name
59 for parent in branch_tree.itervalues(): 58 for parent in branch_tree.itervalues():
60 if parent in tag_set: 59 if parent in tag_set:
61 fetch_tags = True 60 fetch_tags = True
62 else: 61 else:
63 full_ref = git.run('rev-parse', '--symbolic-full-name', parent) 62 full_ref = git.run('rev-parse', '--symbolic-full-name', parent)
64 for dest_spec, remote_name in fetchspec_map.iteritems(): 63 for dest_spec, remote_name in fetchspec_map.iteritems():
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 318
320 return retcode 319 return retcode
321 320
322 321
323 if __name__ == '__main__': # pragma: no cover 322 if __name__ == '__main__': # pragma: no cover
324 try: 323 try:
325 sys.exit(main()) 324 sys.exit(main())
326 except KeyboardInterrupt: 325 except KeyboardInterrupt:
327 sys.stderr.write('interrupted\n') 326 sys.stderr.write('interrupted\n')
328 sys.exit(1) 327 sys.exit(1)
OLDNEW
« no previous file with comments | « git_common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698