Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 14742:271424fdbeec stable
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 '-'.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 24 Jun 2011 17:04:37 +0300 |
parents | d83ad13a280e |
children | 6ba51c81ff75 |
comparison
equal
deleted
inserted
replaced
14741:39235b398248 | 14742:271424fdbeec |
---|---|
335 prefix = opts.get('prefix') | 335 prefix = opts.get('prefix') |
336 | 336 |
337 if dest == '-': | 337 if dest == '-': |
338 if kind == 'files': | 338 if kind == 'files': |
339 raise util.Abort(_('cannot archive plain files to stdout')) | 339 raise util.Abort(_('cannot archive plain files to stdout')) |
340 dest = ui.fout | 340 dest = cmdutil.makefileobj(repo, dest) |
341 if not prefix: | 341 if not prefix: |
342 prefix = os.path.basename(repo.root) + '-%h' | 342 prefix = os.path.basename(repo.root) + '-%h' |
343 | 343 |
344 prefix = cmdutil.makefilename(repo, prefix, node) | 344 prefix = cmdutil.makefilename(repo, prefix, node) |
345 matchfn = scmutil.match(ctx, [], opts) | 345 matchfn = scmutil.match(ctx, [], opts) |