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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 10913077: Use a bare git repository for the repo cache. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
« utils/pub/git_source.dart ('K') | « utils/tests/pub/pub_install_git_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 6fbee3042af1a98159cd708834f84d8c76837ba9..b70f25b123151374dfc95d3c15142e3878e640b5 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -292,9 +292,9 @@ DirectoryDescriptor packageCacheDir(String name, String version) {
/**
* Describes a directory for a Git package. This directory is of the form found
- * in the global package cache.
+ * in the revision cache of the global package cache.
*/
-DirectoryDescriptor gitPackageCacheDir(String name, [int modifier]) {
+DirectoryDescriptor gitPackageRevisionCacheDir(String name, [int modifier]) {
var value = name;
if (modifier != null) value = "$name $modifier";
return dir(new RegExp("$name${@'-[a-f0-9]+'}"), [
@@ -303,6 +303,20 @@ DirectoryDescriptor gitPackageCacheDir(String name, [int modifier]) {
}
/**
+ * Describes a directory for a Git package. This directory is of the form found
+ * in the repo cache of the global package cache.
+ */
+DirectoryDescriptor gitPackageRepoCacheDir(String name) {
+ return dir(new RegExp("$name${@'-[a-f0-9]+'}"), [
+ dir('branches'),
+ dir('hooks'),
+ dir('info'),
+ dir('objects'),
+ dir('refs')
+ ]);
+}
+
+/**
* Describes the `packages/` directory containing all the given [packages],
* which should be name/version pairs. The packages will be validated against
* the format produced by the mock package server.
@@ -815,7 +829,9 @@ class DirectoryDescriptor extends Descriptor {
*/
final List<Descriptor> contents;
- DirectoryDescriptor(Pattern name, this.contents) : super(name);
+ DirectoryDescriptor(Pattern name, List<Descriptor> contents)
+ : this.contents = contents == null ? <Descriptor>[] : contents,
+ super(name);
/**
* Creates the file within [dir]. Returns a [Future] that is completed after
@@ -958,6 +974,14 @@ class GitRepoDescriptor extends DirectoryDescriptor {
return completer.future;
}
+ /// Schedule a Git command to run in this repository.
+ void scheduleGit(List<String> args) {
+ _schedule((parentDir) {
+ var gitDir = new Directory(join(parentDir, name));
+ return _runGit(args, gitDir);
+ });
+ }
+
Future<String> _runGit(List<String> args, Directory workingDir) {
return runProcess('git', args, workingDir: workingDir.path).
transform((result) {
« utils/pub/git_source.dart ('K') | « utils/tests/pub/pub_install_git_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698