/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Aaron Bentley
  • Date: 2005-11-25 04:30:47 UTC
  • mfrom: (1508.1.15)
  • mto: (1185.65.14 storage)
  • mto: This revision was merged to the branch mainline in revision 1550.
  • Revision ID: aaron.bentley@utoronto.ca-20051125043047-420c01b3982f9cda
MergedĀ theĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import bzrlib
22
22
import bzrlib.errors as errors
23
 
from bzrlib.errors import InstallFailed, NoSuchRevision, WeaveError
 
23
from bzrlib.errors import (InstallFailed, NoSuchRevision, WeaveError,
 
24
                           MissingText)
24
25
from bzrlib.trace import mutter, note, warning
25
26
from bzrlib.branch import Branch
26
27
from bzrlib.progress import ProgressBar
216
217
        # in memory until everything's done?  But this way is nicer
217
218
        # if it's interrupted.
218
219
        for path, ie in inv.iter_entries():
219
 
            if ie.revision != rev_id:
220
 
                continue
221
 
            mutter('%s {%s} is changed in this revision',
222
 
                   path, ie.file_id)
223
 
            self._copy_one_weave(rev_id, ie.file_id)
 
220
            self._copy_one_weave(rev_id, ie.file_id, ie.revision)
224
221
 
225
 
    def _copy_one_weave(self, rev_id, file_id):
226
 
        """Copy one file weave."""
 
222
    def _copy_one_weave(self, rev_id, file_id, text_revision):
 
223
        """Copy one file weave, esuring the result contains text_revision."""
 
224
        to_weave = self.to_weaves.get_weave_or_empty(file_id,
 
225
            self.to_branch.storage.get_transaction())
 
226
        if text_revision in to_weave:
 
227
            return
 
228
        from_weave = self.from_weaves.get_weave(file_id,
 
229
            self.from_branch.storage.get_transaction())
 
230
        if text_revision not in from_weave:
 
231
            raise MissingText(self.from_branch, text_revision, file_id)
227
232
        mutter('copy file {%s} modified in {%s}', file_id, rev_id)
228
 
        if file_id in self.copied_file_ids:
229
 
            mutter('file {%s} already copied', file_id)
230
 
            return
231
 
        from_weave = self.from_weaves.get_weave(file_id,
232
 
            self.from_branch.get_transaction())
233
 
        to_weave = self.to_weaves.get_weave_or_empty(file_id,
234
 
            self.to_storage.get_transaction())
235
233
        try:
236
234
            to_weave.join(from_weave)
237
235
        except errors.WeaveParentMismatch: