##// END OF EJS Templates
largefiles: use try/except/finally
Matt Mackall -
r25079:bee00e0c default
parent child Browse files
Show More
@@ -578,7 +578,6 def overridecopy(orig, ui, repo, pats, o
578 578 nolfiles = False
579 579 installnormalfilesmatchfn(repo[None].manifest())
580 580 try:
581 try:
582 581 result = orig(ui, repo, pats, opts, rename)
583 582 except util.Abort, e:
584 583 if str(e) != _('no files to copy'):
@@ -608,7 +607,6 def overridecopy(orig, ui, repo, pats, o
608 607 os.makedirs(makestandin(dest))
609 608
610 609 try:
611 try:
612 610 # When we call orig below it creates the standins but we don't add
613 611 # them to the dir state until later so lock during that time.
614 612 wlock = repo.wlock()
@@ -31,7 +31,6 def putlfile(repo, proto, sha):
31 31 tmpfp = util.atomictempfile(path, createmode=repo.store.createmode)
32 32
33 33 try:
34 try:
35 34 proto.getfile(tmpfp)
36 35 tmpfp._fp.seek(0)
37 36 if sha != lfutil.hexsha1(tmpfp._fp):
@@ -36,13 +36,12 class remotestore(basestore.basestore):
36 36 self.ui.debug('remotestore: sendfile(%s, %s)\n' % (filename, hash))
37 37 fd = None
38 38 try:
39 try:
40 39 fd = lfutil.httpsendfile(self.ui, filename)
40 return self._put(hash, fd)
41 41 except IOError, e:
42 42 raise util.Abort(
43 43 _('remotestore: could not open file %s: %s')
44 44 % (filename, str(e)))
45 return self._put(hash, fd)
46 45 finally:
47 46 if fd:
48 47 fd.close()
General Comments 0
You need to be logged in to leave comments. Login now