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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-01-30 17:30:52 UTC
  • mfrom: (7464.3.2 drop-roundtripping)
  • Revision ID: breezy.the.bot@gmail.com-20200130173052-fedd479i21ci93dr
Drop more roundtripping support in Git.

Merged from https://code.launchpad.net/~jelmer/brz/drop-roundtripping/+merge/378336

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
from .tree import entry_factory
58
58
 
59
59
 
60
 
class SettingCustomFileIdsUnsupported(UnsupportedOperation):
61
 
 
62
 
    _fmt = ("Unable to store addition of file with custom file ids: "
63
 
            "%(file_ids)r")
64
 
 
65
 
    def __init__(self, file_ids):
66
 
        BzrError.__init__(self)
67
 
        self.file_ids = file_ids
68
 
 
69
 
 
70
60
class GitCommitBuilder(CommitBuilder):
71
61
    """Commit builder for Git repositories."""
72
62
 
80
70
        self._blobs = {}
81
71
        self._inv_delta = []
82
72
        self._any_changes = False
83
 
        self._override_fileids = {}
84
73
        self._mapping = self.repository.get_mapping()
85
74
 
86
75
    def any_changes(self):
143
132
            self._blobs[encoded_new_path] = (mode, sha)
144
133
            if st is not None:
145
134
                yield change.path[1], (entry.text_sha1, st)
146
 
            if self._mapping.generate_file_id(encoded_new_path) != change.file_id:
147
 
                self._override_fileids[encoded_new_path] = change.file_id
148
135
        if not seen_root and len(self.parents) == 0:
149
136
            raise RootMissing()
150
137
        if getattr(workingtree, "basis_tree", False):
160
147
            if entry.path in self._blobs:
161
148
                continue
162
149
            self._blobs[entry.path] = (entry.mode, entry.sha)
163
 
        if not self._lossy:
164
 
            if self._override_fileids:
165
 
                raise SettingCustomFileIdsUnsupported(self._override_fileids)
166
150
        self.new_inventory = None
167
151
 
168
152
    def update_basis(self, tree):