~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store.py

  • Committer: Aaron Bentley
  • Date: 2005-08-25 13:10:25 UTC
  • mfrom: (974.1.38)
  • mto: (1092.1.42) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: abentley@panoramicfeedback.com-20050825131025-2aa94bcbbd646a00
Fixed return value when not an ImmutableStore

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
28
 
from bzrlib.trace import mutter
29
 
import bzrlib.ui
 
27
from trace import mutter
30
28
 
31
29
######################################################################
32
30
# stores
92
90
            
93
91
        p = self._path(fileid)
94
92
        if os.access(p, os.F_OK) or os.access(p + '.gz', os.F_OK):
 
93
            from bzrlib.errors import bailout
95
94
            raise BzrError("store %r already contains id %r" % (self._basedir, fileid))
96
95
 
97
96
        fn = p
114
113
    def copy_multi(self, other, ids, permit_failure=False):
115
114
        """Copy texts for ids from other into self.
116
115
 
117
 
        If an id is present in self, it is skipped.
118
 
 
119
 
        Returns (count_copied, failed), where failed is a collection of ids
120
 
        that could not be copied.
 
116
        If an id is present in self, it is skipped.  A count of copied
 
117
        ids is returned, which may be less than len(ids).
121
118
        """
122
 
        pb = bzrlib.ui.ui_factory.progress_bar()
123
 
        
 
119
        from bzrlib.progress import ProgressBar
 
120
        pb = ProgressBar()
124
121
        pb.update('preparing to copy')
125
122
        to_copy = [id for id in ids if id not in self]
126
123
        if isinstance(other, ImmutableStore):
145
142
        pb.clear()
146
143
        return count, failed
147
144
 
 
145
 
148
146
    def copy_multi_immutable(self, other, to_copy, pb, permit_failure=False):
149
147
        from shutil import copyfile
150
148
        count = 0