Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a5318173
Unverified
Commit
a5318173
authored
May 11, 2021
by
Christopher Fujino
Committed by
GitHub
May 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply cherrypicks (#81936)
parent
6b2f3bc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
5 deletions
+186
-5
repository.dart
dev/tools/lib/repository.dart
+2
-2
start.dart
dev/tools/lib/start.dart
+12
-3
repository_test.dart
dev/tools/test/repository_test.dart
+172
-0
No files found.
dev/tools/lib/repository.dart
View file @
a5318173
...
...
@@ -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
,
);
}
...
...
dev/tools/lib/start.dart
View file @
a5318173
...
...
@@ -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'
);
...
...
dev/tools/test/repository_test.dart
0 → 100644
View file @
a5318173
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:dev_tools/repository.dart'
;
import
'package:file/memory.dart'
;
import
'package:platform/platform.dart'
;
import
'../../../packages/flutter_tools/test/src/fake_process_manager.dart'
;
import
'./common.dart'
;
void
main
(
)
{
group
(
'repository'
,
()
{
test
(
'canCherryPick returns true if git cherry-pick returns 0'
,
()
{
const
LocalPlatform
platform
=
LocalPlatform
();
const
String
rootDir
=
'/'
;
const
String
commit
=
'abc123'
;
final
TestStdio
stdio
=
TestStdio
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
FrameworkRepository
.
defaultUpstream
,
fileSystem
.
path
.
join
(
rootDir
,
'flutter_conductor_checkouts'
,
'framework'
),
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
commit
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'status'
,
'--porcelain'
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'cherry-pick'
,
'--no-commit'
,
commit
,
],
exitCode:
0
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'reset'
,
'HEAD'
,
'--hard'
,
]),
]);
final
Checkouts
checkouts
=
Checkouts
(
fileSystem:
fileSystem
,
parentDirectory:
fileSystem
.
directory
(
rootDir
),
platform:
platform
,
processManager:
processManager
,
stdio:
stdio
,
);
final
Repository
repository
=
FrameworkRepository
(
checkouts
);
expect
(
repository
.
canCherryPick
(
commit
),
true
);
});
test
(
'canCherryPick returns false if git cherry-pick returns non-zero'
,
()
{
const
LocalPlatform
platform
=
LocalPlatform
();
const
String
rootDir
=
'/'
;
const
String
commit
=
'abc123'
;
final
TestStdio
stdio
=
TestStdio
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
FrameworkRepository
.
defaultUpstream
,
fileSystem
.
path
.
join
(
rootDir
,
'flutter_conductor_checkouts'
,
'framework'
),
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
commit
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'status'
,
'--porcelain'
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'cherry-pick'
,
'--no-commit'
,
commit
,
],
exitCode:
1
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'diff'
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'reset'
,
'HEAD'
,
'--hard'
,
]),
]);
final
Checkouts
checkouts
=
Checkouts
(
fileSystem:
fileSystem
,
parentDirectory:
fileSystem
.
directory
(
rootDir
),
platform:
platform
,
processManager:
processManager
,
stdio:
stdio
,
);
final
Repository
repository
=
FrameworkRepository
(
checkouts
);
expect
(
repository
.
canCherryPick
(
commit
),
false
);
});
test
(
'cherryPick() applies the commit'
,
()
{
const
LocalPlatform
platform
=
LocalPlatform
();
const
String
rootDir
=
'/'
;
const
String
commit
=
'abc123'
;
final
TestStdio
stdio
=
TestStdio
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
FrameworkRepository
.
defaultUpstream
,
fileSystem
.
path
.
join
(
rootDir
,
'flutter_conductor_checkouts'
,
'framework'
),
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
commit
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'status'
,
'--porcelain'
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'cherry-pick'
,
commit
,
]),
]);
final
Checkouts
checkouts
=
Checkouts
(
fileSystem:
fileSystem
,
parentDirectory:
fileSystem
.
directory
(
rootDir
),
platform:
platform
,
processManager:
processManager
,
stdio:
stdio
,
);
final
Repository
repository
=
FrameworkRepository
(
checkouts
);
repository
.
cherryPick
(
commit
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
});
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment