/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-06-19 22:18:01 UTC
  • mfrom: (7515.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200619221801-6chb6w22ctckkajl
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/386125

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        self.store = self.repository._git.object_store
65
65
        self._blobs = {}
66
66
        self._inv_delta = []
 
67
        self._deleted_paths = set()
67
68
        self._any_changes = False
68
69
        self._mapping = self.repository.get_mapping()
69
70
 
87
88
            self._any_changes = True
88
89
            if change.path[1] is None:
89
90
                self._inv_delta.append((change.path[0], change.path[1], change.file_id, None))
90
 
                self._blobs[change.path[0].encode("utf-8")] = None
 
91
                self._deleted_paths.add(change.path[0].encode("utf-8"))
91
92
                continue
92
93
            try:
93
94
                entry_kls = entry_factory[change.kind[1]]
123
124
                raise AssertionError("Unknown kind %r" % change.kind[1])
124
125
            mode = object_mode(change.kind[1], change.executable[1])
125
126
            self._inv_delta.append((change.path[0], change.path[1], change.file_id, entry))
126
 
            encoded_new_path = change.path[1].encode("utf-8")
127
 
            self._blobs[encoded_new_path] = (mode, sha)
 
127
            if change.path[0] is not None:
 
128
                self._deleted_paths.add(change.path[0].encode("utf-8"))
 
129
            self._blobs[change.path[1].encode("utf-8")] = (mode, sha)
128
130
            if st is not None:
129
131
                yield change.path[1], (entry.text_sha1, st)
130
132
        if not seen_root and len(self.parents) == 0:
141
143
        for entry in basis_tree._iter_tree_contents(include_trees=False):
142
144
            if entry.path in self._blobs:
143
145
                continue
 
146
            if entry.path in self._deleted_paths:
 
147
                continue
144
148
            self._blobs[entry.path] = (entry.mode, entry.sha)
145
149
        self.new_inventory = None
146
150
 
150
154
 
151
155
    def finish_inventory(self):
152
156
        # eliminate blobs that were removed
153
 
        self._blobs = {k: v for (k, v) in self._blobs.items() if v is not None}
 
157
        self._blobs = {k: v for (k, v) in self._blobs.items()}
154
158
 
155
159
    def _iterblobs(self):
156
160
        return ((path, sha, mode) for (path, (mode, sha))