WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-217521-20201009144504.patch (text/plain), 7.00 KB, created by
Jonathan Bedard
on 2020-10-09 14:45:05 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2020-10-09 14:45:05 PDT
Size:
7.00 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 268289) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2020-10-09 Jonathan Bedard <jbedard@apple.com> >+ >+ [webkitscmpy] Handle svn info run from directory >+ https://bugs.webkit.org/show_bug.cgi?id=217521 >+ <rdar://problem/70144173> >+ >+ Reviewed by Dewei Zhu. >+ >+ * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version. >+ * Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py: >+ (Svn.__init__): Set the root_path, so that svn info is run from the top level. >+ (Svn.info): Rely on root_path, not path. >+ (Svn.root_path): Use self._root_path instead of self.info() call. >+ (Svn.list): Rely on root_path, not path. >+ (Svn._cache_revisions): Ditto. >+ (Svn.remote): The repository root will not change during a single command invocation. >+ (Svn._branch_for): Handle initial branch commits, which. may have non-standard change lists. >+ (Svn.commit): Rely on root_path, not path, certain svn info calls will not change during >+ the invocation of a single program. >+ > 2020-10-09 Alex Christensen <achristensen@webkit.org> > > REGRESSION: [Mac Release] 2 Cookie API are failing >Index: Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py >=================================================================== >--- Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (revision 268289) >+++ Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (working copy) >@@ -46,7 +46,7 @@ except ImportError: > "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`" > ) > >-version = Version(0, 1, 1) >+version = Version(0, 1, 2) > > AutoInstall.register(Package('dateutil', Version(2, 8, 1), pypi_name='python-dateutil')) > >Index: Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py >=================================================================== >--- Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py (revision 268289) >+++ Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py (working copy) >@@ -47,6 +47,10 @@ class Svn(Scm): > > def __init__(self, path, dev_branches=None, prod_branches=None): > super(Svn, self).__init__(path, dev_branches=dev_branches, prod_branches=prod_branches) >+ >+ self._root_path = self.path >+ self._root_path = self.info(cached=False).get('Working Copy Root Path') >+ > if not self.root_path: > raise OSError('Provided path {} is not a svn repository'.format(path)) > >@@ -66,7 +70,7 @@ class Svn(Scm): > additional_args = ['^/branches/{}'.format(branch)] if branch and branch != self.default_branch else [] > additional_args += ['-r', str(revision)] if revision else [] > >- info_result = run([self.executable, 'info'] + additional_args, cwd=self.path, capture_output=True, encoding='utf-8') >+ info_result = run([self.executable, 'info'] + additional_args, cwd=self.root_path, capture_output=True, encoding='utf-8') > if info_result.returncode: > return {} > >@@ -82,7 +86,7 @@ class Svn(Scm): > > @property > def root_path(self): >- return self.info(cached=True).get('Working Copy Root Path') >+ return self._root_path > > @property > def default_branch(self): >@@ -96,7 +100,7 @@ class Svn(Scm): > return self.info()['Relative URL'][2:] > > def list(self, category): >- list_result = run([self.executable, 'list', '^/{}'.format(category)], cwd=self.path, capture_output=True, encoding='utf-8') >+ list_result = run([self.executable, 'list', '^/{}'.format(category)], cwd=self.root_path, capture_output=True, encoding='utf-8') > if list_result.returncode: > return [] > return [element.rstrip('/') for element in list_result.stdout.splitlines()] >@@ -138,7 +142,7 @@ class Svn(Scm): > > log = subprocess.Popen( > [self.executable, 'log', '-q', branch_arg], >- cwd=self.path, >+ cwd=self.root_path, > stdout=subprocess.PIPE, > stderr=subprocess.PIPE, > **kwargs >@@ -192,7 +196,7 @@ class Svn(Scm): > return self._commit_count(revision=self._metadata_cache[branch][0], branch=self.default_branch) > > def remote(self, name=None): >- return self.info()['Repository Root'] >+ return self.info(cached=True)['Repository Root'] > > def _branch_for(self, revision): > candidates = [branch for branch, revisions in self._metadata_cache.items() if branch != 'version' and revision in revisions] >@@ -204,7 +208,7 @@ class Svn(Scm): > > process = run( > [self.executable, 'log', '-v', '-q', self.remote(), '-r', str(revision), '-l', '1'], >- cwd=self.path, capture_output=True, encoding='utf-8', >+ cwd=self.root_path, capture_output=True, encoding='utf-8', > ) > > # If we didn't get a valid answer from the remote, but we found a matching candidate, we return that. >@@ -229,7 +233,7 @@ class Svn(Scm): > > if len(partial) <= 3: > raise self.Exception('Malformed set of edited files') >- partial = partial[2:] >+ partial = partial[2:].split(' ')[0] > return partial.split('/')[2 if partial.startswith('/branches') else 1] > > def commit(self, hash=None, revision=None, identifier=None, branch=None): >@@ -272,7 +276,7 @@ class Svn(Scm): > branch = self.default_branch > > revision = self._metadata_cache[branch][identifier] >- info = self.info(branch=branch, revision=revision) >+ info = self.info(cached=True, branch=branch, revision=revision) > branch = self._branch_for(revision) > > elif revision: >@@ -280,7 +284,7 @@ class Svn(Scm): > raise ValueError('Cannot define both branch and revision') > revision = Commit._parse_revision(revision, do_assert=True) > branch = self._branch_for(revision) >- info = self.info(branch=branch, revision=revision) >+ info = self.info(cached=True, branch=branch, revision=revision) > > else: > branch = branch or self.branch >@@ -318,7 +322,7 @@ class Svn(Scm): > > branch_arg = '^/{}{}'.format('' if branch == self.default_branch else 'branches/', branch) > log = run( >- [self.executable, 'log', '-l', '1', '-r', str(revision), branch_arg], cwd=self.path, >+ [self.executable, 'log', '-l', '1', '-r', str(revision), branch_arg], cwd=self.root_path, > capture_output=True, encoding='utf-8', > ) > split_log = log.stdout.splitlines() >@@ -330,7 +334,7 @@ class Svn(Scm): > break > > author = Contributor.from_scm_log(author_line) >- message = '\n'.join(split_log[3:]) >+ message = '\n'.join(split_log[3:-1]) > else: > self.log('Failed to connect to remote, cannot compute commit message') > email = info['Last Changed Author']
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 217521
:
410951
| 410977