~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/versioned/__init__.py

  • Committer: Martin Pool
  • Date: 2006-06-20 03:57:11 UTC
  • mto: This revision was merged to the branch mainline in revision 1798.
  • Revision ID: mbp@sourcefrog.net-20060620035711-400bb6b6bc6ff95b
Add pyflakes makefile target; fix many warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import os
23
23
from cStringIO import StringIO
24
24
import urllib
 
25
from warnings import warn
25
26
 
 
27
from bzrlib import errors
26
28
from bzrlib.weavefile import read_weave, write_weave_v5
27
29
from bzrlib.weave import WeaveFile, Weave
28
30
from bzrlib.store import TransportStore
29
31
from bzrlib.atomicfile import AtomicFile
30
 
from bzrlib.errors import NoSuchFile, FileExists
31
 
from bzrlib.symbol_versioning import *
 
32
from bzrlib.symbol_versioning import (deprecated_method,
 
33
        zero_eight)
32
34
from bzrlib.trace import mutter
33
35
import bzrlib.ui
34
36
 
112
114
        fn = self.filename(file_id)
113
115
        try:
114
116
            return self._transport.put(fn, f, mode=self._file_mode)
115
 
        except NoSuchFile:
 
117
        except errors.NoSuchFile:
116
118
            if not self._prefixed:
117
119
                raise
118
120
            self._transport.mkdir(os.path.dirname(fn), mode=self._dir_mode)
173
175
            # for the common case.
174
176
            weave = self._versionedfile_class(_filename, self._transport, self._file_mode, create=True,
175
177
                                              **self._versionedfile_kwargs)
176
 
        except NoSuchFile:
 
178
        except errors.NoSuchFile:
177
179
            if not self._prefixed:
178
180
                # unexpected error - NoSuchFile is expected to be raised on a
179
181
                # missing dir only and that only occurs when we are prefixed.
194
196
        _filename = self.filename(file_id)
195
197
        try:
196
198
            return self.get_weave(file_id, transaction, _filename=_filename)
197
 
        except NoSuchFile:
 
199
        except errors.NoSuchFile:
198
200
            weave = self._make_new_versionedfile(file_id, transaction,
199
201
                known_missing=True, _filename=_filename)
200
202
            transaction.map.add_weave(file_id, weave)
255
257
            warn("Please pass to_transaction into "
256
258
                 "versioned_store.copy_all_ids.", stacklevel=2)
257
259
        if not store_from.listable():
258
 
            raise UnlistableStore(store_from)
 
260
            raise errors.UnlistableStore(store_from)
259
261
        ids = []
260
262
        for count, file_id in enumerate(store_from):
261
263
            if pb: