/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/git/cache.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Map from Git sha's to Bazaar objects."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from dulwich.objects import (
22
20
    sha_to_hex,
23
21
    hex_to_sha,
41
39
    index as _mod_index,
42
40
    versionedfile,
43
41
    )
44
 
from ..sixish import (
45
 
    viewitems,
46
 
    viewkeys,
47
 
    viewvalues,
48
 
    )
49
42
from ..transport import (
50
43
    get_transport_from_path,
51
44
    )
336
329
    def lookup_git_sha(self, sha):
337
330
        if not isinstance(sha, bytes):
338
331
            raise TypeError(sha)
339
 
        for entry in viewvalues(self._by_sha[sha]):
 
332
        for entry in self._by_sha[sha].values():
340
333
            yield entry
341
334
 
342
335
    def lookup_tree_id(self, fileid, revision):
346
339
        return self._by_revid[revid]
347
340
 
348
341
    def revids(self):
349
 
        for key, entries in viewitems(self._by_sha):
350
 
            for (type, type_data) in viewvalues(entries):
 
342
        for key, entries in self._by_sha.items():
 
343
            for (type, type_data) in entries.values():
351
344
                if type == "commit":
352
345
                    yield type_data[0]
353
346
 
354
347
    def sha1s(self):
355
 
        return viewkeys(self._by_sha)
 
348
        return self._by_sha.keys()
356
349
 
357
350
 
358
351
class SqliteCacheUpdater(CacheUpdater):
711
704
        return ret
712
705
 
713
706
    def _keys(self):
714
 
        try:
715
 
            return self.db.keys()
716
 
        except AttributeError:  # python < 3
717
 
            return self.db.iterkeys()
 
707
        return self.db.keys()
718
708
 
719
709
    def revids(self):
720
710
        """List the revision ids known."""