apply cherrypicks (#81936)

This commit is contained in:
Christopher Fujino
2021-05-11 13:19:05 -07:00
committed by GitHub
parent 6b2f3bc113
commit a5318173fe
3 changed files with 186 additions and 5 deletions

View File

@@ -317,8 +317,8 @@ abstract class Repository {
);
git.run(
<String>['cherry-pick', '--no-commit', commit],
'attempt to cherry-pick $commit without committing',
<String>['cherry-pick', commit],
'cherry-pick $commit',
workingDirectory: checkoutDirectory.path,
);
}

View File

@@ -216,7 +216,10 @@ class StartCommand extends Command<void> {
stdio.printTrace(
'Attempt to cherrypick $revision ${success ? 'succeeded' : 'failed'}',
);
if (!success) {
if (success) {
engine.cherryPick(revision);
cherrypick.state = pb.CherrypickState.COMPLETED;
} else {
cherrypick.state = pb.CherrypickState.PENDING_WITH_CONFLICT;
}
}
@@ -253,10 +256,16 @@ class StartCommand extends Command<void> {
for (final pb.Cherrypick cherrypick in frameworkCherrypicks) {
final String revision = cherrypick.trunkRevision;
final bool result = framework.canCherryPick(revision);
final bool success = framework.canCherryPick(revision);
stdio.printTrace(
'Attempt to cherrypick $cherrypick ${result ? 'succeeded' : 'failed'}',
'Attempt to cherrypick $cherrypick ${success ? 'succeeded' : 'failed'}',
);
if (success) {
framework.cherryPick(revision);
cherrypick.state = pb.CherrypickState.COMPLETED;
} else {
cherrypick.state = pb.CherrypickState.PENDING_WITH_CONFLICT;
}
}
final String frameworkHead = framework.reverseParse('HEAD');