archive: wrap the ui descriptor so it doesn't get closed stable
authorIdan Kamara <idankk86@gmail.com>
Fri, 24 Jun 2011 17:04:37 +0300
branchstable
changeset 14742 271424fdbeec
parent 14741 39235b398248
child 14743 84a680daa4b2
archive: wrap the ui descriptor so it doesn't get closed archival.tarit closes the fileobj if one is passed to it, which is undesired when reading from '-'.
mercurial/commands.py
--- a/mercurial/commands.py	Fri Jun 24 19:27:53 2011 +0300
+++ b/mercurial/commands.py	Fri Jun 24 17:04:37 2011 +0300
@@ -337,7 +337,7 @@
     if dest == '-':
         if kind == 'files':
             raise util.Abort(_('cannot archive plain files to stdout'))
-        dest = ui.fout
+        dest = cmdutil.makefileobj(repo, dest)
         if not prefix:
             prefix = os.path.basename(repo.root) + '-%h'