23
23
from bzrlib.symbol_versioning import (deprecated_function,
26
from bzrlib.trace import warning
27
28
# TODO: when showing single-line logs, truncate to the width of the terminal
28
29
# if known, but only if really going to the terminal (not into a file)
100
102
If not None it must be a RevisionSpec list.
101
103
If one revision show compared it with working tree.
102
104
If two revisions show status between first and second.
105
:param short: If True, gives short SVN-style status lines
104
107
if show_unchanged is not None:
105
108
warn("show_status_trees with show_unchanged has been deprecated "
134
139
specific_files=specific_files)
135
140
delta.show(to_file,
136
141
show_ids=show_ids,
137
show_unchanged=show_unchanged)
139
list_paths('unknown', new.unknowns(), specific_files, to_file)
142
show_unchanged=show_unchanged,
144
short_status_letter = '?'
146
short_status_letter = ''
147
list_paths('unknown', new.unknowns(), specific_files, to_file,
140
149
conflict_title = False
141
150
# show the new conflicts only for now. XXX: get them from the delta.
142
151
for conflict in new.conflicts():
143
if conflict_title is False:
152
if not short and conflict_title is False:
144
153
print >> to_file, "conflicts:"
145
154
conflict_title = True
146
print >> to_file, " %s" % conflict
159
print >> to_file, "%s %s" % (prefix, conflict)
147
160
if new_is_working_tree and show_pending:
148
show_pending_merges(new, to_file)
161
show_pending_merges(new, to_file, short)
152
def show_pending_merges(new, to_file):
165
def show_pending_merges(new, to_file, short=False):
153
166
"""Write out a display of pending merges in a working tree."""
154
167
parents = new.get_parent_ids()
155
168
if len(parents) < 2:
157
170
pending = parents[1:]
158
171
branch = new.branch
159
172
last_revision = parents[0]
160
print >>to_file, 'pending merges:'
174
print >>to_file, 'pending merges:'
161
175
if last_revision is not None:
163
177
ignore = set(branch.repository.get_ancestry(last_revision))
175
189
from bzrlib.osutils import terminal_width
176
190
width = terminal_width()
177
191
m_revision = branch.repository.get_revision(merge)
178
print >> to_file, ' ', line_log(m_revision, width - 3)
196
print >> to_file, prefix, line_log(m_revision, width - 4)
179
197
inner_merges = branch.repository.get_ancestry(merge)
180
198
assert inner_merges[0] is None
181
199
inner_merges.pop(0)
184
202
if mmerge in ignore:
186
204
mm_revision = branch.repository.get_revision(mmerge)
187
print >> to_file, ' ', line_log(mm_revision, width - 5)
209
print >> to_file, prefix, line_log(mm_revision, width - 5)
188
210
ignore.add(mmerge)
189
211
except errors.NoSuchRevision:
190
print >> to_file, ' ', merge
216
print >> to_file, prefix, merge
192
def list_paths(header, paths, specific_files, to_file):
218
def list_paths(header, paths, specific_files, to_file, short_status_letter=''):
193
219
done_header = False
194
220
for path in paths:
195
221
if specific_files and not is_inside_any(specific_files, path):
223
if not short_status_letter and not done_header:
198
224
print >>to_file, '%s:' % header
199
225
done_header = True
200
print >>to_file, ' ', path
226
print >>to_file, '%s %s' % (short_status_letter, path)