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

Unified Diff: tools/release/version.dart

Issue 14238039: Make version.dart ready for svn 1.7 checkouts (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/release/version.dart
diff --git a/tools/release/version.dart b/tools/release/version.dart
index 74e1e66363d0dde9d2c933a661e1926ce3ab97be..e9f0111f7351e3e01e4dfb845c7ac71c8adcd690 100644
--- a/tools/release/version.dart
+++ b/tools/release/version.dart
@@ -189,20 +189,23 @@ class Version {
return username;
}
- bool isGitRepository() {
+ RepositoryType get repositoryType {
+ bool hasDirectory(path, name) {
+ return new Directory.fromPath(path.append(name)).existsSync();
+ }
+
var currentPath = new Path(new Directory.current().path);
Bill Hesse 2013/04/29 11:58:56 This is changing to Directory.current, so if versi
kustermann 2013/04/30 09:38:44 Thanks for the hint.
- while (!new Directory.fromPath(currentPath.append(".git")).existsSync()) {
- currentPath = currentPath.directoryPath;
+ while (true) {
+ if (hasDirectory(currentPath, '.svn')) {
+ return RepositoryType.SVN;
+ } else if (hasDirectory(currentPath, '.git')) {
+ return RepositoryType.GIT;
+ }
if (currentPath.toString() == "/") {
Bill Hesse 2013/04/29 11:58:56 I'm not sure this will work on Windows - paths wil
ricow1 2013/04/30 07:21:28 I think we can fix this by doing: do { } while (
kustermann 2013/04/30 09:38:44 I think this is not doing what we want. It allows
break;
}
+ currentPath = currentPath.directoryPath;
}
- return new Directory.fromPath(currentPath.append(".git")).existsSync();
- }
-
- RepositoryType get repositoryType {
- if (new Directory(".svn").existsSync()) return RepositoryType.SVN;
- if (isGitRepository()) return RepositoryType.GIT;
return RepositoryType.UNKNOWN;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698