~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-02-06 19:35:45 UTC
  • mfrom: (1551.10.12 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070206193545-d5eac67ff047ce5c
Change status --short output to use ChangeReporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import sys
18
18
 
 
19
from bzrlib import (
 
20
    delta as _mod_delta,
 
21
    tree,
 
22
    )
19
23
from bzrlib.diff import _raise_if_nonexistent
20
24
import bzrlib.errors as errors
21
25
from bzrlib.log import line_log
135
139
            else:
136
140
                new = wt
137
141
        _raise_if_nonexistent(specific_files, old, new)
138
 
        delta = new.changes_from(old, want_unchanged=show_unchanged,
139
 
                              specific_files=specific_files)
140
 
        delta.show(to_file,
141
 
                   show_ids=show_ids,
142
 
                   show_unchanged=show_unchanged,
143
 
                   short_status=short)
144
 
        short_status_letter = '?'
 
142
        if short:
 
143
            specific_file_ids = tree.find_ids_across_trees(specific_files,
 
144
                (old, new), require_versioned=False)
 
145
            changes = new._iter_changes(old, show_unchanged,
 
146
                                        specific_file_ids)
 
147
            reporter = _mod_delta.ChangeReporter(old.inventory,
 
148
                output_file=to_file)
 
149
            _mod_delta.report_changes(changes, reporter)
 
150
        else:
 
151
            delta = new.changes_from(old, want_unchanged=show_unchanged,
 
152
                                  specific_files=specific_files)
 
153
            delta.show(to_file,
 
154
                       show_ids=show_ids,
 
155
                       show_unchanged=show_unchanged,
 
156
                       short_status=short)
 
157
        short_status_letter = '? '
145
158
        if not short:
146
159
            short_status_letter = ''
147
160
        list_paths('unknown', new.unknowns(), specific_files, to_file,
153
166
                print >> to_file, "conflicts:"
154
167
                conflict_title = True
155
168
            if short:
156
 
                prefix = 'C '
 
169
                prefix = 'C  '
157
170
            else:
158
171
                prefix = ' '
159
172
            print >> to_file, "%s %s" % (prefix, conflict)
190
203
            width = terminal_width()
191
204
            m_revision = branch.repository.get_revision(merge)
192
205
            if short:
193
 
                prefix = 'P '
 
206
                prefix = 'P  '
194
207
            else:
195
208
                prefix = ' '
196
209
            print >> to_file, prefix, line_log(m_revision, width - 4)
203
216
                    continue
204
217
                mm_revision = branch.repository.get_revision(mmerge)
205
218
                if short:
206
 
                    prefix = 'P. '
 
219
                    prefix = 'P.  '
207
220
                else:
208
221
                    prefix = '   '
209
222
                print >> to_file, prefix, line_log(mm_revision, width - 5)
210
223
                ignore.add(mmerge)
211
224
        except errors.NoSuchRevision:
212
225
            if short:
213
 
                prefix = 'P '
 
226
                prefix = 'P  '
214
227
            else:
215
228
                prefix = ' '
216
229
            print >> to_file, prefix, merge