"bzr ls FILE" gives exception if branch has no tree

Bug #492116 reported by GuilhemBichot on 2009-12-03
46
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Gary van der Merwe

Bug Description

bzr branch https://code.launchpad.net/~mysql/mysql-server/mysql-5.1 mysql-5.1
cd mysql-5.1
bzr ls README
bzr: ERROR: [Errno 20] N'est pas un dossier: '/home/mysql_src/bzrrepos/mysql-5.1/README'
(the French text means it's not a directory).
That is a surprising error; I thought "bzr ls" would imitate "ls", and "ls" works on a file, is not restricted to a directory. By typing such "bzr ls FILE" one could expect seeing the file's existence.
Anyway, even if the error is correct: if I run the same command in a branch created with --no-tree, I get:
Traceback:
 Traceback (most recent call last):
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/commands.py", line 842, in exception_to_return_code
     return the_callable(*args, **kwargs)
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/commands.py", line 1037, in run_bzr
     ret = run(*run_argv)
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/commands.py", line 654, in run_argv_aliases
     return self.run(**all_cmd_args)
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/commands.py", line 1052, in ignore_pipe
     result = func(*args, **kwargs)
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/builtins.py", line 2518, in run
     from_dir=relpath, recursive=recursive):
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/revisiontree.py", line 132, in list_files
     for path, entry in entries:
   File "/home/mysql_src/logiciels/bzr_versions/bzr.dev/bzrlib/inventory.py", line 789, in iter_entries
     children = from_dir.children.items()
 AttributeError: children

Bazaar (bzr) 2.1.0dev3
  from bzr checkout /home/mysql_src/logiciels/bzr_versions/bzr.dev
    revision: 4782
    revid: <email address hidden>

Related branches

Martin Pool (mbp) on 2009-12-04
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
description: updated
Changed in bzr:
assignee: nobody → Gary van der Merwe (garyvdm)
status: Confirmed → In Progress
GuilhemBichot (guilhem-bichot) wrote :

hello Gary. Does the associated branch fix the two problems stated originally:
1) "bzr ls FILE" does not work if FILE is a directory
2) it even gives an exception if tree had --no-tree
?

On 11/01/2011 15:09, GuilhemBichot wrote:
> hello Gary. Does the associated branch fix the two problems stated originally:
> 1) "bzr ls FILE" does not work if FILE is a directory
> 2) it even gives an exception if tree had --no-tree
> ?

Yes. It makes 'bzr ls FILE' list the file, and it works if there is no tree.

Jelmer Vernooij (jelmer) on 2011-12-16
tags: added: ls
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers