[PATCH] export: only close files which export itself has opened
mpm at selenic.com
Wed Feb 23 15:13:37 CST 2011
On Thu, 2011-02-24 at 02:03 +0500, Waqas Hussain wrote:
> On Thu, Feb 24, 2011 at 1:45 AM, Matt Mackall <mpm at selenic.com> wrote:
> > On Wed, 2011-02-23 at 13:30 +0500, Waqas Hussain wrote:
> >> # HG changeset patch
> >> # User Waqas Hussain <waqas20 at gmail.com>
> >> # Date 1298449315 -18000
> >> # Branch stable
> >> # Node ID 90cc203ee41d5eeeb884e39fbf20c148db9e1b16
> >> # Parent 22f948c027a97e640ae74021dfdfd8014717705d
> >> export: only close files which export itself has opened
> > What bug does this fix?
> cmdutil.export() closes files it hasn't opened. I was passing it an
> output=writable_object, which it used as fp (see cmdutil.make_file(),
> which checks for write() on the object). It attempts to close the
> provided file (make_file() returns it as is).
> This issue was introduced in revision 14f3795a5ed7, and broke
> functionality in tortoisehg. This patch checks to make sure the file
> being closed isn't one it didn't create.
Ok, queued, thanks.
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel