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

Side by Side Diff: drover.py

Issue 22814005: When reverting, just reverse merge the entire revision. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: updates Created 7 years, 4 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import collections 6 import collections
7 import datetime 7 import datetime
8 import json 8 import json
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 paths = getBestExportPathsMap(url, revision).keys() 268 paths = getBestExportPathsMap(url, revision).keys()
269 paths.sort() 269 paths.sort()
270 paths.reverse() 270 paths.reverse()
271 271
272 for path in paths: 272 for path in paths:
273 command = "svn delete ." + path 273 command = "svn delete ." + path
274 print command 274 print command
275 os.system(command) 275 os.system(command)
276 276
277 def revertRevision(url, revision): 277 def revertRevision(url, revision):
278 paths = getBestMergePaths(url, revision) 278 command = ('svn merge --ignore-ancestry -c -%d %s .' % (revision, url))
279 for path in paths: 279 print command
280 command = ('svn merge -N -r ' + str(revision) + ":" + str(revision-1) + 280 os.system(command)
281 " " + url + path + " ." + path)
282 print command
283 os.system(command)
284 281
285 def getFileInfo(url, revision): 282 def getFileInfo(url, revision):
286 global files_info_ 283 global files_info_
287 284
288 if (files_info_ != None): 285 if (files_info_ != None):
289 return files_info_ 286 return files_info_
290 287
291 svn_log = subprocess2.check_output( 288 svn_log = subprocess2.check_output(
292 ['svn', 'log', url, '-r', str(revision), '-v']).splitlines() 289 ['svn', 'log', url, '-r', str(revision), '-v']).splitlines()
293 290
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 705
709 if options.branch and options.milestone: 706 if options.branch and options.milestone:
710 option_parser.error("--branch cannot be used with --milestone") 707 option_parser.error("--branch cannot be used with --milestone")
711 return 1 708 return 1
712 709
713 return drover(options, args) 710 return drover(options, args)
714 711
715 712
716 if __name__ == "__main__": 713 if __name__ == "__main__":
717 sys.exit(main()) 714 sys.exit(main())
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