/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/delta.py

  • Committer: Robert Collins
  • Date: 2005-10-02 21:51:29 UTC
  • mfrom: (1396)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20051002215128-5686c7d24bf9bdb9
merge from martins newformat branch - brings in transport abstraction

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
1
# -*- coding: UTF-8 -*-
3
2
 
4
3
# This program is free software; you can redistribute it and/or modify
36
35
    Each id is listed only once.
37
36
 
38
37
    Files that are both modified and renamed are listed only in
39
 
    renamed, with the text_modified flag true.
 
38
    renamed, with the text_modified flag true. The text_modified
 
39
    applies either to the the content of the file or the target of the
 
40
    symbolic link, depending of the kind of file.
40
41
 
41
42
    Files are only considered renamed if their name has changed or
42
43
    their parent directory has changed.  Renaming a directory
69
70
            self.modified, self.unchanged)
70
71
 
71
72
    def has_changed(self):
72
 
        changes = len(self.added) + len(self.removed) + len(self.renamed)
73
 
        changes += len(self.modified) 
74
 
        return (changes != 0)
 
73
        return bool(self.modified
 
74
                    or self.added
 
75
                    or self.removed
 
76
                    or self.renamed)
75
77
 
76
78
    def touches_file_id(self, file_id):
77
79
        """Return True if file_id is modified by this delta."""
176
178
                old_sha1 = old_tree.get_file_sha1(file_id)
177
179
                new_sha1 = new_tree.get_file_sha1(file_id)
178
180
                text_modified = (old_sha1 != new_sha1)
 
181
            elif kind == 'symlink':
 
182
                t1 = old_tree.get_symlink_target(file_id)
 
183
                t2 = new_tree.get_symlink_target(file_id)
 
184
                if t1 != t2:
 
185
                    mutter("    symlink target changed")
 
186
                    text_modified = True
 
187
                else:
 
188
                    text_modified = False
179
189
            else:
180
190
                ## mutter("no text to check for %r %r" % (file_id, kind))
181
191
                text_modified = False