OLD | NEW |
---|---|
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import optparse | 5 import optparse |
6 import os | 6 import os |
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 import webbrowser | 10 import webbrowser |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
266 def getBestExportPathsMap2(files_info, revision): | 266 def getBestExportPathsMap2(files_info, revision): |
267 """Takes an svn url and gets the associated revision.""" | 267 """Takes an svn url and gets the associated revision.""" |
268 global export_map_ | 268 global export_map_ |
269 | 269 |
270 if export_map_: | 270 if export_map_: |
271 return export_map_ | 271 return export_map_ |
272 | 272 |
273 map = dict() | 273 map = dict() |
274 for file_info in files_info: | 274 for file_info in files_info: |
275 if (file_info[0] == "A"): | 275 if (file_info[0] == "A"): |
276 if(isSVNDirectory("svn://chrome-svn/chrome/" + file_info[1], revision)): | 276 if(isSVNDirectory("svn://svn.chromium.org/chrome/" + file_info[1], revisio n)): |
Nicolas Sylvain
2009/11/03 23:01:05
80 char,
eventually we should make it a global var
| |
277 map[file_info[2] + "/" + file_info[3]] = "" | 277 map[file_info[2] + "/" + file_info[3]] = "" |
278 | 278 |
279 export_map_ = map | 279 export_map_ = map |
280 return map | 280 return map |
281 | 281 |
282 def getBestDeletePathsMap(url, revision): | 282 def getBestDeletePathsMap(url, revision): |
283 return getBestDeletePathsMap2(getFileInfo(url, revision), revision) | 283 return getBestDeletePathsMap2(getFileInfo(url, revision), revision) |
284 | 284 |
285 def getBestDeletePathsMap2(files_info, revision): | 285 def getBestDeletePathsMap2(files_info, revision): |
286 """Takes an svn url and gets the associated revision.""" | 286 """Takes an svn url and gets the associated revision.""" |
287 global delete_map_ | 287 global delete_map_ |
288 | 288 |
289 if delete_map_: | 289 if delete_map_: |
290 return delete_map_ | 290 return delete_map_ |
291 | 291 |
292 map = dict() | 292 map = dict() |
293 for file_info in files_info: | 293 for file_info in files_info: |
294 if (file_info[0] == "D"): | 294 if (file_info[0] == "D"): |
295 if(isSVNDirectory("svn://chrome-svn/chrome/" + file_info[1], revision)): | 295 if(isSVNDirectory("svn://svn.chromium.org/chrome/" + file_info[1], revisio n)): |
Nicolas Sylvain
2009/11/03 23:01:05
80 char
| |
296 map[file_info[2] + "/" + file_info[3]] = "" | 296 map[file_info[2] + "/" + file_info[3]] = "" |
297 | 297 |
298 delete_map_ = map | 298 delete_map_ = map |
299 return map | 299 return map |
300 | 300 |
301 def getExistingFilesInRevision(files_info): | 301 def getExistingFilesInRevision(files_info): |
302 """Checks for existing files in the revision. | 302 """Checks for existing files in the revision. |
303 | 303 |
304 Anything that's A will require special treatment (either a merge or an | 304 Anything that's A will require special treatment (either a merge or an |
305 export + add) | 305 export + add) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 answer = sys.stdin.readline() | 340 answer = sys.stdin.readline() |
341 if answer.strip() == "": | 341 if answer.strip() == "": |
342 return default | 342 return default |
343 return answer | 343 return answer |
344 | 344 |
345 def main(options, args): | 345 def main(options, args): |
346 revision = options.revert or options.merge | 346 revision = options.revert or options.merge |
347 | 347 |
348 # Initialize some variables used below. They can be overwritten by | 348 # Initialize some variables used below. They can be overwritten by |
349 # the drover.properties file. | 349 # the drover.properties file. |
350 BASE_URL = "svn://chrome-svn/chrome" | 350 BASE_URL = "svn://svn.chromium.org/chrome" |
351 TRUNK_URL = BASE_URL + "/trunk/src" | 351 TRUNK_URL = BASE_URL + "/trunk/src" |
352 BRANCH_URL = BASE_URL + "/branches/$branch/src" | 352 BRANCH_URL = BASE_URL + "/branches/$branch/src" |
353 SKIP_CHECK_WORKING = True | 353 SKIP_CHECK_WORKING = True |
354 PROMPT_FOR_AUTHOR = False | 354 PROMPT_FOR_AUTHOR = False |
355 | 355 |
356 DEFAULT_WORKING = "drover_" + str(revision) | 356 DEFAULT_WORKING = "drover_" + str(revision) |
357 if options.branch: | 357 if options.branch: |
358 DEFAULT_WORKING += ("_" + options.branch) | 358 DEFAULT_WORKING += ("_" + options.branch) |
359 | 359 |
360 # Override the default properties if there is a drover.properties file. | 360 # Override the default properties if there is a drover.properties file. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 options, args = option_parser.parse_args() | 470 options, args = option_parser.parse_args() |
471 | 471 |
472 if not options.merge and not options.revert: | 472 if not options.merge and not options.revert: |
473 option_parser.error("You need at least --merge or --revert") | 473 option_parser.error("You need at least --merge or --revert") |
474 sys.exit(1) | 474 sys.exit(1) |
475 | 475 |
476 if options.merge and not options.branch: | 476 if options.merge and not options.branch: |
477 option_parser.error("--merge requires a --branch") | 477 option_parser.error("--merge requires a --branch") |
478 sys.exit(1) | 478 sys.exit(1) |
479 | 479 |
480 sys.exit(main(options, args)) | 480 sys.exit(main(options, args)) |
OLD | NEW |