Index: drover.py |
=================================================================== |
--- drover.py (revision 179378) |
+++ drover.py (working copy) |
@@ -169,7 +169,7 @@ |
else: |
return False |
-def checkoutRevision(url, revision, branch_url, revert=False): |
+def checkoutRevision(url, revision, branch_url, revert=False, pop=True): |
files_info = getFileInfo(url, revision) |
paths = getBestMergePaths2(files_info, revision) |
export_map = getBestExportPathsMap2(files_info, revision) |
@@ -194,7 +194,8 @@ |
print "Exclude new directory " + path |
continue |
subpaths = path.split('/') |
- subpaths.pop(0) |
+ if pop: |
+ subpaths.pop(0) |
M-A Ruel
2013/01/29 23:04:10
Could you add a one line comment why it's done? I
|
base = '' |
for subpath in subpaths: |
base += '/' + subpath |
@@ -516,6 +517,9 @@ |
url = BRANCH_URL.replace("$branch", options.branch) |
elif options.merge and options.sbranch: |
url = BRANCH_URL.replace("$branch", options.sbranch) |
+ elif options.revert and options.url: |
+ url = options.url |
+ file_pattern_ = r"[ ]+([MADUC])[ ]+((/.*)/(.*))" |
else: |
url = TRUNK_URL |
@@ -563,7 +567,8 @@ |
action = "Revert" |
if options.branch: |
url = BRANCH_URL.replace("$branch", options.branch) |
- checkoutRevision(url, revision, url, True) |
+ pop_em = (options.url == None or options.url == '') |
M-A Ruel
2013/01/29 23:04:10
pop_em = not options.url
|
+ checkoutRevision(url, revision, url, True, pop_em) |
revertRevision(url, revision) |
revertExportRevision(url, revision) |
@@ -647,6 +652,8 @@ |
help='Revision to revert') |
option_parser.add_option('-w', '--workdir', |
help='subdir to use for the revert') |
+ option_parser.add_option('-u', '--url', |
+ help='svn url to use for the revert') |
option_parser.add_option('-a', '--auditor', |
help='overrides the author for reviewer') |
option_parser.add_option('', '--revertbot', action='store_true', |