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

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

Issue 11117015: Fix version when a relative path is used. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 } 142 }
143 var isSvn = repositoryType == RepositoryType.SVN; 143 var isSvn = repositoryType == RepositoryType.SVN;
144 var command = isSvn ? "svn" : "git"; 144 var command = isSvn ? "svn" : "git";
145 command = "$command${getExecutableSuffix()}"; 145 command = "$command${getExecutableSuffix()}";
146 var arguments = isSvn ? ["info"] : ["svn", "info"]; 146 var arguments = isSvn ? ["info"] : ["svn", "info"];
147 ProcessOptions options = new ProcessOptions(); 147 ProcessOptions options = new ProcessOptions();
148 // Run the command from the root to get the last changed revision for this 148 // Run the command from the root to get the last changed revision for this
149 // "branch". Since we have both trunk and bleeding edge in the same 149 // "branch". Since we have both trunk and bleeding edge in the same
150 // repository and since we always build TOT we need this to get the 150 // repository and since we always build TOT we need this to get the
151 // right version number. 151 // right version number.
152 Path root = 152 Path toolsDirectory = new Path.fromNative(_versionFileName).directoryPath;
153 new Path.fromNative(_versionFileName).directoryPath.directoryPath; 153 Path root = toolsDirectory.join(new Path(".."));
154 options.workingDirectory = root.toNativePath(); 154 options.workingDirectory = root.toNativePath();
155 return Process.run(command, arguments, options).transform((result) { 155 return Process.run(command, arguments, options).transform((result) {
156 if (result.exitCode != 0) { 156 if (result.exitCode != 0) {
157 return 0; 157 return 0;
158 } 158 }
159 return getRevisionFromSvnInfo(result.stdout); 159 return getRevisionFromSvnInfo(result.stdout);
160 }); 160 });
161 } 161 }
162 162
163 bool isProductionBuild(String username) { 163 bool isProductionBuild(String username) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 static RepositoryType guessType() { 195 static RepositoryType guessType() {
196 if (new Directory(".svn").existsSync()) return RepositoryType.SVN; 196 if (new Directory(".svn").existsSync()) return RepositoryType.SVN;
197 if (new Directory(".git").existsSync()) return RepositoryType.GIT; 197 if (new Directory(".git").existsSync()) return RepositoryType.GIT;
198 return RepositoryType.UNKNOWN; 198 return RepositoryType.UNKNOWN;
199 } 199 }
200 200
201 String toString() => name; 201 String toString() => name;
202 202
203 final String name; 203 final String name;
204 } 204 }
OLDNEW
« 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