~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Martin Pool
  • Date: 2005-09-15 08:51:30 UTC
  • Revision ID: mbp@sourcefrog.net-20050915085130-cc86d3c35afb4b1a
- fetch should also copy ancestry records

- new method WeaveStore.get_lines

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
# XXX: This doesn't handle ghost (not present in branch) revisions at
46
46
# all yet.  I'm not sure they really should be supported.
47
47
 
48
 
# TODO: This doesn't handle revisions which may be present but not
49
 
# merged into the last revision.
 
48
# NOTE: This doesn't copy revisions which may be present but not
 
49
# merged into the last revision.  I'm not sure we want to do that.
50
50
 
51
51
# - get a list of revisions that need to be pulled in
52
52
# - for each one, pull in that revision file
176
176
               len(rev.parents))
177
177
        self._copy_new_texts(rev_id, inv)
178
178
        parent_ids = [x.revision_id for x in rev.parents]
 
179
        self._copy_inventory(rev_id, inv_xml, parent_ids)
 
180
        self._copy_ancestry(rev_id, parent_ids)
 
181
        self.to_branch.revision_store.add(StringIO(rev_xml), rev_id)
 
182
 
 
183
 
 
184
    def _copy_inventory(self, rev_id, inv_xml, parent_ids):
179
185
        self.to_weaves.add_text(INVENTORY_FILEID, rev_id,
180
 
                                            split_lines(inv_xml), parent_ids)
181
 
 
182
 
        self.to_branch.revision_store.add(StringIO(rev_xml), rev_id)
 
186
                                split_lines(inv_xml), parent_ids)
 
187
 
 
188
 
 
189
    def _copy_ancestry(self, rev_id, parent_ids):
 
190
        ancestry_lines = self.from_weaves.get_lines(ANCESTRY_FILEID, rev_id)
 
191
        self.to_weaves.add_text(ANCESTRY_FILEID, rev_id, ancestry_lines,
 
192
                                parent_ids)
183
193
 
184
194
        
185
195
    def _copy_new_texts(self, rev_id, inv):