# HG changeset patch # User Patrick Mezard # Date 1347691082 -7200 # Node ID 2ee7281e5aaa763442dfb017d096ba6b01f373e0 # Parent cd73bbc99bdc69ae471e4230a0cc30eea23cc485 wireproto: fix check-code.py breakage introduced by 6d97dd630d79 diff -r cd73bbc99bdc -r 2ee7281e5aaa mercurial/wireproto.py --- a/mercurial/wireproto.py Sat Sep 15 00:06:08 2012 +0400 +++ b/mercurial/wireproto.py Sat Sep 15 08:38:02 2012 +0200 @@ -558,7 +558,12 @@ # partially encode name over the wire for backwards compat yield '%s\0%d\n' % (store.encodedir(name), size) if size <= 65536: - yield sopener(name).read(size) + fp = sopener(name) + try: + data = fp.read(size) + finally: + fp.close() + yield data else: for chunk in util.filechunkiter(sopener(name), limit=size): yield chunk diff -r cd73bbc99bdc -r 2ee7281e5aaa tests/test-check-code-hg.t --- a/tests/test-check-code-hg.t Sat Sep 15 00:06:08 2012 +0400 +++ b/tests/test-check-code-hg.t Sat Sep 15 08:38:02 2012 +0200 @@ -6,10 +6,6 @@ > exit 80 > fi $ hg manifest | xargs "$check_code" || echo 'FAILURE IS NOT AN OPTION!!!' - mercurial/wireproto.py:562: - > yield sopener(name).read(size) - use opener.read() instead - FAILURE IS NOT AN OPTION!!! $ hg manifest | xargs "$check_code" --warnings --nolineno --per-file=0 || true hgext/convert/cvsps.py:0: @@ -163,9 +159,6 @@ mercurial/commands.py:0: > ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no')) warning: unwrapped ui message - mercurial/wireproto.py:0: - > yield sopener(name).read(size) - use opener.read() instead tests/autodiff.py:0: > ui.write('data lost for: %s\n' % fn) warning: unwrapped ui message