/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Michael Ellerman
  • Date: 2006-03-09 00:24:48 UTC
  • mto: (1610.1.8 bzr.mbp.integration)
  • mto: This revision was merged to the branch mainline in revision 1616.
  • Revision ID: michael@ellerman.id.au-20060309002448-70cce15e3d605130
Make the "ignore line" in the commit message editor the "right" width, so
that if you make your message that wide it won't wrap in bzr log output.
Just as a visual aid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd.
 
1
# -*- coding: UTF-8 -*-
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
16
16
 
17
17
from bzrlib.delta import compare_trees
18
18
from bzrlib.errors import BzrError
19
 
import bzrlib.errors as errors
20
19
from bzrlib.symbol_versioning import *
21
20
from bzrlib.trace import mutter
22
21
 
236
235
    external_diff_options
237
236
        If set, use an external GNU diff and pass these options.
238
237
    """
 
238
 
239
239
    old_tree.lock_read()
240
240
    try:
241
241
        new_tree.lock_read()
264
264
    # TODO: Generation of pseudo-diffs for added/deleted files could
265
265
    # be usefully made into a much faster special case.
266
266
 
267
 
    _raise_if_doubly_unversioned(specific_files, old_tree, new_tree)
268
 
 
269
267
    if external_diff_options:
270
268
        assert isinstance(external_diff_options, basestring)
271
269
        opts = external_diff_options.split()
274
272
    else:
275
273
        diff_file = internal_diff
276
274
    
 
275
 
277
276
    delta = compare_trees(old_tree, new_tree, want_unchanged=False,
278
277
                          specific_files=specific_files)
279
278
 
307
306
            _maybe_diff_file_or_symlink(old_label, path, old_tree, file_id,
308
307
                                        new_label, path, new_tree,
309
308
                                        True, kind, to_file, diff_file)
310
 
 
311
309
    return has_changes
312
 
 
313
 
 
314
 
def _raise_if_doubly_unversioned(specific_files, old_tree, new_tree):
315
 
    """Complain if paths are not versioned in either tree."""
316
 
    if not specific_files:
317
 
        return
318
 
    old_unversioned = old_tree.filter_unversioned_files(specific_files)
319
 
    new_unversioned = new_tree.filter_unversioned_files(specific_files)
320
 
    unversioned = old_unversioned.intersection(new_unversioned)
321
 
    if unversioned:
322
 
        raise errors.PathsNotVersionedError(sorted(unversioned))
323
310
    
324
311
 
325
312
def get_prop_change(meta_modified):