~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/delta.py

Use tweaks for subunit protocol client with --parallel=fork as well as --subunit

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
from bzrlib import (
20
18
    osutils,
21
19
    )
176
174
    """Report changes between two trees"""
177
175
 
178
176
    def __init__(self, output=None, suppress_root_add=True,
179
 
                 output_file=None, unversioned_filter=None, view_info=None,
180
 
                 classify=True):
 
177
                 output_file=None, unversioned_filter=None, view_info=None):
181
178
        """Constructor
182
179
 
183
180
        :param output: a function with the signature of trace.note, i.e.
192
189
        :param view_info: A tuple of view_name,view_files if only
193
190
            items inside a view are to be reported on, or None for
194
191
            no view filtering.
195
 
        :param classify: Add special symbols to indicate file kind.
196
192
        """
197
193
        if output_file is not None:
198
194
            if output is not None:
217
213
                              'unversioned': '?', # versioned in neither
218
214
                              }
219
215
        self.unversioned_filter = unversioned_filter
220
 
        if classify:
221
 
            self.kind_marker = osutils.kind_marker
222
 
        else:
223
 
            self.kind_marker = lambda kind: ''
224
216
        if view_info is None:
225
217
            self.view_name = None
226
218
            self.view_files = []
275
267
            # if the file is not missing in the source, we show its kind
276
268
            # when we show two paths.
277
269
            if kind[0] is not None:
278
 
                old_path += self.kind_marker(kind[0])
 
270
                old_path += osutils.kind_marker(kind[0])
279
271
            old_path += " => "
280
272
        elif versioned == 'removed':
281
273
            # not present in target
290
282
            rename = self.versioned_map[versioned]
291
283
        # we show the old kind on the new path when the content is deleted.
292
284
        if modified == 'deleted':
293
 
            path += self.kind_marker(kind[0])
 
285
            path += osutils.kind_marker(kind[0])
294
286
        # otherwise we always show the current kind when there is one
295
287
        elif kind[1] is not None:
296
 
            path += self.kind_marker(kind[1])
 
288
            path += osutils.kind_marker(kind[1])
297
289
        if exe_change:
298
290
            exe = '*'
299
291
        else:
348
340
                        exe_change, kind)
349
341
 
350
342
def report_delta(to_file, delta, short_status=False, show_ids=False, 
351
 
         show_unchanged=False, indent='', filter=None, classify=True):
 
343
         show_unchanged=False, indent='', filter=None):
352
344
    """Output this delta in status-like form to to_file.
353
345
 
354
346
    :param to_file: A file-like object where the output is displayed.
366
358
 
367
359
    :param filter: A callable receiving a path and a file id and
368
360
        returning True if the path should be displayed.
369
 
 
370
 
    :param classify: Add special symbols to indicate file kind.
371
361
    """
372
362
 
373
363
    def decorate_path(path, kind, meta_modified=None):
374
 
        if not classify:
375
 
            return path
376
364
        if kind == 'directory':
377
365
            path += '/'
378
366
        elif kind == 'symlink':