926
def show_status(self, show_all=False, file_list=None):
927
"""Display single-line status for non-ignored working files.
929
The list is show sorted in order by file name.
931
>>> b = ScratchBranch(files=['foo', 'foo~'])
937
>>> b.commit("add foo")
939
>>> os.unlink(b.abspath('foo'))
943
self._need_readlock()
945
# We have to build everything into a list first so that it can
946
# sorted by name, incorporating all the different sources.
948
# FIXME: Rather than getting things in random order and then sorting,
949
# just step through in order.
951
# Interesting case: the old ID for a file has been removed,
952
# but a new file has been created under that name.
954
old = self.basis_tree()
955
new = self.working_tree()
957
items = diff_trees(old, new)
958
# We want to filter out only if any file was provided in the file_list.
959
if isinstance(file_list, list) and len(file_list):
960
items = [item for item in items if item[3] in file_list]
962
for fs, fid, oldname, newname, kind in items:
964
show_status(fs, kind,
965
oldname + ' => ' + newname)
966
elif fs == 'A' or fs == 'M':
967
show_status(fs, kind, newname)
969
show_status(fs, kind, oldname)
972
show_status(fs, kind, newname)
975
show_status(fs, kind, newname)
977
show_status(fs, kind, newname)
979
bailout("weird file state %r" % ((fs, fid),))
983
927
class ScratchBranch(Branch):
984
928
"""Special test class: a branch that cleans up after itself.