~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Aaron Bentley
  • Date: 2005-10-03 19:50:36 UTC
  • mfrom: (1399)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: abentley@panoramicfeedback.com-20051003195036-28dbd56f0e852b08
Merged latest from Robert Collins

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
    count_texts -- number of file texts copied
86
86
    """
87
87
    def __init__(self, to_branch, from_branch, last_revision=None, pb=None):
 
88
        if to_branch == from_branch:
 
89
            raise Exception("can't fetch from a branch to itself")
88
90
        self.to_branch = to_branch
89
91
        self.to_weaves = to_branch.weave_store
90
92
        self.to_control = to_branch.control_weaves
182
184
               rev.committer,
183
185
               len(rev.parent_ids))
184
186
        self._copy_new_texts(rev_id, inv)
185
 
        self._copy_inventory(rev_id, inv_xml, rev.parent_ids)
186
 
        self._copy_ancestry(rev_id, rev.parent_ids)
 
187
        parents = rev.parent_ids
 
188
        for parent in parents:
 
189
            if not self.to_branch.has_revision(parent):
 
190
                parents.pop(parents.index(parent))
 
191
        self._copy_inventory(rev_id, inv_xml, parents)
 
192
        self._copy_ancestry(rev_id, parents)
187
193
        self.to_branch.revision_store.add(StringIO(rev_xml), rev_id)
188
194
 
189
195
 
206
212
        for path, ie in inv.iter_entries():
207
213
            if ie.kind != 'file':
208
214
                continue
209
 
            if ie.text_version != rev_id:
 
215
            if ie.revision != rev_id:
210
216
                continue
211
217
            mutter('%s {%s} is changed in this revision',
212
218
                   path, ie.file_id)