~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/delta.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-22 15:44:59 UTC
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070722154459-520ws2gnifghkpgy
From review comments, use a private scheme for testing.

* bzrlib/transport/__init__.py:
(_unregister_urlparse_netloc_protocol): New function.

* bzrlib/tests/transport_util.py:
(InstrumentedTransport.__init__): Use a dedicated scheme.
(TestCaseWithConnectionHookedTransport.setUp): Reworked to
register the new transport.
(TestCaseWithConnectionHookedTransport.get_url): Use our dedicated
scheme.
(TestCaseWithConnectionHookedTransport.install_hooks,
TestCaseWithConnectionHookedTransport.reset_hooks): Registering
transport is setUp job.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    )
21
21
from bzrlib.inventory import InventoryEntry
22
22
from bzrlib.trace import mutter
23
 
from bzrlib.symbol_versioning import deprecated_function
 
23
from bzrlib.symbol_versioning import deprecated_function, zero_nine
24
24
 
25
25
 
26
26
class TreeDelta(object):
202
202
        self.show(output, show_ids, show_unchanged, short_status)
203
203
        return output.getvalue()
204
204
 
 
205
@deprecated_function(zero_nine)
 
206
def compare_trees(old_tree, new_tree, want_unchanged=False,
 
207
                  specific_files=None, extra_trees=None,
 
208
                  require_versioned=False):
 
209
    """compare_trees was deprecated in 0.10. Please see Tree.changes_from."""
 
210
    return new_tree.changes_from(old_tree,
 
211
        want_unchanged=want_unchanged,
 
212
        specific_files=specific_files,
 
213
        extra_trees=extra_trees,
 
214
        require_versioned=require_versioned,
 
215
        include_root=False)
 
216
 
205
217
 
206
218
def _compare_trees(old_tree, new_tree, want_unchanged, specific_files,
207
219
                   include_root, extra_trees=None,
208
 
                   require_versioned=False, want_unversioned=False):
 
220
                   want_unversioned=False):
209
221
    """Worker function that implements Tree.changes_from."""
210
222
    delta = TreeDelta()
211
223
    # mutter('start compare_trees')
213
225
    for (file_id, path, content_change, versioned, parent_id, name, kind,
214
226
         executable) in new_tree._iter_changes(old_tree, want_unchanged,
215
227
            specific_files, extra_trees=extra_trees,
216
 
            require_versioned=require_versioned,
217
228
            want_unversioned=want_unversioned):
218
229
        if versioned == (False, False):
219
230
            delta.unversioned.append((path[1], None, kind[1]))