Skip to content
Browse files

Use shell.rmtree

* svn2svn/run/svn2svn.py: Use svn2svn.shell.rmtree rather than
shutil.rmtree, to fix Windows-compatibility issues.
  • Loading branch information...
1 parent 42717df commit e62e792e8212db7102fde1b9011e4500a51f3496 @tonyduckles committed Apr 6, 2012
Showing with 5 additions and 6 deletions.
  1. +5 −6 svn2svn/run/svn2svn.py
View
11 svn2svn/run/svn2svn.py
@@ -4,6 +4,7 @@
from .. import base_version, full_version
from .. import ui
+from .. import shell
from .. import svnclient
from ..shell import run_svn,run_shell_command
from ..errors import (ExternalCommandFailed, UnsupportedSVNAction, InternalError, VerificationError)
@@ -12,9 +13,7 @@
import sys
import os
-import time
import traceback
-import shutil
import operator
import optparse
import re
@@ -364,7 +363,7 @@ def full_svn_revert():
if os.path.isfile(path):
os.remove(path)
if os.path.isdir(path):
- shutil.rmtree(path)
+ shell.rmtree(path)
def gen_tracking_revprops(source_rev):
"""
@@ -937,7 +936,7 @@ def keep_revnum(source_rev, target_rev_last, wc_target_tmp):
if int(target_rev_last) < int(source_rev)-1:
# Add "padding" target revisions to keep source and target rev #'s identical
if os.path.exists(wc_target_tmp):
- shutil.rmtree(wc_target_tmp)
+ shell.rmtree(wc_target_tmp)
run_svn(["checkout", "-r", "HEAD", "--depth=empty", target_repos_url, wc_target_tmp])
for rev_num in range(int(target_rev_last)+1, int(source_rev)):
run_svn(["propset", "svn2svn:keep-revnum", rev_num, wc_target_tmp])
@@ -953,7 +952,7 @@ def keep_revnum(source_rev, target_rev_last, wc_target_tmp):
if bh.trapped:
raise KeyboardInterrupt
target_rev_last = rev_num
- shutil.rmtree(wc_target_tmp)
+ shell.rmtree(wc_target_tmp)
return target_rev_last
def disp_svn_log_summary(log_entry):
@@ -1013,7 +1012,7 @@ def real_main(args):
# Check out a working copy of target_url if needed
wc_exists = os.path.exists(wc_target)
if wc_exists and not options.cont_from_break:
- shutil.rmtree(wc_target)
+ shell.rmtree(wc_target)
wc_exists = False
if not wc_exists:
ui.status("Checking-out _wc_target...", level=ui.VERBOSE)

0 comments on commit e62e792

Please sign in to comment.
Something went wrong with that request. Please try again.