830
830
# TODO: Take a revision or remote path and list that tree instead.
832
takes_options = ['verbose', 'revision',
833
Option('non-recursive',
834
help='don\'t recurse into sub-directories'),
836
help='Print all paths from the root of the branch.'),
837
Option('unknown', help='Print unknown files'),
838
Option('versioned', help='Print versioned files'),
839
Option('ignored', help='Print ignored files'),
841
Option('null', help='Null separate the files'),
833
def run(self, revision=None, verbose=False):
834
b, relpath = Branch.open_containing('.')[0]
844
def run(self, revision=None, verbose=False,
845
non_recursive=False, from_root=False,
846
unknown=False, versioned=False, ignored=False,
850
raise BzrCommandError('Cannot set both --verbose and --null')
851
all = not (unknown or versioned or ignored)
853
selection = {'I':ignored, '?':unknown, 'V':versioned}
855
b, relpath = Branch.open_containing('.')
835
860
if revision == None:
836
861
tree = b.working_tree()
838
tree = b.revision_tree(revision.in_history(b).rev_id)
863
tree = b.revision_tree(revision[0].in_history(b).rev_id)
839
864
for fp, fc, kind, fid, entry in tree.list_files():
841
kindch = entry.kind_character()
842
print '%-8s %s%s' % (fc, fp, kindch)
865
if fp.startswith(relpath):
866
fp = fp[len(relpath):]
867
if non_recursive and '/' in fp:
869
if not all and not selection[fc]:
872
kindch = entry.kind_character()
873
print '%-8s %s%s' % (fc, fp, kindch)
876
sys.stdout.write('\0')