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

Unified Diff: tools/release/version.dart

Issue 11440010: Move runtime/tools/make_version.py to tools/ and use GetVersion from utils.py (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « tools/make_version.py ('k') | 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 7774e47553eb3a2f5f0e41edbba64c79c4035ca4..ecc96253f0690f3ca5c33f014086b5fbd8a8de4e 100644
--- a/tools/release/version.dart
+++ b/tools/release/version.dart
@@ -178,9 +178,20 @@ class Version {
return username;
}
+ bool isGitRepository() {
+ var currentPath = new Path.fromNative(new Directory.current().path);
+ while (!new Directory.fromPath(currentPath.append(".git")).existsSync()) {
+ currentPath = currentPath.directoryPath;
+ if (currentPath.toString() == "/") {
+ break;
+ }
+ }
+ return new Directory.fromPath(currentPath.append(".git")).existsSync();
+ }
+
RepositoryType get repositoryType {
if (new Directory(".svn").existsSync()) return RepositoryType.SVN;
- if (new Directory(".git").existsSync()) return RepositoryType.GIT;
+ if (isGitRepository()) return RepositoryType.GIT;
return RepositoryType.UNKNOWN;
}
}
« no previous file with comments | « tools/make_version.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698