/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-12 20:07:32 UTC
  • mto: This revision was merged to the branch mainline in revision 6819.
  • Revision ID: jelmer@jelmer.uk-20171112200732-ehxgen03s9jphe8n
Swap arguments for get_symlink_target and kind/stored_kind.

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,
328
328
            old_rev = old_tree.get_file_revision(
329
329
                    old_tree.id2path(file_id), file_id)
330
330
            if new_rev != old_rev:
331
 
                action = Action('modified', [new_tree.kind(file_id),
332
 
                                             new_tree.id2path(file_id)])
 
331
                new_path = new_tree.id2path(file_id)
 
332
                action = Action(
 
333
                        'modified',
 
334
                        [new_tree.kind(new_path, file_id), new_path])
333
335
                action.add_utf8_property('last-changed', new_rev)
334
336
                action.write(self.to_file)
335
337