~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Robert Collins
  • Date: 2005-10-08 00:32:39 UTC
  • mfrom: (1185.13.4)
  • mto: This revision was merged to the branch mainline in revision 1422.
  • Revision ID: robertc@robertcollins.net-20051008003239-b4e2f1ad62bbe3f6
merge in reweave support

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import os
18
18
from cStringIO import StringIO
19
19
 
20
 
import bzrlib.errors
 
20
import bzrlib
 
21
import bzrlib.errors as errors
 
22
from bzrlib.errors import InstallFailed, NoSuchRevision, WeaveError
21
23
from bzrlib.trace import mutter, note, warning
22
24
from bzrlib.branch import Branch
23
25
from bzrlib.progress import ProgressBar
24
26
from bzrlib.xml5 import serializer_v5
25
27
from bzrlib.osutils import sha_string, split_lines
26
 
from bzrlib.errors import InstallFailed, NoSuchRevision, WeaveError
27
28
 
28
29
"""Copying of history from one branch to another.
29
30
 
218
219
        if file_id in self.copied_file_ids:
219
220
            mutter('file {%s} already copied', file_id)
220
221
            return
221
 
        from_weave = self.from_weaves.get_weave(file_id, 
 
222
        from_weave = self.from_weaves.get_weave(file_id,
222
223
            self.from_branch.get_transaction())
223
224
        to_weave = self.to_weaves.get_weave_or_empty(file_id,
224
225
            self.to_branch.get_transaction())
225
 
        to_weave.join(from_weave)
 
226
        try:
 
227
            to_weave.join(from_weave)
 
228
        except errors.WeaveParentMismatch:
 
229
            to_weave.reweave(from_weave)
226
230
        self.to_weaves.put_weave(file_id, to_weave,
227
231
            self.to_branch.get_transaction())
228
232
        self.count_weaves += 1