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

Changeset 292890 in webkit


Ignore:
Timestamp:
Apr 14, 2022, 2:15:31 PM (4 years ago)
Author:
Jonathan Bedard
Message:

[git-webkit] Personal branch is "not a PR branch"
https://bugs.webkit.org/show_bug.cgi?id=239329
<rdar://problem/91756286>

Reviewed by Yusuke Suzuki.

  • Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
  • Tools/Scripts/libraries/webkitscmpy/webkitscmpy/init.py: Ditto.
  • Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:

(Git.branches_for): Provide optional caching.

  • Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py:

(Branch.editable): If a branch does not exist on production remotes, that branch
should also be considered a PR branch.

  • Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:

(PullRequest.main): Only create a new PR branch if the current branch is a
production branch.

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

Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r292888 r292890  
     12022-04-14  Jonathan Bedard  <jbedard@apple.com>
     2
     3        [git-webkit] Personal branch is "not a PR branch"
     4        https://bugs.webkit.org/show_bug.cgi?id=239329
     5        <rdar://problem/91756286>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * Scripts/libraries/webkitscmpy/setup.py: Bump version.
     10        * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
     11        * Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
     12        (Git.branches_for): Provide optional caching.
     13        * Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py:
     14        (Branch.editable): If a branch does not exist on production remotes, that branch
     15        should also be considered a PR branch.
     16        * Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
     17        (PullRequest.main): Only create a new PR branch if the current branch is a
     18        production branch.
     19
    1202022-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Tools/Scripts/libraries/webkitscmpy/setup.py

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

    r292844 r292890  
    4747    )
    4848
    49 version = Version(4, 9, 2)
     49version = Version(4, 9, 3)
    5050
    5151AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py

    r292844 r292890  
    506506        return int(revision_count.stdout)
    507507
     508    @decorators.Memoize(cached=False)
    508509    def branches_for(self, hash=None, remote=True):
    509510        branch = run(
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py

    r290748 r292890  
    5555        if (repository or local.Scm).DEV_BRANCHES.match(branch):
    5656            return True
    57         return False
     57        if branch in (repository or local.Scm).DEFAULT_BRANCHES:
     58            return False
     59        if (repository or local.Scm).PROD_BRANCHES.match(branch):
     60            return False
     61        if not repository or not isinstance(repository, local.Git):
     62            return False
     63
     64        # FIXME: Need to consider alternate remotes
     65        for remote in ['origin']:
     66            if branch in repository.branches_for(remote=remote, cached=True):
     67                return False
     68        return True
    5869
    5970    @classmethod
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py

    r292538 r292890  
    137137            return 1
    138138
    139         if not repository.DEV_BRANCHES.match(repository.branch):
     139        if repository.branch in repository.DEFAULT_BRANCHES or repository.PROD_BRANCHES.match(repository.branch):
    140140            if Branch.main(args, repository, why="'{}' is not a pull request branch".format(repository.branch), **kwargs):
    141141                sys.stderr.write("Abandoning pushing pull-request because '{}' could not be created\n".format(args.issue))
Note: See TracChangeset for help on using the changeset viewer.