100
107
If not None it must be a RevisionSpec list.
101
108
If one revision show compared it with working tree.
102
109
If two revisions show status between first and second.
110
:param short: If True, gives short SVN-style status lines.
111
:param versioned: If True, only shows versioned files.
104
113
if show_unchanged is not None:
105
114
warn("show_status_trees with show_unchanged has been deprecated "
129
140
raise errors.BzrCommandError(str(e))
132
_raise_if_nonexistent(specific_files, old, new)
133
delta = new.changes_from(old, want_unchanged=show_unchanged,
134
specific_files=specific_files)
137
show_unchanged=show_unchanged)
139
list_paths('unknown', new.unknowns(), specific_files, to_file)
140
conflict_title = False
141
# show the new conflicts only for now. XXX: get them from the delta.
142
for conflict in new.conflicts():
143
if conflict_title is False:
144
print >> to_file, "conflicts:"
145
conflict_title = True
146
print >> to_file, " %s" % conflict
147
if new_is_working_tree and show_pending:
148
show_pending_merges(new, to_file)
146
_raise_if_nonexistent(specific_files, old, new)
147
want_unversioned = not versioned
149
changes = new._iter_changes(old, show_unchanged, specific_files,
150
require_versioned=False, want_unversioned=want_unversioned)
151
reporter = _mod_delta._ChangeReporter(output_file=to_file,
152
unversioned_filter=new.is_ignored)
153
_mod_delta.report_changes(changes, reporter)
155
delta = new.changes_from(old, want_unchanged=show_unchanged,
156
specific_files=specific_files,
157
want_unversioned=want_unversioned)
158
# filter out unknown files. We may want a tree method for
160
delta.unversioned = [unversioned for unversioned in
161
delta.unversioned if not new.is_ignored(unversioned[0])]
164
show_unchanged=show_unchanged,
166
conflict_title = False
167
# show the new conflicts only for now. XXX: get them from the delta.
168
for conflict in new.conflicts():
169
if not short and conflict_title is False:
170
print >> to_file, "conflicts:"
171
conflict_title = True
176
print >> to_file, "%s %s" % (prefix, conflict)
177
if new_is_working_tree and show_pending:
178
show_pending_merges(new, to_file, short)
152
def show_pending_merges(new, to_file):
185
def show_pending_merges(new, to_file, short=False):
153
186
"""Write out a display of pending merges in a working tree."""
154
187
parents = new.get_parent_ids()
155
188
if len(parents) < 2:
157
190
pending = parents[1:]
158
191
branch = new.branch
159
192
last_revision = parents[0]
160
print >>to_file, 'pending merges:'
194
print >>to_file, 'pending merges:'
161
195
if last_revision is not None:
163
ignore = set(branch.repository.get_ancestry(last_revision))
197
ignore = set(branch.repository.get_ancestry(last_revision,
164
199
except errors.NoSuchRevision:
165
200
# the last revision is a ghost : assume everything is new
175
210
from bzrlib.osutils import terminal_width
176
211
width = terminal_width()
177
212
m_revision = branch.repository.get_revision(merge)
178
print >> to_file, ' ', line_log(m_revision, width - 3)
217
print >> to_file, prefix, line_log(m_revision, width - 4)
179
218
inner_merges = branch.repository.get_ancestry(merge)
180
219
assert inner_merges[0] is None
181
220
inner_merges.pop(0)
184
223
if mmerge in ignore:
186
225
mm_revision = branch.repository.get_revision(mmerge)
187
print >> to_file, ' ', line_log(mm_revision, width - 5)
230
print >> to_file, prefix, line_log(mm_revision, width - 5)
188
231
ignore.add(mmerge)
189
232
except errors.NoSuchRevision:
190
print >> to_file, ' ', merge
192
def list_paths(header, paths, specific_files, to_file):
195
if specific_files and not is_inside_any(specific_files, path):
198
print >>to_file, '%s:' % header
200
print >>to_file, ' ', path
237
print >> to_file, prefix, merge