Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: lib/src/git.dart

Issue 1267853002: Add verbosity levels for warnings and errors. (Closed) Base URL: https://github.com/dart-lang/pub.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/command_runner.dart ('k') | lib/src/log.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Helper functionality for invoking Git. 5 /// Helper functionality for invoking Git.
6 library pub.git; 6 library pub.git;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 /// Checks whether [command] is the Git command for this computer. 110 /// Checks whether [command] is the Git command for this computer.
111 bool _tryGitCommand(String command) { 111 bool _tryGitCommand(String command) {
112 // If "git --version" prints something familiar, git is working. 112 // If "git --version" prints something familiar, git is working.
113 try { 113 try {
114 var result = runProcessSync(command, ["--version"]); 114 var result = runProcessSync(command, ["--version"]);
115 var regexp = new RegExp("^git version"); 115 var regexp = new RegExp("^git version");
116 return result.stdout.length == 1 && regexp.hasMatch(result.stdout.single); 116 return result.stdout.length == 1 && regexp.hasMatch(result.stdout.single);
117 } on ProcessException catch (error, stackTrace) { 117 } on ProcessException catch (error, stackTrace) {
118 var chain = new Chain.forTrace(stackTrace); 118 var chain = new Chain.forTrace(stackTrace);
119 // If the process failed, they probably don't have it. 119 // If the process failed, they probably don't have it.
120 log.message('Git command is not "$command": $error\n$chain'); 120 log.error('Git command is not "$command": $error\n$chain');
121 return false; 121 return false;
122 } 122 }
123 } 123 }
OLDNEW
« no previous file with comments | « lib/src/command_runner.dart ('k') | lib/src/log.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698