Comment 1 for bug 158690

Revision history for this message
John A Meinel (jameinel) wrote :

Confirmed here. This isn't platform specific.
Doing:
bzr ls --non-recursive .

The code is doing:
            for fp, fc, fkind, fid, entry in tree.list_files(include_root=False):
                if fp.startswith(relpath):
                    fp = osutils.pathjoin(prefix, fp[len(relpath):])
                    if non_recursive and '/' in fp:
                        continue
                    if not all and not selection[fc]:
                        continue

'cd PATH; bzr ls --non-recursive' works because the prefix is '', so it doesn't add a '/'.
We could do:
max_count = 0
if prefix:
  max_count = 1
if non_recursive and fp.count('/') > max_count:
  continue

So that if there is a 'prefix' we allow a single '/', otherwise 0 '/'.

It has been that way for a long time. It seems not many people use ls --non-recursive.