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

Side by Side Diff: tools/release/version.dart

Issue 17274002: Revert 24086 Update checked in binary to version 0.5.19.0 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « tests/standalone/standalone.status ('k') | tools/testing/dart/browser_controller.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 * This file contains functionality for getting dart version numbers using 6 * This file contains functionality for getting dart version numbers using
7 * our standard version construction method. Systems that does not include this 7 * our standard version construction method. Systems that does not include this
8 * file should emulate the structure for revision numbers that we have here. 8 * file should emulate the structure for revision numbers that we have here.
9 * 9 *
10 * The version number of a dart build is constructed as follows: 10 * The version number of a dart build is constructed as follows:
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } catch(e) { 142 } catch(e) {
143 return 0; 143 return 0;
144 } 144 }
145 } 145 }
146 } 146 }
147 return 0; 147 return 0;
148 } 148 }
149 149
150 Future<int> getRevision() { 150 Future<int> getRevision() {
151 if (repositoryType == RepositoryType.UNKNOWN) { 151 if (repositoryType == RepositoryType.UNKNOWN) {
152 return new Future.value(0); 152 return new Future.immediate(0);
153 } 153 }
154 var isSvn = repositoryType == RepositoryType.SVN; 154 var isSvn = repositoryType == RepositoryType.SVN;
155 var command = isSvn ? "svn" : "git"; 155 var command = isSvn ? "svn" : "git";
156 command = "$command${getExecutableSuffix()}"; 156 command = "$command${getExecutableSuffix()}";
157 var arguments = isSvn ? ["info"] : ["svn", "info"]; 157 var arguments = isSvn ? ["info"] : ["svn", "info"];
158 ProcessOptions options = new ProcessOptions();
158 // Run the command from the root to get the last changed revision for this 159 // Run the command from the root to get the last changed revision for this
159 // "branch". Since we have both trunk and bleeding edge in the same 160 // "branch". Since we have both trunk and bleeding edge in the same
160 // repository and since we always build TOT we need this to get the 161 // repository and since we always build TOT we need this to get the
161 // right version number. 162 // right version number.
162 Path toolsDirectory = new Path(_versionFileName).directoryPath; 163 Path toolsDirectory = new Path(_versionFileName).directoryPath;
163 Path root = toolsDirectory.join(new Path("..")); 164 Path root = toolsDirectory.join(new Path(".."));
164 var workingDirectory = root.toNativePath(); 165 options.workingDirectory = root.toNativePath();
165 return Process.run(command, 166 return Process.run(command, arguments, options).then((result) {
166 arguments,
167 workingDirectory: workingDirectory).then((result) {
168 if (result.exitCode != 0) { 167 if (result.exitCode != 0) {
169 return 0; 168 return 0;
170 } 169 }
171 return getRevisionFromSvnInfo(result.stdout); 170 return getRevisionFromSvnInfo(result.stdout);
172 }); 171 });
173 } 172 }
174 173
175 bool isProductionBuild(String username) { 174 bool isProductionBuild(String username) {
176 return username == "chrome-bot"; 175 return username == "chrome-bot";
177 } 176 }
(...skipping 17 matching lines...) Expand all
195 bool hasDirectory(path, name) { 194 bool hasDirectory(path, name) {
196 return new Directory.fromPath(path.append(name)).existsSync(); 195 return new Directory.fromPath(path.append(name)).existsSync();
197 } 196 }
198 bool isFileSystemRoot(absolutePath) { 197 bool isFileSystemRoot(absolutePath) {
199 if (isWindows) { 198 if (isWindows) {
200 return "${absolutePath.directoryPath}" == '/'; 199 return "${absolutePath.directoryPath}" == '/';
201 } 200 }
202 return "$absolutePath" == '/'; 201 return "$absolutePath" == '/';
203 } 202 }
204 203
205 var currentPath = new Path(Directory.current.path); 204 var currentPath = new Path(new Directory.current().path);
206 while (true) { 205 while (true) {
207 if (hasDirectory(currentPath, '.svn')) { 206 if (hasDirectory(currentPath, '.svn')) {
208 return RepositoryType.SVN; 207 return RepositoryType.SVN;
209 } else if (hasDirectory(currentPath, '.git')) { 208 } else if (hasDirectory(currentPath, '.git')) {
210 return RepositoryType.GIT; 209 return RepositoryType.GIT;
211 } 210 }
212 if (isFileSystemRoot(currentPath)) { 211 if (isFileSystemRoot(currentPath)) {
213 break; 212 break;
214 } 213 }
215 currentPath = currentPath.directoryPath; 214 currentPath = currentPath.directoryPath;
(...skipping 12 matching lines...) Expand all
228 static RepositoryType guessType() { 227 static RepositoryType guessType() {
229 if (new Directory(".svn").existsSync()) return RepositoryType.SVN; 228 if (new Directory(".svn").existsSync()) return RepositoryType.SVN;
230 if (new Directory(".git").existsSync()) return RepositoryType.GIT; 229 if (new Directory(".git").existsSync()) return RepositoryType.GIT;
231 return RepositoryType.UNKNOWN; 230 return RepositoryType.UNKNOWN;
232 } 231 }
233 232
234 String toString() => name; 233 String toString() => name;
235 234
236 final String name; 235 final String name;
237 } 236 }
OLDNEW
« no previous file with comments | « tests/standalone/standalone.status ('k') | tools/testing/dart/browser_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698