Skip to content

Commit 03fc193

Browse files
committed
[update-checkout] Allow the config file to specify a per repo overriding url.
1 parent 4581c85 commit 03fc193

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

utils/update-checkout

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,21 @@ def update_working_copy(repo_path, branch):
5656

5757
def obtain_additional_swift_sources(
5858
config, with_ssh, branch, skip_history, skip_repositories):
59-
for dir_name, repo in config['repositories'].items():
59+
for dir_name, repo_info in config['repositories'].items():
60+
repo = repo_info['name']
6061
if dir_name in skip_repositories:
6162
print("--- Skipping '" + dir_name + "' ---")
6263
continue
6364
with shell.pushd(SWIFT_SOURCE_ROOT, dry_run=False,
6465
echo=False):
6566
if not os.path.isdir(os.path.join(dir_name, ".git")):
6667
print("--- Cloning '" + dir_name + "' ---")
67-
if with_ssh is True or 'https-clone-pattern' not in config:
68+
69+
# If we have a url override, use that url instead of
70+
# interpolating.
71+
if 'url' in repo_info:
72+
remote = repo_info['url']
73+
elif with_ssh is True or 'https-clone-pattern' not in config:
6874
remote = config['ssh-clone-pattern'] % repo
6975
else:
7076
remote = config['https-clone-pattern'] % repo

utils/update-checkout-config.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"ssh-clone-pattern": "[email protected]:%s.git",
33
"https-clone-pattern": "https://github.com/%s.git",
44
"repositories" : {
5-
"llvm": "apple/swift-llvm",
6-
"clang": "apple/swift-clang",
7-
"swift": "apple/swift-swift",
8-
"lldb": "apple/swift-lldb",
9-
"cmark": "apple/swift-cmark",
10-
"llbuild": "apple/swift-llbuild",
11-
"swiftpm": "apple/swift-package-manager",
12-
"compiler-rt": "apple/swift-compiler-rt",
13-
"swift-corelibs-xctest": "apple/swift-corelibs-xctest",
14-
"swift-corelibs-foundation": "apple/swift-corelibs-foundation",
15-
"swift-corelibs-libdispatch": "apple/swift-corelibs-libdispatch",
16-
"swift-integration-tests": "apple/swift-integration-tests"
5+
"llvm": { "name": "apple/swift-llvm" },
6+
"clang": { "name": "apple/swift-clang" },
7+
"swift": { "name": "apple/swift-swift" },
8+
"lldb": { "name": "apple/swift-lldb" },
9+
"cmark": { "name": "apple/swift-cmark" },
10+
"llbuild": { "name": "apple/swift-llbuild" },
11+
"swiftpm": { "name": "apple/swift-package-manager" },
12+
"compiler-rt": { "name": "apple/swift-compiler-rt" },
13+
"swift-corelibs-xctest": { "name": "apple/swift-corelibs-xctest" },
14+
"swift-corelibs-foundation": { "name": "apple/swift-corelibs-foundation" },
15+
"swift-corelibs-libdispatch": { "name": "apple/swift-corelibs-libdispatch" },
16+
"swift-integration-tests": { "name": "apple/swift-integration-tests" }
1717
},
1818
"branch-names": ["master-branches", "next-branches", "swift-3.0-preview-1-branches"],
1919
"default-branch-alias": "master",

0 commit comments

Comments
 (0)