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

Unified Diff: sdk/lib/_internal/pub_generated/test/descriptor/git.dart

Issue 657673002: Regenerate pub sources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub_generated/test/descriptor/git.dart
diff --git a/sdk/lib/_internal/pub_generated/test/descriptor/git.dart b/sdk/lib/_internal/pub_generated/test/descriptor/git.dart
index 1235a0941f39b71b8e4e29215fc2f23c2413ccde..38ecdfa216774733a31592d2b01b7ceceb56bee0 100644
--- a/sdk/lib/_internal/pub_generated/test/descriptor/git.dart
+++ b/sdk/lib/_internal/pub_generated/test/descriptor/git.dart
@@ -1,12 +1,23 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
library descriptor.git;
+
import 'dart:async';
+
import 'package:path/path.dart' as path;
import 'package:scheduled_test/scheduled_test.dart';
import 'package:scheduled_test/descriptor.dart';
+
import '../../lib/src/git.dart' as git;
+
+/// Describes a Git repository and its contents.
class GitRepoDescriptor extends DirectoryDescriptor {
GitRepoDescriptor(String name, List<Descriptor> contents)
: super(name, contents);
+
+ /// Creates the Git repository and commits the contents.
Future create([String parent]) => schedule(() {
return super.create(parent).then((_) {
return _runGitCommands(
@@ -14,6 +25,11 @@ class GitRepoDescriptor extends DirectoryDescriptor {
[['init'], ['add', '.'], ['commit', '-m', 'initial commit']]);
});
}, 'creating Git repo:\n${describe()}');
+
+ /// Writes this descriptor to the filesystem, than commits any changes from
+ /// the previous structure to the Git repo.
+ ///
+ /// [parent] defaults to [defaultRoot].
Future commit([String parent]) => schedule(() {
return super.create(parent).then((_) {
return _runGitCommands(
@@ -21,21 +37,35 @@ class GitRepoDescriptor extends DirectoryDescriptor {
[['add', '.'], ['commit', '-m', 'update']]);
});
}, 'committing Git repo:\n${describe()}');
+
+ /// Return a Future that completes to the commit in the git repository
+ /// referred to by [ref] at the current point in the scheduled test run.
+ ///
+ /// [parent] defaults to [defaultRoot].
Future<String> revParse(String ref, [String parent]) => schedule(() {
return _runGit(['rev-parse', ref], parent).then((output) => output[0]);
}, 'parsing revision $ref for Git repo:\n${describe()}');
+
+ /// Schedule a Git command to run in this repository.
+ ///
+ /// [parent] defaults to [defaultRoot].
Future runGit(List<String> args, [String parent]) => schedule(() {
return _runGit(args, parent);
}, "running 'git ${args.join(' ')}' in Git repo:\n${describe()}");
+
Future _runGitCommands(String parent, List<List<String>> commands) =>
Future.forEach(commands, (command) => _runGit(command, parent));
+
Future<List<String>> _runGit(List<String> args, String parent) {
+ // Explicitly specify the committer information. Git needs this to commit
+ // and we don't want to rely on the buildbots having this already set up.
var environment = {
'GIT_AUTHOR_NAME': 'Pub Test',
'GIT_AUTHOR_EMAIL': 'pub@dartlang.org',
'GIT_COMMITTER_NAME': 'Pub Test',
'GIT_COMMITTER_EMAIL': 'pub@dartlang.org'
};
+
if (parent == null) parent = defaultRoot;
return git.run(
args,
@@ -43,3 +73,4 @@ class GitRepoDescriptor extends DirectoryDescriptor {
environment: environment);
}
}
+
« no previous file with comments | « sdk/lib/_internal/pub_generated/test/descriptor.dart ('k') | sdk/lib/_internal/pub_generated/test/descriptor/tar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698