##// END OF EJS Templates
streamclone: indent code...
Gregory Szorc -
r27896:1d298932 default
parent child Browse files
Show More
@@ -298,25 +298,26 b' def consumev1(repo, fp, filecount, bytec'
298 298 start = time.time()
299 299
300 300 with repo.transaction('clone'):
301 for i in xrange(filecount):
302 # XXX doesn't support '\n' or '\r' in filenames
303 l = fp.readline()
304 try:
305 name, size = l.split('\0', 1)
306 size = int(size)
307 except (ValueError, TypeError):
308 raise error.ResponseError(
309 _('unexpected response from remote server:'), l)
310 if repo.ui.debugflag:
311 repo.ui.debug('adding %s (%s)\n' %
312 (name, util.bytecount(size)))
313 # for backwards compat, name was partially encoded
314 with repo.svfs(store.decodedir(name), 'w') as ofp:
315 for chunk in util.filechunkiter(fp, limit=size):
316 handled_bytes += len(chunk)
317 repo.ui.progress(_('clone'), handled_bytes,
318 total=bytecount)
319 ofp.write(chunk)
301 if True:
302 for i in xrange(filecount):
303 # XXX doesn't support '\n' or '\r' in filenames
304 l = fp.readline()
305 try:
306 name, size = l.split('\0', 1)
307 size = int(size)
308 except (ValueError, TypeError):
309 raise error.ResponseError(
310 _('unexpected response from remote server:'), l)
311 if repo.ui.debugflag:
312 repo.ui.debug('adding %s (%s)\n' %
313 (name, util.bytecount(size)))
314 # for backwards compat, name was partially encoded
315 with repo.svfs(store.decodedir(name), 'w') as ofp:
316 for chunk in util.filechunkiter(fp, limit=size):
317 handled_bytes += len(chunk)
318 repo.ui.progress(_('clone'), handled_bytes,
319 total=bytecount)
320 ofp.write(chunk)
320 321
321 322 # Writing straight to files circumvented the inmemory caches
322 323 repo.invalidate()
General Comments 0
You need to be logged in to leave comments. Login now