can't bzr export just a single file rather than a directory

Bug #511987 reported by petitg on 2010-01-24
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Low
Michal Junák

Bug Description

Hi,

I get a crash if I try to bzr export a file (works fine on directories):

bzr export test.tar lib/Generic/
-> works fine (Generic is the root of a repository)

bzr export test.tar lib/Generic/src/
-> works fine (src is a subdir)

bzr export test.tar lib/Generic/Makefile
-> fails (Makefile is a file)

Perhaps export is not intended for files (though it seems like a good idea to export some files as gz/bz2/zip when they are large), in which case the solution would simply be to print an error message to make that clear.

Traceback:

bzr: ERROR: exceptions.AttributeError: children

Traceback (most recent call last):
  File "/[..]/lib64/python/bzrlib/commands.py", line 842, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/[..]/lib64/python/bzrlib/commands.py", line 1037, in run_bzr
    ret = run(*run_argv)
  File "/[..]/lib64/python/bzrlib/commands.py", line 654, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/[..]/lib64/python/bzrlib/builtins.py", line 2751, in run
    export(rev_tree, dest, format, root, subdir, filtered=filters)
  File "/[..]/lib64/python/bzrlib/export/__init__.py", line 102, in export
    return _exporters[format](tree, dest, root, subdir, filtered=filtered)
  File "/[..]/lib64/python/bzrlib/export/__init__.py", line 61, in _loader
    return func(tree, dest, root, subdir, filtered=filtered)
  File "/[..]/lib64/python/bzrlib/export/tar_exporter.py", line 52, in tar_exporter
    for dp, ie in _export_iter_entries(tree, subdir):
  File "/[..]/lib64/python/bzrlib/export/__init__.py", line 151, in _export_iter_entries
    for entry in entries:
  File "/[..]/lib64/python/bzrlib/inventory.py", line 788, in iter_entries
    children = from_dir.children.items()
AttributeError: children

bzr 2.0.4 on python 2.4.3 (Linux-2.6.18-164.9.1.el5-x86_64-with-redhat-5.4-Final)
arguments: ['/[..]/bin/bzr', 'export', 'test.tar', 'lib/Generic/Makefile']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /[..]/lib64/python/bzrlib/plugins/launchpad [2.0.4]
  netrc_credential_store /[..]/lib64/python/bzrlib/plugins/netrc_credential_store [2.0.4]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Version used:

Bazaar (bzr) 2.0.4
  Python interpreter: /usr/bin/python 2.4.3
  Python standard library: /usr/lib64/python2.4
  Platform: Linux-2.6.18-164.9.1.el5-x86_64-with-redhat-5.4-Final

Related branches

Martin Pool (mbp) wrote :

Interesting bug, thanks. Probably easy if you want to try it.

As a workaround you can use 'bzr cat'.

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
tags: added: easy export
Martin Pool (mbp) on 2010-01-27
summary: - bzr export fails on files
+ can't bzr export a single file
Martin Pool (mbp) on 2010-01-27
summary: - can't bzr export a single file
+ can't bzr export just a single file rather than a directory
John A Meinel (jameinel) on 2010-08-06
Changed in bzr:
assignee: nobody → Michal Junák (junak-michal)
milestone: none → 2.2.0
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers