~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/hashcache.py

  • Committer: Ian Clatworthy
  • Date: 2008-04-23 05:12:12 UTC
  • mto: (4171.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4173.
  • Revision ID: ian.clatworthy@canonical.com-20080423051212-qmlwrnkd2yxjjaci
incorporate jameinel's review feedback

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
            content_filter_stack_provider=None):
86
86
        """Create a hash cache in base dir, and set the file mode to mode.
87
87
 
88
 
        :param content_filter_stack_provider: a function that expects a
89
 
            path (relative to the top of the tree) as a parameter and
90
 
            returns the stack of ContentFilter's for that path. If None,
91
 
            no content filtering is performed.
 
88
        :param content_filter_stack_provider: a function that takes a
 
89
            path (relative to the top of the tree) and a file-id as
 
90
            parameters and returns a stack of ContentFilter's.
 
91
            If None, no content filtering is performed.
92
92
        """
93
93
        self.root = safe_unicode(root)
94
94
        self.root_utf8 = self.root.encode('utf8') # where is the filesystem encoding ?
172
172
        mode = file_fp[FP_MODE_COLUMN]
173
173
        if stat.S_ISREG(mode):
174
174
            if self._cfs_provider is None:
175
 
                filters = None
 
175
                filters = []
176
176
            else:
177
 
                filters = self._cfs_provider(path)
 
177
                filters = self._cfs_provider(path=path, file_id=None)
178
178
            digest = self._really_sha1_file(abspath, filters)
179
179
        elif stat.S_ISLNK(mode):
180
180
            digest = sha.new(os.readlink(abspath)).hexdigest()