⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286623 in webkit


Ignore:
Timestamp:
Dec 7, 2021, 2:31:12 PM (5 years ago)
Author:
Jonathan Bedard
Message:

[commits.webkit.org] Fallback to remote repository (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=233904
<rdar://problem/86131927>

Reviewed by Dewei Zhu.

  • Tools/Scripts/libraries/reporelaypy/reporelaypy/init.py: Bump version.
  • Tools/Scripts/libraries/reporelaypy/reporelaypy/checkout.py:

(Checkout.Encoder.default):
(Checkout.init): Allow user to specify a remote fallback repository.

  • Tools/Scripts/libraries/reporelaypy/reporelaypy/checkoutroute.py:

(CheckoutRoute.commit): If no commit is found, query the fallback repository.

  • Tools/Scripts/libraries/reporelaypy/run: Add --fallback option.
  • Tools/Scripts/libraries/reporelaypy/setup.py: Bump version.

Canonical link: https://commits.webkit.org/244936@main

Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r286605 r286623  
     12021-12-06  Jonathan Bedard  <jbedard@apple.com>
     2
     3        [commits.webkit.org] Fallback to remote repository (Part 1)
     4        https://bugs.webkit.org/show_bug.cgi?id=233904
     5        <rdar://problem/86131927>
     6
     7        Reviewed by Dewei Zhu.
     8
     9        * Scripts/libraries/reporelaypy/reporelaypy/__init__.py: Bump version.
     10        * Scripts/libraries/reporelaypy/reporelaypy/checkout.py:
     11        (Checkout.Encoder.default):
     12        (Checkout.__init__): Allow user to specify a remote fallback repository.
     13        * Scripts/libraries/reporelaypy/reporelaypy/checkoutroute.py:
     14        (CheckoutRoute.commit): If no commit is found, query the fallback repository.
     15        * Scripts/libraries/reporelaypy/run: Add --fallback option.
     16        * Scripts/libraries/reporelaypy/setup.py: Bump version.
     17
    1182021-12-07  Lauro Moura  <lmoura@igalia.com>
    219
  • trunk/Tools/Scripts/libraries/reporelaypy/reporelaypy/__init__.py

    r286605 r286623  
    4545    )
    4646
    47 version = Version(0, 1, 2)
     47version = Version(0, 2, 0)
    4848
    4949import webkitflaskpy
  • trunk/Tools/Scripts/libraries/reporelaypy/reporelaypy/checkout.py

    r286576 r286623  
    2828
    2929from webkitcorepy import run
    30 from webkitscmpy import local
     30from webkitscmpy import local, remote
    3131
    3232
     
    4444                return super(Checkout.Encoder, self).default(obj)
    4545
    46             return dict(
     46            result = dict(
    4747                path=obj.path,
    4848                url=obj.url,
    4949                sentinal=obj.sentinal,
    5050            )
     51            if obj.fallback_repository:
     52                result['fallback_url'] = obj.fallback_repository.url
     53            return result
    5154
    5255    @classmethod
     
    6770        return 0
    6871
    69     def __init__(self, path, url=None, http_proxy=None, sentinal=True, primary=True):
     72    def __init__(self, path, url=None, http_proxy=None, sentinal=True, fallback_url=None, primary=True):
    7073        self.sentinal = sentinal
    7174        self.path = path
     
    7376        self._repository = None
    7477        self._child_process = None
     78        self.fallback_repository = remote.Scm.from_url(fallback_url) if fallback_url else None
     79        if self.fallback_repository:
     80            self.fallback_repository.commit()
    7581
    7682        containing_path = os.path.dirname(path)
  • trunk/Tools/Scripts/libraries/reporelaypy/reporelaypy/checkoutroute.py

    r286576 r286623  
    146146            return None
    147147
    148         commit = self.checkout.repository.find(ref) if ref else self.checkout.repository.commit()
     148        commit = None
     149        try:
     150            commit = self.checkout.repository.find(ref) if ref else self.checkout.repository.commit()
     151        except (RuntimeError, ValueError):
     152            pass
     153
    149154        if not commit:
    150             return commit
     155            try:
     156                if self.checkout.fallback_repository:
     157                    return self.checkout.fallback_repository.find(ref)
     158            except (RuntimeError, ValueError):
     159                pass
     160            return None
    151161
    152162        encoded = json.dumps(commit, cls=Commit.Encoder)
  • trunk/Tools/Scripts/libraries/reporelaypy/run

    r286576 r286623  
    6969        help='Set the number of seconds to wait between polling git checkout',
    7070    )
     71    group.add_argument(
     72        '--fallback', dest='fallback', default=None, action='store', type=str,
     73        help='Fallback repository URL',
     74    )
    7175
    7276    group = parser.add_argument_group('Database')
     
    112116
    113117    print('Finding checkout...')
    114     checkout = Checkout(path=args.path, url=args.url, http_proxy=args.http_proxy, sentinal=args.sentinal)
     118    checkout = Checkout(
     119        path=args.path,
     120        url=args.url,
     121        http_proxy=args.http_proxy,
     122        sentinal=args.sentinal,
     123        fallback_url=args.fallback,
     124    )
    115125    print('Git checkout:')
    116126    print('    Path: {}'.format(checkout.path))
    117127    print('    URL: {}'.format(checkout.url))
     128    if checkout.fallback_repository:
     129        print('    Fallback: {}'.format(checkout.fallback_repository.url))
    118130    if not checkout.repository:
    119131        print('    Cloning repository...')
  • trunk/Tools/Scripts/libraries/reporelaypy/setup.py

    r286605 r286623  
    3131setup(
    3232    name='reporelaypy',
    33     version='0.1.2',
     33    version='0.2.0',
    3434    description='Library for visualizing, processing and storing test results.',
    3535    long_description=readme(),
Note: See TracChangeset for help on using the changeset viewer.