~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/read_changeset.py

  • Committer: Aaron Bentley
  • Date: 2006-05-19 18:50:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: abentley@panoramicfeedback.com-20060519185005-c884556a44fe1d13
Restore path-orientation of ChangesetTree

Show diffs side-by-side

added added

removed removed

Lines of Context:
536
536
        :param cset_tree: A ChangesetTree to update with the new information.
537
537
        """
538
538
 
539
 
        def get_rev_id(last_changed, file_id, kind):
 
539
        def get_rev_id(last_changed, path, kind):
540
540
            if last_changed is not None:
541
541
                changed_revision_id = decode(last_changed)
542
542
            else:
543
543
                changed_revision_id = revision_id
544
 
            cset_tree.note_last_changed(file_id, changed_revision_id)
 
544
            cset_tree.note_last_changed(path, changed_revision_id)
545
545
            return changed_revision_id
546
546
 
547
547
        def extra_info(info, new_path):
570
570
                new_path = info[1]
571
571
 
572
572
            cset_tree.note_rename(old_path, new_path)
573
 
            file_id = cset_tree.path2id(new_path)
574
573
            last_modified = extra_info(info[2:], new_path)
575
 
            revision = get_rev_id(last_modified, file_id, kind)
 
574
            revision = get_rev_id(last_modified, new_path, kind)
576
575
            if lines:
577
576
                cset_tree.note_patch(new_path, ''.join(lines))
578
577
 
602
601
 
603
602
            cset_tree.note_id(file_id, path, kind)
604
603
            last_changed = extra_info(info[2:], path)
605
 
            revision = get_rev_id(last_changed, file_id, kind)
 
604
            revision = get_rev_id(last_changed, path, kind)
606
605
            if kind == 'directory':
607
606
                return
608
607
            cset_tree.note_patch(path, ''.join(lines))
614
613
                        'the path in them: %r' % extra)
615
614
            path = info[0]
616
615
 
617
 
            file_id = cset_tree.path2id(path)
618
616
            last_modified = extra_info(info[1:], path)
619
 
            revision = get_rev_id(last_modified, file_id, kind)
 
617
            revision = get_rev_id(last_modified, path, kind)
620
618
            if lines:
621
619
                cset_tree.note_patch(path, ''.join(lines))
622
620
            
851
849
            return self.base_tree.inventory[file_id].executable
852
850
 
853
851
    def get_last_changed(self, file_id):
854
 
        if file_id in self._last_changed:
855
 
            return self._last_changed[file_id]
 
852
        path = self.id2path(file_id)
 
853
        if path in self._last_changed:
 
854
            return self._last_changed[path]
856
855
        return self.base_tree.inventory[file_id].revision
857
856
 
858
857
    def get_size_and_sha1(self, file_id):