Modified: trunk/Tools/Scripts/libraries/webkitscmpy/setup.py (293830 => 293831)
--- trunk/Tools/Scripts/libraries/webkitscmpy/setup.py 2022-05-05 14:45:07 UTC (rev 293830)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/setup.py 2022-05-05 15:01:54 UTC (rev 293831)
@@ -29,7 +29,7 @@
setup(
name='webkitscmpy',
- version='4.12.3',
+ version='4.12.4',
description='Library designed to interact with git and svn repositories.',
long_description=readme(),
classifiers=[
Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (293830 => 293831)
--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py 2022-05-05 14:45:07 UTC (rev 293830)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py 2022-05-05 15:01:54 UTC (rev 293831)
@@ -46,7 +46,7 @@
"Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
)
-version = Version(4, 12, 3)
+version = Version(4, 12, 4)
AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
AutoInstall.register(Package('jinja2', Version(2, 11, 3)))
Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py (293830 => 293831)
--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py 2022-05-05 14:45:07 UTC (rev 293830)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py 2022-05-05 15:01:54 UTC (rev 293831)
@@ -1,4 +1,4 @@
-# Copyright (C) 2020, 2021 Apple Inc. All rights reserved.
+# Copyright (C) 2020-2022 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -449,7 +449,7 @@
generator=lambda *args, **kwargs:
self.edit_config(args[2], args[3]),
), mocks.Subprocess.Route(
- self.executable, 'fetch', 'fork',
+ self.executable, 'fetch', re.compile(r'.+'),
cwd=self.path,
completion=mocks.ProcessCompletion(
returncode=0,
Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py (293830 => 293831)
--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py 2022-05-05 14:45:07 UTC (rev 293830)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py 2022-05-05 15:01:54 UTC (rev 293831)
@@ -95,7 +95,7 @@
return result
@classmethod
- def _add_remote(cls, repository, name, url):
+ def _add_remote(cls, repository, name, url, fetch=True):
returncode = run(
[repository.executable(), 'remote', 'add', name, url],
capture_output=True, cwd=repository.root_path,
@@ -110,6 +110,18 @@
return 1
log.info("Added remote '{}'".format(name))
+
+ if not fetch:
+ return 0
+
+ returncode = run(
+ [repository.executable(), 'fetch', name],
+ capture_output=True, cwd=repository.root_path,
+ ).returncode
+ if returncode:
+ sys.stderr.write("Failed to fetch added remote '{}'\n".format(name))
+ return 1
+ log.info("Fetched remote '{}'".format(name))
return 0
@classmethod
@@ -363,7 +375,7 @@
if url.startswith(protocol):
remote_to_add = url
break
- if cls._add_remote(repository, name, remote_to_add):
+ if cls._add_remote(repository, name, remote_to_add, fetch=True):
result += 1
else:
available_remotes.append(name)
@@ -376,7 +388,7 @@
remote=name, username=username,
))
for fork_name in ['{}-{}'.format(username, name), '{}-fork'.format(name)]:
- if cls._add_remote(repository, fork_name, cls._fork_remote(repository.url(), username, '{}-{}'.format(rmt.name, name))):
+ if cls._add_remote(repository, fork_name, cls._fork_remote(repository.url(), username, '{}-{}'.format(rmt.name, name)), fetch=False):
result += 1
else:
available_remotes.append(fork_name)
@@ -400,7 +412,7 @@
log.info("Adding forked remote as '{}' and 'fork'...".format(username))
for name in [username, 'fork']:
- if cls._add_remote(repository, name, cls._fork_remote(repository.url(), username, rmt.name)):
+ if cls._add_remote(repository, name, cls._fork_remote(repository.url(), username, rmt.name), fetch=False):
result += 1
else:
available_remotes.append(name)