~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/delta.py

  • Committer: Alexander Belchenko
  • Date: 2006-07-31 16:12:57 UTC
  • mto: (1711.2.111 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1906.
  • Revision ID: bialix@ukr.net-20060731161257-91a231523255332c
new official bzr.ico

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from bzrlib.inventory import InventoryEntry
18
18
from bzrlib.trace import mutter
19
 
from bzrlib.symbol_versioning import deprecated_function, zero_nine
 
19
from bzrlib.symbol_versioning import deprecated_function, zero_ten
20
20
 
21
21
 
22
22
class TreeDelta(object):
143
143
            show_list(self.unchanged)
144
144
 
145
145
 
146
 
@deprecated_function(zero_nine)
 
146
@deprecated_function(zero_ten)
147
147
def compare_trees(old_tree, new_tree, want_unchanged=False,
148
148
                  specific_files=None, extra_trees=None,
149
149
                  require_versioned=False):
155
155
        require_versioned=require_versioned)
156
156
 
157
157
 
158
 
def _compare_trees(old_tree, new_tree, want_unchanged, specific_file_ids,
159
 
                   include_root):
 
158
def _compare_trees(old_tree, new_tree, want_unchanged, specific_file_ids):
160
159
 
161
160
    from osutils import is_inside_any
162
161
    
163
162
    old_inv = old_tree.inventory
164
163
    new_inv = new_tree.inventory
165
164
    delta = TreeDelta()
166
 
    # mutter('start compare_trees')
 
165
    mutter('start compare_trees')
167
166
 
168
167
    # TODO: Rather than iterating over the whole tree and then filtering, we
169
168
    # could diff just the specified files (if any) and their subtrees.  
170
169
 
171
 
    old_files = old_tree.list_files(include_root)
172
 
    new_files = new_tree.list_files(include_root)
 
170
    old_files = old_tree.list_files()
 
171
    new_files = new_tree.list_files()
173
172
 
174
173
    more_old = True
175
174
    more_new = True
190
189
        """We have matched up 2 file_ids, check for changes."""
191
190
        assert old_entry.kind == new_entry.kind
192
191
 
 
192
        if old_entry.kind == 'root_directory':
 
193
            return
 
194
 
193
195
        if specific_file_ids:
194
196
            if (old_entry.file_id not in specific_file_ids and 
195
197
                new_entry.file_id not in specific_file_ids):
252
254
            assert entry.file_id not in added
253
255
            added[entry.file_id] = path, entry
254
256
 
255
 
    while old_path is not None or new_path is not None:
 
257
    while old_path or new_path:
256
258
        # list_files() returns files in alphabetical path sorted order
257
259
        if old_path == new_path:
258
260
            if old_file_id == new_file_id: