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

Side by Side Diff: utils/pub/git.dart

Issue 11066091: "Reverting 13451" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | utils/pub/io.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 /** 5 /**
6 * Helper functionality for invoking Git. 6 * Helper functionality for invoking Git.
7 */ 7 */
8 library git; 8 library git;
9 9
10 import 'io.dart'; 10 import 'io.dart';
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 /// Run a git process with [args] from [workingDir]. Returns the stdout as a 24 /// Run a git process with [args] from [workingDir]. Returns the stdout as a
25 /// list of strings if it succeeded. Completes to an exception if it failed. 25 /// list of strings if it succeeded. Completes to an exception if it failed.
26 Future<List<String>> run(List<String> args, [String workingDir]) { 26 Future<List<String>> run(List<String> args, [String workingDir]) {
27 return _gitCommand.chain((git) { 27 return _gitCommand.chain((git) {
28 return runProcess(git, args, workingDir); 28 return runProcess(git, args, workingDir);
29 }).transform((result) { 29 }).transform((result) {
30 if (!result.success) throw new Exception( 30 if (!result.success) throw new Exception(
31 'Git error. Command: git ${Strings.join(args, " ")}\n' 31 'Git error. Command: git ${Strings.join(args, " ")}\n'
32 'Working directory: $currentWorkingDir\n'
33 '${Strings.join(result.stderr, "\n")}'); 32 '${Strings.join(result.stderr, "\n")}');
34 33
35 return result.stdout; 34 return result.stdout;
36 }); 35 });
37 } 36 }
38 37
39 bool _isGitInstalledCache; 38 bool _isGitInstalledCache;
40 39
41 /// The cached Git command. 40 /// The cached Git command.
42 String _gitCommandCache; 41 String _gitCommandCache;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 }); 76 });
78 77
79 future.handleException((err) { 78 future.handleException((err) {
80 // If the process failed, they probably don't have it. 79 // If the process failed, they probably don't have it.
81 completer.complete(false); 80 completer.complete(false);
82 return true; 81 return true;
83 }); 82 });
84 83
85 return completer.future; 84 return completer.future;
86 } 85 }
OLDNEW
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698