ls --non-recursive PATH : no list

Bug #158690 reported by KISS, Zoltán
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

BZR on Win XP ENG Prof

C:\ZOLI\bzr_teszt\subdir>bzr ls ./
./bzr_commands.txt
./bzr_hidden_commands.txt
./bzr_plugin_list.txt

C:\ZOLI\bzr_teszt\subdir>bzr ls --non-recursive
bzr_commands.txt
bzr_hidden_commands.txt
bzr_plugin_list.txt

C:\ZOLI\bzr_teszt\subdir>bzr ls --non-recursive ./
/////// NO LIST /////////

Bazaar (bzr) 0.90.0 Python interpreter: C:\Program Files\Bazaar\bzr.exe 2.5.1.final.0

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.

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.