~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/v08.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-28 10:06:39 UTC
  • mfrom: (6437.40.2 rmbranch-colo)
  • mto: This revision was merged to the branch mainline in revision 6482.
  • Revision ID: jelmer@samba.org-20120228100639-p5gndu91wuqwugti
Merge rmbranch-colo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
 
288
288
        def finish_action(action, file_id, kind, meta_modified, text_modified,
289
289
                          old_path, new_path):
290
 
            entry = new_tree.inventory[file_id]
291
 
            if entry.revision != default_revision_id:
292
 
                action.add_utf8_property('last-changed', entry.revision)
 
290
            revision = new_tree.get_file_revision(file_id)
 
291
            if revision != default_revision_id:
 
292
                action.add_utf8_property('last-changed', revision)
293
293
            if meta_modified:
294
 
                action.add_bool_property('executable', entry.executable)
 
294
                action.add_bool_property('executable',
 
295
                    new_tree.is_executable(file_id))
295
296
            if text_modified and kind == "symlink":
296
 
                action.add_property('target', entry.symlink_target)
 
297
                action.add_property('target',
 
298
                    new_tree.get_symlink_target(file_id))
297
299
            if text_modified and kind == "file":
298
300
                do_diff(file_id, old_path, new_path, action, force_binary)
299
301
            else:
324
326
                          path, path)
325
327
 
326
328
        for path, file_id, kind in delta.unchanged:
327
 
            ie = new_tree.inventory[file_id]
328
 
            new_rev = getattr(ie, 'revision', None)
 
329
            new_rev = new_tree.get_file_revision(file_id)
329
330
            if new_rev is None:
330
331
                continue
331
 
            old_rev = getattr(old_tree.inventory[ie.file_id], 'revision', None)
 
332
            old_rev = old_tree.get_file_revision(file_id)
332
333
            if new_rev != old_rev:
333
 
                action = Action('modified', [ie.kind,
334
 
                                             new_tree.id2path(ie.file_id)])
335
 
                action.add_utf8_property('last-changed', ie.revision)
 
334
                action = Action('modified', [new_tree.kind(file_id),
 
335
                                             new_tree.id2path(file_id)])
 
336
                action.add_utf8_property('last-changed', new_rev)
336
337
                action.write(self.to_file)
337
338
 
338
339