[PATCH] export: only close files which export itself has opened

Matt Mackall mpm at selenic.com
Wed Feb 23 14:45:00 CST 2011


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?

> diff -r 22f948c027a9 -r 90cc203ee41d mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py	Wed Feb 23 00:25:18 2011 +0100
> +++ b/mercurial/cmdutil.py	Wed Feb 23 13:21:55 2011 +0500
> @@ -681,9 +681,10 @@
> 
>          shouldclose = False
>          if not fp:
> -            shouldclose = True
>              fp = make_file(repo, template, node, total=total, seqno=seqno,
>                             revwidth=revwidth, mode='ab')
> +            if fp != template:
> +                shouldclose = True
>          if fp != sys.stdout and hasattr(fp, 'name'):
>              repo.ui.note("%s\n" % fp.name)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list