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

  • Committer: Jelmer Vernooij
  • Date: 2019-07-07 20:43:57 UTC
  • mfrom: (7370 work)
  • mto: This revision was merged to the branch mainline in revision 7378.
  • Revision ID: jelmer@jelmer.uk-20190707204357-82bayabtwikhoi0i
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    osutils,
43
43
    ui,
44
44
    )
 
45
from ..tree import find_previous_path
45
46
from ..lock import LogicalLockResult
46
47
from ..revision import (
47
48
    NULL_REVISION,
228
229
        base_tree = tree._repository.revision_tree(NULL_REVISION)
229
230
        other_parent_trees = []
230
231
 
231
 
    def find_unchanged_parent_ie(file_id, kind, other, parent_trees):
 
232
    def find_unchanged_parent_ie(path, kind, other, parent_trees):
232
233
        for ptree in parent_trees:
233
 
            try:
234
 
                ppath = ptree.id2path(file_id)
235
 
            except errors.NoSuchId:
236
 
                pass
237
 
            else:
 
234
            ppath = find_previous_path(tree, ptree, path)
 
235
            if ppath is not None:
238
236
                pkind = ptree.kind(ppath)
239
237
                if kind == "file":
240
238
                    if (pkind == "file" and
241
239
                            ptree.get_file_sha1(ppath) == other):
242
240
                        return (
243
 
                            file_id, ptree.get_file_revision(ppath))
 
241
                            ptree.path2id(ppath), ptree.get_file_revision(ppath))
244
242
                if kind == "symlink":
245
243
                    if (pkind == "symlink" and
246
244
                            ptree.get_symlink_target(ppath) == other):
247
245
                        return (
248
 
                            file_id, ptree.get_file_revision(ppath))
 
246
                            ptree.path2id(ppath), ptree.get_file_revision(ppath))
249
247
        raise KeyError
250
248
 
251
249
    # Find all the changed blobs
257
255
            blob_id = None
258
256
            try:
259
257
                (pfile_id, prevision) = find_unchanged_parent_ie(
260
 
                    change.file_id, change.kind[1], sha1, other_parent_trees)
 
258
                    change.path[1], change.kind[1], sha1, other_parent_trees)
261
259
            except KeyError:
262
260
                pass
263
261
            else:
290
288
                    blob, (change.file_id, tree.get_file_revision(change.path[1])), change.path[1])
291
289
            try:
292
290
                find_unchanged_parent_ie(
293
 
                    change.file_id, change.kind[1], target, other_parent_trees)
 
291
                    change.path[1], change.kind[1], target, other_parent_trees)
294
292
            except KeyError:
295
293
                if change.changed_content:
296
294
                    yield (change.path[1], blob,