Mercurial > hg
changeset 27896:1d29893240cc
streamclone: indent code
This will make the subsequent patch easier to read.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 02 Jan 2016 16:11:36 -0800 |
parents | 2d6a89e79b48 |
children | 2fdbf22a1b63 |
files | mercurial/streamclone.py |
diffstat | 1 files changed, 20 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/streamclone.py Thu Jan 14 13:34:59 2016 -0800 +++ b/mercurial/streamclone.py Sat Jan 02 16:11:36 2016 -0800 @@ -298,25 +298,26 @@ start = time.time() with repo.transaction('clone'): - for i in xrange(filecount): - # XXX doesn't support '\n' or '\r' in filenames - l = fp.readline() - try: - name, size = l.split('\0', 1) - size = int(size) - except (ValueError, TypeError): - raise error.ResponseError( - _('unexpected response from remote server:'), l) - if repo.ui.debugflag: - repo.ui.debug('adding %s (%s)\n' % - (name, util.bytecount(size))) - # for backwards compat, name was partially encoded - with repo.svfs(store.decodedir(name), 'w') as ofp: - for chunk in util.filechunkiter(fp, limit=size): - handled_bytes += len(chunk) - repo.ui.progress(_('clone'), handled_bytes, - total=bytecount) - ofp.write(chunk) + if True: + for i in xrange(filecount): + # XXX doesn't support '\n' or '\r' in filenames + l = fp.readline() + try: + name, size = l.split('\0', 1) + size = int(size) + except (ValueError, TypeError): + raise error.ResponseError( + _('unexpected response from remote server:'), l) + if repo.ui.debugflag: + repo.ui.debug('adding %s (%s)\n' % + (name, util.bytecount(size))) + # for backwards compat, name was partially encoded + with repo.svfs(store.decodedir(name), 'w') as ofp: + for chunk in util.filechunkiter(fp, limit=size): + handled_bytes += len(chunk) + repo.ui.progress(_('clone'), handled_bytes, + total=bytecount) + ofp.write(chunk) # Writing straight to files circumvented the inmemory caches repo.invalidate()