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

Changeset 280663 in webkit


Ignore:
Timestamp:
Aug 4, 2021, 2:29:09 PM (5 years ago)
Author:
Jonathan Bedard
Message:

[check-github-mirror-integrity] Store remote cache in checkout
https://bugs.webkit.org/show_bug.cgi?id=228792
<rdar://problem/81527357>

Reviewed by Aakash Jain.

  • Scripts/check-github-mirror-integrity: Use the local checkout to store the svn.webkit.org, if possible.
  • Scripts/libraries/webkitscmpy/setup.py: Bump version.
  • Scripts/libraries/webkitscmpy/webkitscmpy/init.py: Ditto.
  • Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:

(Svn.init): Allow caller to define cache path.
(Svn._cache_path): Deleted.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r280655 r280663  
     12021-08-04  Jonathan Bedard  <jbedard@apple.com>
     2
     3        [check-github-mirror-integrity] Store remote cache in checkout
     4        https://bugs.webkit.org/show_bug.cgi?id=228792
     5        <rdar://problem/81527357>
     6
     7        Reviewed by Aakash Jain.
     8
     9        * Scripts/check-github-mirror-integrity: Use the local checkout to store the svn.webkit.org, if possible.
     10        * Scripts/libraries/webkitscmpy/setup.py: Bump version.
     11        * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
     12        * Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:
     13        (Svn.__init__): Allow caller to define cache path.
     14        (Svn._cache_path): Deleted.
     15
    1162021-08-04  Jonathan Bedard  <jbedard@apple.com>
    217
  • trunk/Tools/Scripts/check-github-mirror-integrity

    r280655 r280663  
    2828
    2929from webkitpy import webkitscmpy
    30 from webkitscmpy import remote
     30from webkitscmpy import local, remote
    3131
    3232
    3333def main():
     34    cache_path = None
     35    try:
     36        repo = local.Scm.from_path(os.path.dirname(__file__))
     37        cache_path = os.path.join(repo.root_path, '.git' if repo.is_git else '.svn', 'svn-webkit-org-cache.json')
     38    except OSError:
     39        pass
     40
    3441    mirror = remote.GitHub('https://github.com/WebKit/WebKit')
    35     repository = remote.Svn('https://svn.webkit.org/repository/webkit')   
     42    repository = remote.Svn('https://svn.webkit.org/repository/webkit', cache_path=cache_path)
    3643
    3744    mirror_tip = mirror.commit(branch='main')
  • trunk/Tools/Scripts/libraries/webkitscmpy/setup.py

    r280604 r280663  
    3030setup(
    3131    name='webkitscmpy',
    32     version='1.0.5',
     32    version='1.0.6',
    3333    description='Library designed to interact with git and svn repositories.',
    3434    long_description=readme(),
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py

    r280604 r280663  
    4747    )
    4848
    49 version = Version(1, 0, 5)
     49version = Version(1, 0, 6)
    5050
    5151AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py

    r277853 r280663  
    4747        return True if cls.URL_RE.match(url) else False
    4848
    49     def __init__(self, url, dev_branches=None, prod_branches=None, contributors=None, id=None):
     49    def __init__(self, url, dev_branches=None, prod_branches=None, contributors=None, id=None, cache_path=None):
    5050        if url[-1] != '/':
    5151            url += '/'
     
    5959            id=id or url.split('/')[-2].lower(),
    6060        )
     61
     62        if not cache_path:
     63            from webkitscmpy.mocks import remote
     64            host = 'svn.{}'.format(self.URL_RE.match(self.url).group('host'))
     65            if host in remote.Svn.remotes:
     66                host = 'mock-{}'.format(host)
     67            cache_path = os.path.join(tempfile.gettempdir(), host, 'webkitscmpy-cache.json')
     68        self._cache_path = cache_path
    6169
    6270        if os.path.exists(self._cache_path):
     
    194202    def tags(self):
    195203        return self.list('tags')
    196 
    197     @property
    198     @decorators.Memoize()
    199     def _cache_path(self):
    200         from webkitscmpy.mocks import remote
    201         host = 'svn.{}'.format(self.URL_RE.match(self.url).group('host'))
    202         if host in remote.Svn.remotes:
    203             host = 'mock-{}'.format(host)
    204         return os.path.join(tempfile.gettempdir(), host, 'webkitscmpy-cache.json')
    205204
    206205    def _cache_lock(self):
Note: See TracChangeset for help on using the changeset viewer.