From 3001b3307dc1d47fcde9697dd2a82b77450c2a57 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Tue, 30 Jan 2018 11:37:15 -0800 Subject: [PATCH] Try to make transitioning channels actually work. (#14353) * Try to make transitioning channels actually work. * Update upgrade.dart --- .../lib/src/commands/channel.dart | 2 +- .../lib/src/commands/upgrade.dart | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/channel.dart b/packages/flutter_tools/lib/src/commands/channel.dart index 4c1367da2f..6a9ee18bc9 100644 --- a/packages/flutter_tools/lib/src/commands/channel.dart +++ b/packages/flutter_tools/lib/src/commands/channel.dart @@ -93,7 +93,7 @@ class ChannelCommand extends FlutterCommand { static Future _checkout(String branchName) async { final int result = await runCommandAndStreamOutput( - ['git', 'checkout', branchName], + ['git', 'checkout', '-b', branchName], workingDirectory: Cache.flutterRoot, prefix: 'git: ', ); diff --git a/packages/flutter_tools/lib/src/commands/upgrade.dart b/packages/flutter_tools/lib/src/commands/upgrade.dart index bce432b3e4..e7dea73e35 100644 --- a/packages/flutter_tools/lib/src/commands/upgrade.dart +++ b/packages/flutter_tools/lib/src/commands/upgrade.dart @@ -4,13 +4,14 @@ import 'dart:async'; +import 'package:meta/meta.dart'; + import '../base/common.dart'; import '../base/file_system.dart'; import '../base/os.dart'; import '../base/process.dart'; import '../cache.dart'; import '../dart/pub.dart'; -import '../doctor.dart'; import '../globals.dart'; import '../runner/flutter_command.dart'; import '../version.dart'; @@ -59,7 +60,7 @@ class UpgradeCommand extends FlutterCommand { printStatus('Upgrading engine...'); code = await runCommandAndStreamOutput( [ - fs.path.join(Cache.flutterRoot, 'bin', 'flutter'), '--no-color', 'precache' + fs.path.join('bin', 'flutter'), '--no-color', 'precache', ], workingDirectory: Cache.flutterRoot, allowReentrantFlutter: true @@ -68,16 +69,22 @@ class UpgradeCommand extends FlutterCommand { printStatus(''); printStatus(flutterVersion.toString()); - final String projRoot = findProjectRoot(); - if (projRoot != null) { + final String projectRoot = findProjectRoot(); + if (projectRoot != null) { printStatus(''); - await pubGet(context: PubContext.pubUpgrade, directory: projRoot, upgrade: true, checkLastModified: false); + await pubGet(context: PubContext.pubUpgrade, directory: projectRoot, upgrade: true, checkLastModified: false); } // Run a doctor check in case system requirements have changed. printStatus(''); printStatus('Running flutter doctor...'); - await doctor.diagnose(); + code = await runCommandAndStreamOutput( + [ + fs.path.join('bin', 'flutter'), 'doctor', + ], + workingDirectory: Cache.flutterRoot, + allowReentrantFlutter: true, + ); } // dev/benchmarks/complex_layout/lib/main.dart | 24 +- @@ -88,7 +95,7 @@ class UpgradeCommand extends FlutterCommand { // create mode 100644 examples/flutter_gallery/lib/gallery/demo.dart static final RegExp _gitChangedRegex = new RegExp(r' (rename|delete mode|create mode) .+'); - // Public for testing. + @visibleForTesting static bool matchesGitLine(String line) { return _gitDiffRegex.hasMatch(line) || _gitChangedRegex.hasMatch(line)