/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 breezy/hashcache.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-05 23:35:09 UTC
  • mfrom: (6658 work)
  • mto: (6653.3.3 bzrwt)
  • mto: This revision was merged to the branch mainline in revision 6667.
  • Revision ID: jelmer@jelmer.uk-20170605233509-30wo916k6meuggqf
MergeĀ lp:brz

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    )
45
45
from .sixish import (
46
46
    text_type,
 
47
    viewitems,
47
48
    )
48
49
 
49
50
 
132
133
        # Stat in inode order as optimisation for at least linux.
133
134
        def inode_order(path_and_cache):
134
135
            return path_and_cache[1][1][3]
135
 
        for inum, path, cache_entry in sorted(self._cache, key=inode_order):
 
136
        for path, cache_val in sorted(viewitems(self._cache), key=inode_order):
136
137
            abspath = osutils.pathjoin(self.root, path)
137
138
            fp = self._fingerprint(abspath)
138
139
            self.stat_count += 1
139
140
 
140
 
            cache_fp = cache_entry[1]
141
 
 
142
 
            if (not fp) or (cache_fp != fp):
 
141
            if not fp or cache_val[1] != fp:
143
142
                # not here or not a regular file anymore
144
143
                self.removed_count += 1
145
144
                self.needs_write = True
229
228
        try:
230
229
            outf.write(CACHE_HEADER)
231
230
 
232
 
            for path, c  in self._cache.iteritems():
 
231
            for path, c  in viewitems(self._cache):
233
232
                line_info = [path.encode('utf-8'), '// ', c[0], ' ']
234
233
                line_info.append(' '.join([str(fld) for fld in c[1]]))
235
234
                line_info.append('\n')