##// END OF EJS Templates
Fix troubles with clone and exception handling...
mpm@selenic.com -
r503:c6a2e41c default
parent child Browse files
Show More
@@ -273,7 +273,7 b' def clone(ui, source, dest = None, **opt'
273
273
274 if source in paths: source = paths[source]
274 if source in paths: source = paths[source]
275
275
276 created = False
276 created = success = False
277
277
278 if dest is None:
278 if dest is None:
279 dest = os.getcwd()
279 dest = os.getcwd()
@@ -314,12 +314,15 b' def clone(ui, source, dest = None, **opt'
314
314
315 if not opts['no-update']:
315 if not opts['no-update']:
316 update(ui, repo)
316 update(ui, repo)
317 except:
317
318 if created:
318 success = True
319
320 finally:
321 if not success:
322 del repo
319 import shutil
323 import shutil
320 shutil.rmtree(dest, True)
324 shutil.rmtree(dest, True)
321 raise
325
322
323 def commit(ui, repo, *files, **opts):
326 def commit(ui, repo, *files, **opts):
324 """commit the specified files or all outstanding changes"""
327 """commit the specified files or all outstanding changes"""
325 text = opts['text']
328 text = opts['text']
@@ -904,5 +907,6 b' def dispatch(args):'
904 u.debug(inst, "\n")
907 u.debug(inst, "\n")
905 u.warn("%s: invalid arguments\n" % i[0].__name__)
908 u.warn("%s: invalid arguments\n" % i[0].__name__)
906 help(u, cmd)
909 help(u, cmd)
907 sys.exit(-1)
908
910
911 sys.exit(-1)
912
@@ -43,5 +43,7 b' class lock:'
43 def release(self):
43 def release(self):
44 if self.held:
44 if self.held:
45 self.held = 0
45 self.held = 0
46 os.unlink(self.f)
46 try:
47 os.unlink(self.f)
48 except: pass
47
49
@@ -1,11 +1,8 b''
1 #!/bin/bash
1 #!/bin/bash -x
2
2
3 hg clone http://localhost:20059/ copy
3 hg clone http://localhost:20059/ copy
4 cd copy
4 echo $?
5 hg verify
5 ls copy
6 hg co
7 cat foo
8 hg manifest
9
6
10 cat > dumb.py <<EOF
7 cat > dumb.py <<EOF
11 import BaseHTTPServer, SimpleHTTPServer, signal
8 import BaseHTTPServer, SimpleHTTPServer, signal
@@ -23,10 +20,7 b' EOF'
23 python dumb.py 2>/dev/null &
20 python dumb.py 2>/dev/null &
24
21
25 hg clone http://localhost:20059/foo copy2
22 hg clone http://localhost:20059/foo copy2
26 cd copy2
23 echo $?
27 hg verify
28 hg co
29 cat foo
30 hg manifest
31
24
25 set +x
32 kill $!
26 kill $!
@@ -1,22 +1,25 b''
1 + hg clone http://localhost:20059/ copy
1 requesting all changes
2 requesting all changes
2 adding changesets
3 adding changesets
3 abort: error 111: Connection refused
4 abort: error 111: Connection refused
4 transaction abort!
5 transaction abort!
6 failed to truncate 00changelog.d
7 failed to truncate 00changelog.i
5 rollback completed
8 rollback completed
6 checking changesets
9 + echo 255
7 checking manifests
10 255
8 crosschecking files in changesets and manifests
11 + ls copy
9 checking files
12 ls: copy: No such file or directory
10 0 files, 0 changesets, 0 total revisions
13 + cat
11 cat: foo: No such file or directory
14 + python dumb.py
15 + hg clone http://localhost:20059/foo copy2
12 requesting all changes
16 requesting all changes
13 adding changesets
17 adding changesets
14 abort: HTTP Error 404: File not found
18 abort: HTTP Error 404: File not found
15 transaction abort!
19 transaction abort!
20 failed to truncate 00changelog.d
21 failed to truncate 00changelog.i
16 rollback completed
22 rollback completed
17 checking changesets
23 + echo 255
18 checking manifests
24 255
19 crosschecking files in changesets and manifests
25 + set +x
20 checking files
21 0 files, 0 changesets, 0 total revisions
22 cat: foo: No such file or directory
General Comments 0
You need to be logged in to leave comments. Login now