~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-27 17:42:25 UTC
  • mto: This revision was merged to the branch mainline in revision 6311.
  • Revision ID: jelmer@samba.org-20111127174225-tspfeewl0gwxxumt
Add possible_transports in a couple more places.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
import re
20
18
import sys
21
19
 
57
55
from bzrlib.repository import (
58
56
    _LazyListJoin,
59
57
    MetaDirRepository,
60
 
    RepositoryFormatMetaDir,
 
58
    RepositoryFormat,
61
59
    RepositoryWriteLockResult,
62
60
    )
63
61
from bzrlib.vf_repository import (
1223
1221
        """
1224
1222
        for pack in packs:
1225
1223
            try:
1226
 
                try:
1227
 
                    pack.pack_transport.move(pack.file_name(),
1228
 
                        '../obsolete_packs/' + pack.file_name())
1229
 
                except errors.NoSuchFile:
1230
 
                    # perhaps obsolete_packs was removed? Let's create it and
1231
 
                    # try again
1232
 
                    try:
1233
 
                        pack.pack_transport.mkdir('../obsolete_packs/')
1234
 
                    except errors.FileExists:
1235
 
                        pass
1236
 
                    pack.pack_transport.move(pack.file_name(),
1237
 
                        '../obsolete_packs/' + pack.file_name())
 
1224
                pack.pack_transport.move(pack.file_name(),
 
1225
                    '../obsolete_packs/' + pack.file_name())
1238
1226
            except (errors.PathError, errors.TransportError), e:
1239
1227
                # TODO: Should these be warnings or mutters?
1240
1228
                mutter("couldn't rename obsolete pack, skipping it:\n%s"
1506
1494
        obsolete_pack_transport = self.transport.clone('obsolete_packs')
1507
1495
        if preserve is None:
1508
1496
            preserve = set()
1509
 
        try:
1510
 
            obsolete_pack_files = obsolete_pack_transport.list_dir('.')
1511
 
        except errors.NoSuchFile:
1512
 
            return found
1513
 
        for filename in obsolete_pack_files:
 
1497
        for filename in obsolete_pack_transport.list_dir('.'):
1514
1498
            name, ext = osutils.splitext(filename)
1515
1499
            if ext == '.pack':
1516
1500
                found.append(name)
1922
1906
                                    than normal. I.e. during 'upgrade'.
1923
1907
        """
1924
1908
        if not _found:
1925
 
            format = RepositoryFormatMetaDir.find_format(a_bzrdir)
 
1909
            format = RepositoryFormat.find_format(a_bzrdir)
1926
1910
        if _override_transport is not None:
1927
1911
            repo_transport = _override_transport
1928
1912
        else: