/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/bundle/serializer/v08.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-19 18:35:20 UTC
  • mfrom: (6809.4.27 swap-arguments)
  • Revision ID: jelmer@jelmer.uk-20171119183520-fmw89uw30e0tbhwz
Merge lp:~jelmer/brz/swap-arguments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
        new_label = ''
258
258
 
259
259
        def do_diff(file_id, old_path, new_path, action, force_binary):
260
 
            def tree_lines(tree, require_text=False):
 
260
            def tree_lines(tree, path, require_text=False):
261
261
                if tree.has_id(file_id):
262
 
                    tree_file = tree.get_file(file_id)
 
262
                    tree_file = tree.get_file(path, file_id)
263
263
                    if require_text is True:
264
264
                        tree_file = text_file(tree_file)
265
265
                    return tree_file.readlines()
269
269
            try:
270
270
                if force_binary:
271
271
                    raise errors.BinaryFile()
272
 
                old_lines = tree_lines(old_tree, require_text=True)
273
 
                new_lines = tree_lines(new_tree, require_text=True)
 
272
                old_lines = tree_lines(old_tree, old_path, require_text=True)
 
273
                new_lines = tree_lines(new_tree, new_path, require_text=True)
274
274
                action.write(self.to_file)
275
275
                internal_diff(old_path, old_lines, new_path, new_lines,
276
276
                              self.to_file)
277
277
            except errors.BinaryFile:
278
 
                old_lines = tree_lines(old_tree, require_text=False)
279
 
                new_lines = tree_lines(new_tree, require_text=False)
 
278
                old_lines = tree_lines(old_tree, old_path, require_text=False)
 
279
                new_lines = tree_lines(new_tree, new_path, require_text=False)
280
280
                action.add_property('encoding', 'base64')
281
281
                action.write(self.to_file)
282
282
                binary_diff(old_path, old_lines, new_path, new_lines,
304
304
        for path, file_id, kind in delta.added:
305
305
            action = Action('added', [kind, path], [('file-id', file_id)])
306
306
            meta_modified = (kind=='file' and
307
 
                             new_tree.is_executable(file_id))
 
307
                             new_tree.is_executable(path, file_id))
308
308
            finish_action(action, file_id, kind, meta_modified, True,
309
309
                          DEVNULL, path)
310
310
 
321
321
                          path, path)
322
322
 
323
323
        for path, file_id, kind in delta.unchanged:
324
 
            new_rev = new_tree.get_file_revision(file_id)
 
324
            new_rev = new_tree.get_file_revision(path, file_id)
325
325
            if new_rev is None:
326
326
                continue
327
 
            old_rev = old_tree.get_file_revision(file_id)
 
327
            old_rev = old_tree.get_file_revision(path, file_id)
328
328
            if new_rev != old_rev:
329
 
                action = Action('modified', [new_tree.kind(file_id),
330
 
                                             new_tree.id2path(file_id)])
 
329
                action = Action('modified', [new_tree.kind(path, file_id),
 
330
                                             path])
331
331
                action.add_utf8_property('last-changed', new_rev)
332
332
                action.write(self.to_file)
333
333