Lines Matching full:commit
52 IS_REVERT = re.compile(r'This reverts commit ([0-9a-f]{40})')
87 """Commit the .pick_status.json file."""
103 'git', 'commit', *cmd,
114 class Commit: class
133 def from_json(cls, data: 'CommitDict') -> 'Commit':
249 async def resolve_nomination(commit: 'Commit', version: str) -> 'Commit': argument
252 'git', 'log', '--format=%B', '-1', commit.sha,
257 assert p.returncode == 0, f'git log for {commit.sha} failed'
265 # check to see if this fixes another staged commit.
267 commit.because_sha = fixed = await full_sha(m.group(1))
271 commit.nomination_type = NominationType.FIXES
273 commit.nominated = True
274 return commit
279 commit.nominated = True
280 commit.nomination_type = NominationType.CC
281 return commit
287 commit.because_sha = reverted = await full_sha(m.group(1))
291 commit.nomination_type = NominationType.REVERT
293 commit.nominated = True
294 return commit
296 return commit
299 async def resolve_fixes(commits: typing.List['Commit'], previous: typing.List['Commit']) -> None: argument
300 """Determine if any of the undecided commits fix/revert a staged commit.
302 The are still needed if they apply to a commit that is staged for
305 This must be done in order, because a commit 3 might fix commit 2 which
306 fixes commit 1.
311 for commit in reversed(commits):
312 if not commit.nominated and commit.nomination_type is NominationType.FIXES:
313 commit.nominated = commit.because_sha in shas
315 if commit.nominated:
316 shas.add(commit.sha)
318 for commit in commits:
319 if (commit.nomination_type is NominationType.REVERT and
320 commit.because_sha in shas):
322 if oldc.sha == commit.because_sha:
323 # In this case a commit that hasn't yet been applied is
324 # reverted, we don't want to apply that commit at all
327 commit.nominated = False
328 commit.resolution = Resolution.DENOMINATED
329 shas.remove(commit.because_sha)
333 async def gather_commits(version: str, previous: typing.List['Commit'], argument
334 new: typing.List[typing.Tuple[str, str]], cb) -> typing.List['Commit']:
340 m_commits: typing.List[typing.Optional['Commit']] = [None] * len(new)
343 async def inner(commit: 'Commit', version: str, argument
344 commits: typing.List[typing.Optional['Commit']], argument
346 commits[index] = await resolve_nomination(commit, version)
351 inner(Commit(sha, desc), version, m_commits, i, cb)))
355 commits = typing.cast(typing.List[Commit], m_commits)
359 for commit in commits:
360 if commit.resolution is Resolution.UNRESOLVED and not commit.nominated:
361 commit.resolution = Resolution.NOTNEEDED
366 def load() -> typing.List['Commit']:
371 return [Commit.from_json(c) for c in raw]
374 def save(commits: typing.Iterable['Commit']) -> None: argument