~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/delta.py

  • Committer: John Arbash Meinel
  • Date: 2006-05-30 04:44:48 UTC
  • mto: (1711.2.26 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1734.
  • Revision ID: john@arbash-meinel.com-20060530044448-81612e2e57c3991f
Update documentation and TODO for compare_trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
from bzrlib.inventory import InventoryEntry
18
18
from bzrlib.trace import mutter
19
19
 
 
20
 
20
21
class TreeDelta(object):
21
22
    """Describes changes from one tree to another.
22
23
 
240
241
 
241
242
 
242
243
    def handle_old(path, entry):
243
 
        """old entry without a new entry match"""
 
244
        """old entry without a new entry match
 
245
 
 
246
        Check to see if a matching new entry was already seen as an
 
247
        added file, and switch the pair into being a rename.
 
248
        Otherwise just mark the old entry being removed.
 
249
        """
244
250
        if entry.file_id in added:
245
251
            # Actually this is a rename, we found a new file_id earlier
246
252
            # at a different location, so it is no-longer added
253
259
            removed[entry.file_id] = path, entry
254
260
 
255
261
    def handle_new(path, entry):
256
 
        """new entry without an old entry match"""
 
262
        """new entry without an old entry match
 
263
        
 
264
        Check to see if a matching old entry was already seen as a
 
265
        removal, and change the pair into a rename.
 
266
        Otherwise just mark the new entry as an added file.
 
267
        """
257
268
        if entry.file_id in removed:
258
269
            # We saw this file_id earlier at an old different location
259
270
            # it is no longer removed, just renamed
316
327
    delta.removed.sort()
317
328
    delta.added.sort()
318
329
    delta.renamed.sort()
 
330
    # TODO: jam 20060529 These lists shouldn't need to be sorted
 
331
    #       since we added them in alphabetical order.
319
332
    delta.modified.sort()
320
333
    delta.unchanged.sort()
321
334