##// END OF EJS Templates
on clone failure, only remove directories we created...
Steve Borho -
r7935:39566bb9 default
parent child Browse files
Show More
@@ -168,10 +168,14 b' def clone(ui, source, dest=None, pull=Fa'
168 168 copy = False
169 169
170 170 if copy:
171 hgdir = os.path.realpath(os.path.join(dest, ".hg"))
171 172 if not os.path.exists(dest):
172 173 os.mkdir(dest)
174 else:
175 # only clean up directories we create ourselves
176 dir_cleanup.dir_ = hgdir
173 177 try:
174 dest_path = os.path.realpath(os.path.join(dest, ".hg"))
178 dest_path = hgdir
175 179 os.mkdir(dest_path)
176 180 except OSError, inst:
177 181 if inst.errno == errno.EEXIST:
@@ -49,4 +49,17 b' echo stuff > a/a'
49 49 hg clone q a
50 50 echo $?
51 51
52 # leave existing directory in place after clone failure
53 hg init c
54 cd c
55 echo c > c
56 hg commit -A -m test -d '0 0'
57 chmod -rx .hg/store/data
58 cd ..
59 mkdir d
60 hg clone c d 2> err
61 echo $?
62 test -d d && echo "dir is still here" || echo "dir is gone"
63 test -d d/.hg && echo "repo is still here" || echo "repo is gone"
64
52 65 true
@@ -12,3 +12,7 b' destination directory: q'
12 12 abort: destination 'q' is not empty
13 13 abort: destination 'a' is not empty
14 14 255
15 adding c
16 255
17 dir is still here
18 repo is gone
General Comments 0
You need to be logged in to leave comments. Login now