95
95
from osutils import format_date
96
96
from errors import BzrCheckError
97
from diff import diff_trees
97
from diff import compare_inventories
98
98
from textui import show_status
99
from inventory import Inventory
100
101
if to_file == None:
114
115
branch._need_readlock()
118
prev_inv = Inventory()
116
119
for revno, revision_id in which_revs():
117
120
print >>to_file, '-' * 60
118
121
print >>to_file, 'revno:', revno
137
140
# Don't show a list of changed files if we were asked about
138
141
# one specific file.
140
if verbose and precursor and not filename:
141
# TODO: Group as added/deleted/renamed instead
142
# TODO: Show file ids
143
print >>to_file, 'changed files:'
144
tree = branch.revision_tree(revision_id)
145
prevtree = branch.revision_tree(precursor)
147
for file_state, fid, old_name, new_name, kind in \
148
diff_trees(prevtree, tree, ):
149
if file_state == 'A' or file_state == 'M':
150
show_status(file_state, kind, new_name)
151
elif file_state == 'D':
152
show_status(file_state, kind, old_name)
153
elif file_state == 'R':
154
show_status(file_state, kind,
155
old_name + ' => ' + new_name)
143
if verbose and not filename:
144
this_inv = branch.get_inventory(rev.inventory_id)
145
delta = compare_inventories(prev_inv, this_inv)
148
print >>to_file, 'removed files:'
149
for path, fid in delta.removed:
150
print >>to_file, ' ' + path
152
print >>to_file, 'added files:'
153
for path, fid in delta.added:
154
print >>to_file, ' ' + path
156
print >>to_file, 'renamed files:'
157
for oldpath, newpath, fid in delta.renamed:
158
print >>to_file, ' %s => %s' % (oldpath, newpath)
160
print >>to_file, 'modified files:'
161
for path, fid in delta.modified:
162
print >>to_file, ' ' + path
157
166
precursor = revision_id