--- a/mercurial/commands.py Thu Jan 14 22:49:03 2016 -0800
+++ b/mercurial/commands.py Thu Jan 14 21:27:53 2016 -0800
@@ -2012,8 +2012,7 @@
norepo=True)
def debugbundle(ui, bundlepath, all=None, **opts):
"""lists the contents of a bundle"""
- f = hg.openpath(ui, bundlepath)
- try:
+ with hg.openpath(ui, bundlepath) as f:
gen = exchange.readbundle(ui, f, bundlepath)
if isinstance(gen, bundle2.unbundle20):
return _debugbundle2(ui, gen, all=all, **opts)
@@ -2060,8 +2059,6 @@
node = chunkdata['node']
ui.write("%s\n" % hex(node))
chain = node
- finally:
- f.close()
def _debugbundle2(ui, gen, **opts):
"""lists the contents of a bundle2"""