# HG changeset patch # User Patrick Mezard # Date 2010-01-03 19:36:30 # Node ID 3ca8f2ae5fee019ff2e1f46d0332f79241f61d21 # Parent dcaa80294c7934732246b337cfa667276447ef3b # Parent 6e26e3c2083fa67987cca6849bf6f86221c31e7e Merge with crew-stable diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1166,6 +1166,8 @@ def internalpatch(patchobj, ui, strip, c finally: if cwd: os.chdir(curdir) + if fp != patchobj: + fp.close() if ret < 0: raise PatchError return ret > 0