~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/serializer/v07.py

  • Committer: Aaron Bentley
  • Date: 2006-05-19 17:55:09 UTC
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: abentley@panoramicfeedback.com-20060519175509-c27d8aff0ff31e4b
Updated the write_changeset optimization

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 
92
92
    def _write_revisions(self):
93
93
        """Write the information for all of the revisions."""
94
 
        # The next version of changesets will write a rollup
95
 
        # at the top, and back-patches, or something else after that.
96
 
        # For now, we just write the patches in order.
97
94
 
98
95
        # Optimize for the case of revisions in order
99
96
        last_rev_id = None
100
 
        last_rev = None
101
97
        last_rev_tree = None
102
98
 
103
99
        for rev_id in self.revision_ids:
104
100
            rev = self.source.get_revision(rev_id)
 
101
            if rev_id == last_rev_id:
 
102
                rev_tree = last_rev_tree
 
103
            else:
 
104
                base_tree = self.source.revision_tree(rev_id)
105
105
            rev_tree = self.source.revision_tree(rev_id)
106
106
            if rev_id in self.forced_bases:
107
107
                explicit_base = True
123
123
            self._write_revision(rev, rev_tree, base_id, base_tree, 
124
124
                                 explicit_base)
125
125
 
126
 
            last_rev_id = rev_id
127
 
            last_rev = rev
128
 
            last_rev_tree = rev_tree
 
126
            last_rev_id = base_id
 
127
            last_rev_tree = base_tree
129
128
 
130
129
    def _write_revision(self, rev, rev_tree, base_rev, base_tree, 
131
130
                        explicit_base):