'core',
'dependencies',
'jsinterp',
+ 'networking',
'outtmpl',
+ 'formats',
'plugins',
'update',
'upstream',
'misc',
'test',
},
- cls.EXTRACTOR: {'extractor'},
- cls.DOWNLOADER: {'downloader'},
- cls.POSTPROCESSOR: {'postprocessor'},
+ cls.EXTRACTOR: {'extractor', 'ie'},
+ cls.DOWNLOADER: {'downloader', 'fd'},
+ cls.POSTPROCESSOR: {'postprocessor', 'pp'},
}.items()
for name in names
}
for commit_infos in cleanup_misc_items.values():
sorted_items.append(CommitInfo(
'cleanup', ('Miscellaneous',), ', '.join(
- self._format_message_link(None, info.commit.hash)
+ self._format_message_link(None, info.commit.hash).strip()
for info in sorted(commit_infos, key=lambda item: item.commit.hash or '')),
[], Commit(None, '', commit_infos[0].commit.authors), []))
def format_single_change(self, info):
message = self._format_message_link(info.message, info.commit.hash)
if info.issues:
- message = f'{message} ({self._format_issues(info.issues)})'
+ message = message.replace('\n', f' ({self._format_issues(info.issues)})\n', 1)
if info.commit.authors:
- message = f'{message} by {self._format_authors(info.commit.authors)}'
+ message = message.replace('\n', f' by {self._format_authors(info.commit.authors)}\n', 1)
if info.fixes:
fix_message = ', '.join(f'{self._format_message_link(None, fix.hash)}' for fix in info.fixes)
if authors != info.commit.authors:
fix_message = f'{fix_message} by {self._format_authors(authors)}'
- message = f'{message} (With fixes in {fix_message})'
+ message = message.replace('\n', f' (With fixes in {fix_message})\n', 1)
- return message
+ return message[:-1]
def _format_message_link(self, message, hash):
assert message or hash, 'Improperly defined commit message or override'
message = message if message else hash[:HASH_LENGTH]
- return f'[{message}]({self.repo_url}/commit/{hash})' if hash else message
+ if not hash:
+ return f'{message}\n'
+ return f'[{message}\n'.replace('\n', f']({self.repo_url}/commit/{hash})\n', 1)
def _format_issues(self, issues):
return ', '.join(f'[#{issue}]({self.repo_url}/issues/{issue})' for issue in issues)
(?:\ \((?P<issues>\#\d+(?:,\ \#\d+)*)\))?
''', re.VERBOSE | re.DOTALL)
EXTRACTOR_INDICATOR_RE = re.compile(r'(?:Fix|Add)\s+Extractors?', re.IGNORECASE)
+ REVERT_RE = re.compile(r'(?i:Revert)\s+([\da-f]{40})')
FIXES_RE = re.compile(r'(?i:Fix(?:es)?(?:\s+bugs?)?(?:\s+in|\s+for)?|Revert)\s+([\da-f]{40})')
UPSTREAM_MERGE_RE = re.compile(r'Update to ytdl-commit-([\da-f]+)')
self.COMMAND, 'log', f'--format=%H%n%s%n%b%n{self.COMMIT_SEPARATOR}',
f'{self._start}..{self._end}' if self._start else self._end).stdout
- commits = {}
+ commits, reverts = {}, {}
fixes = defaultdict(list)
lines = iter(result.splitlines(False))
for i, commit_hash in enumerate(lines):
logger.debug(f'Reached Release commit, breaking: {commit}')
break
+ revert_match = self.REVERT_RE.fullmatch(commit.short)
+ if revert_match:
+ reverts[revert_match.group(1)] = commit
+ continue
+
fix_match = self.FIXES_RE.search(commit.short)
if fix_match:
commitish = fix_match.group(1)
commits[commit.hash] = commit
+ for commitish, revert_commit in reverts.items():
+ reverted = commits.pop(commitish, None)
+ if reverted:
+ logger.debug(f'{commit} fully reverted {reverted}')
+ else:
+ commits[revert_commit.hash] = revert_commit
+
for commitish, fix_commits in fixes.items():
if commitish in commits:
hashes = ', '.join(commit.hash[:HASH_LENGTH] for commit in fix_commits)