Skip to content

Commit 4581c85

Browse files
committed
[update-checkout] Change the config file to consistently use dashes instead of underscores in config keys. Update update-checkout to match.
1 parent 62c5816 commit 4581c85

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

utils/update-checkout

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ def obtain_additional_swift_sources(
6464
echo=False):
6565
if not os.path.isdir(os.path.join(dir_name, ".git")):
6666
print("--- Cloning '" + dir_name + "' ---")
67-
if with_ssh is True or "https_clone_pattern" not in config:
68-
remote = config["ssh_clone_pattern"] % repo
67+
if with_ssh is True or 'https-clone-pattern' not in config:
68+
remote = config['ssh-clone-pattern'] % repo
6969
else:
70-
remote = config["https_clone_pattern"] % repo
70+
remote = config['https-clone-pattern'] % repo
7171
if skip_history:
7272
shell.call(['git', 'clone', '--recursive', '--depth', '1',
7373
remote, dir_name], echo=False)
7474
else:
7575
shell.call(['git', 'clone', '--recursive', remote,
7676
dir_name], echo=False)
7777
if branch:
78-
for config_branch_name in config['branch_names']:
78+
for config_branch_name in config['branch-names']:
7979
if branch not in config[config_branch_name]['aliases']:
8080
continue
8181
repo_branch = \
@@ -91,9 +91,9 @@ def obtain_additional_swift_sources(
9191

9292

9393
def validate_config(config):
94-
# Make sure that our branch_names are unique.
95-
if len(config['branch_names']) != len(set(config['branch_names'])):
96-
raise RuntimeError('Configuration file has duplicate \'branch_names\'')
94+
# Make sure that our branch-names are unique.
95+
if len(config['branch-names']) != len(set(config['branch-names'])):
96+
raise RuntimeError('Configuration file has duplicate \'branch-names\'')
9797

9898
# Then make sure the alias names used by our branches are unique.
9999
#
@@ -102,7 +102,7 @@ def validate_config(config):
102102
# the union of the sets. We have uniqueness if the length of the union
103103
# equals the length of the sum of the counts.
104104
data = [(len(config[branch]['aliases']), set(config[branch]['aliases']))
105-
for branch in config['branch_names']]
105+
for branch in config['branch-names']]
106106
result = reduce(lambda acc, x: (acc[0] + x[0], acc[1] | x[1]), data,
107107
(0, set([])))
108108
if result[0] == len(result[1]):
@@ -168,7 +168,7 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
168168
print("--- Skipping '" + dir_name + "' ---")
169169
continue
170170
if branch:
171-
for config_branch_name in config['branch_names']:
171+
for config_branch_name in config['branch-names']:
172172
if branch not in config[config_branch_name]['aliases']:
173173
continue
174174
repo_branch = config[config_branch_name]['repos'][dir_name]

utils/update-checkout-config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"ssh_clone_pattern": "[email protected]:%s.git",
3-
"https_clone_pattern": "https://github.com/%s.git",
2+
"ssh-clone-pattern": "[email protected]:%s.git",
3+
"https-clone-pattern": "https://github.com/%s.git",
44
"repositories" : {
55
"llvm": "apple/swift-llvm",
66
"clang": "apple/swift-clang",
@@ -15,7 +15,7 @@
1515
"swift-corelibs-libdispatch": "apple/swift-corelibs-libdispatch",
1616
"swift-integration-tests": "apple/swift-integration-tests"
1717
},
18-
"branch_names": ["master-branches", "next-branches", "swift-3.0-preview-1-branches"],
18+
"branch-names": ["master-branches", "next-branches", "swift-3.0-preview-1-branches"],
1919
"default-branch-alias": "master",
2020
"master-branches": {
2121
"aliases": ["master", "stable"],

0 commit comments

Comments
 (0)