~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Robert Collins
  • Date: 2005-10-23 13:50:59 UTC
  • Revision ID: robertc@robertcollins.net-20051023135059-99090b3a95ade1eb
BUGFIX: fetch was not skipping all missing parents for inventory insertion

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
from copy import copy
17
18
import os
18
19
from cStringIO import StringIO
19
20
 
192
193
               len(rev.parent_ids))
193
194
        self._copy_new_texts(rev_id, inv)
194
195
        parents = rev.parent_ids
 
196
        new_parents = copy(parents)
195
197
        for parent in parents:
196
198
            if not self.to_branch.has_revision(parent):
197
 
                parents.pop(parents.index(parent))
198
 
        self._copy_inventory(rev_id, inv_xml, parents)
 
199
                new_parents.pop(new_parents.index(parent))
 
200
        self._copy_inventory(rev_id, inv_xml, new_parents)
199
201
        self.to_branch.revision_store.add(StringIO(rev_xml), rev_id)
200
202
        mutter('copied revision %s', rev_id)
201
203
 
202
 
 
203
204
    def _copy_inventory(self, rev_id, inv_xml, parent_ids):
204
205
        self.to_control.add_text('inventory', rev_id,
205
206
                                split_lines(inv_xml), parent_ids,
217
218
                   path, ie.file_id)
218
219
            self._copy_one_weave(rev_id, ie.file_id)
219
220
 
220
 
 
221
221
    def _copy_one_weave(self, rev_id, file_id):
222
222
        """Copy one file weave."""
223
223
        mutter('copy file {%s} modified in {%s}', file_id, rev_id)