~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store.py

  • Committer: Martin Pool
  • Date: 2005-09-05 05:35:25 UTC
  • mfrom: (974.1.55)
  • Revision ID: mbp@sourcefrog.net-20050905053525-2112bac069dbe331
- merge various bug fixes from aaron

aaron.bentley@utoronto.ca-20050905020131-a2d5b7711dd6cd98

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import os, tempfile, types, osutils, gzip, errno
25
25
from stat import ST_SIZE
26
26
from StringIO import StringIO
 
27
from bzrlib.errors import BzrError
27
28
from bzrlib.trace import mutter
28
29
import bzrlib.ui
29
30
 
125
126
        if isinstance(other, ImmutableStore):
126
127
            return self.copy_multi_immutable(other, to_copy, pb)
127
128
        count = 0
 
129
        failed = set()
128
130
        for id in to_copy:
129
131
            count += 1
130
132
            pb.update('copy', count, len(to_copy))
134
136
                try:
135
137
                    entry = other[id]
136
138
                except IndexError:
137
 
                    failures.add(id)
 
139
                    failed.add(id)
138
140
                    continue
139
141
                self.add(entry, id)
140
142
                
141
 
        assert count == len(to_copy)
 
143
        if not permit_failure:
 
144
            assert count == len(to_copy)
142
145
        pb.clear()
143
 
        return count, []
 
146
        return count, failed
144
147
 
145
148
    def copy_multi_immutable(self, other, to_copy, pb, permit_failure=False):
146
149
        from shutil import copyfile