~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:03:38 UTC
  • mto: (1185.1.51)
  • mto: This revision was merged to the branch mainline in revision 1422.
  • Revision ID: robertc@robertcollins.net-20051008000338-91e577a411df6c37
make reweave visible as a weave method, and quickly integrate into fetch

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
 
219
220
            return
220
221
        from_weave = self.from_weaves.get_weave(file_id)
221
222
        to_weave = self.to_weaves.get_weave_or_empty(file_id)
222
 
        to_weave.join(from_weave)
 
223
        try:
 
224
            to_weave.join(from_weave)
 
225
        except errors.WeaveParentMismatch:
 
226
            to_weave.reweave(from_weave)
223
227
        self.to_weaves.put_weave(file_id, to_weave)
224
228
        self.count_weaves += 1
225
229
        self.copied_file_ids.add(file_id)