##// END OF EJS Templates
with: use context manager for transaction in consumev1
Bryan O'Sullivan -
r27870:ed9950ba default
parent child Browse files
Show More
@@ -297,8 +297,7 b' def consumev1(repo, fp, filecount, bytec'
297 297 repo.ui.progress(_('clone'), 0, total=bytecount)
298 298 start = time.time()
299 299
300 tr = repo.transaction('clone')
301 try:
300 with repo.transaction('clone'):
302 301 for i in xrange(filecount):
303 302 # XXX doesn't support '\n' or '\r' in filenames
304 303 l = fp.readline()
@@ -318,9 +317,6 b' def consumev1(repo, fp, filecount, bytec'
318 317 repo.ui.progress(_('clone'), handled_bytes,
319 318 total=bytecount)
320 319 ofp.write(chunk)
321 tr.close()
322 finally:
323 tr.release()
324 320
325 321 # Writing straight to files circumvented the inmemory caches
326 322 repo.invalidate()
General Comments 0
You need to be logged in to leave comments. Login now