Rev 3612: Remove duplicated class definitions and remove unused imports from in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Aug 6 23:49:19 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3612
revision-id: pqm at pqm.ubuntu.com-20080806224913-zg129xmi6x8045k3
parent: pqm at pqm.ubuntu.com-20080806215733-qiem34zrdhgcq8ap
parent: andrew.bennetts at canonical.com-20080805143514-rmx7hxd3mt40fb44
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2008-08-06 23:49:13 +0100
message:
Remove duplicated class definitions and remove unused imports from
pack_repo.py. (Andrew Bennetts)
modified:
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
------------------------------------------------------------
revno: 3603.2.1
revision-id: andrew.bennetts at canonical.com-20080805143514-rmx7hxd3mt40fb44
parent: pqm at pqm.ubuntu.com-20080805011407-wmq7130znc0e6c4x
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: dupe-code
timestamp: Wed 2008-08-06 00:35:14 +1000
message:
Remove duplicated class definitions, remove unused imports.
modified:
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2008-07-28 06:08:42 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2008-08-05 14:35:14 +0000
@@ -17,16 +17,16 @@
from bzrlib.lazy_import import lazy_import
lazy_import(globals(), """
from itertools import izip
-import math
import md5
import time
from bzrlib import (
- debug,
- graph,
- pack,
- ui,
- )
+ debug,
+ graph,
+ pack,
+ transactions,
+ ui,
+ )
from bzrlib.index import (
GraphIndex,
GraphIndexBuilder,
@@ -41,8 +41,6 @@
_DirectPackAccess,
)
from bzrlib.osutils import rand_chars, split_lines
-from bzrlib.pack import ContainerWriter
-from bzrlib.store import revision
from bzrlib import tsort
""")
from bzrlib import (
@@ -50,30 +48,23 @@
errors,
lockable_files,
lockdir,
- osutils,
symbol_versioning,
- transactions,
xml5,
xml6,
xml7,
)
-from bzrlib.decorators import needs_read_lock, needs_write_lock
+from bzrlib.decorators import needs_write_lock
from bzrlib.repofmt.knitrepo import KnitRepository
from bzrlib.repository import (
CommitBuilder,
- InterRepository,
- MetaDirRepository,
MetaDirRepositoryFormat,
RepositoryFormat,
RootCommitBuilder,
)
import bzrlib.revision as _mod_revision
-from bzrlib.store.versioned import VersionedFileStore
from bzrlib.trace import (
mutter,
- mutter_callsite,
- note,
warning,
)
@@ -1819,7 +1810,6 @@
raise errors.ReadOnlyError(self)
self._write_lock_count += 1
if self._write_lock_count == 1:
- from bzrlib import transactions
self._transaction = transactions.WriteTransaction()
for repo in self._fallback_repositories:
# Writes don't affect fallback repos
@@ -1980,103 +1970,6 @@
pass
-class RepositoryFormatPack(MetaDirRepositoryFormat):
- """Format logic for pack structured repositories.
-
- This repository format has:
- - a list of packs in pack-names
- - packs in packs/NAME.pack
- - indices in indices/NAME.{iix,six,tix,rix}
- - knit deltas in the packs, knit indices mapped to the indices.
- - thunk objects to support the knits programming API.
- - a format marker of its own
- - an optional 'shared-storage' flag
- - an optional 'no-working-trees' flag
- - a LockDir lock
- """
-
- # Set this attribute in derived classes to control the repository class
- # created by open and initialize.
- repository_class = None
- # Set this attribute in derived classes to control the
- # _commit_builder_class that the repository objects will have passed to
- # their constructor.
- _commit_builder_class = None
- # Set this attribute in derived clases to control the _serializer that the
- # repository objects will have passed to their constructor.
- _serializer = None
- # External references are not supported in pack repositories yet.
- supports_external_lookups = False
-
- def initialize(self, a_bzrdir, shared=False):
- """Create a pack based repository.
-
- :param a_bzrdir: bzrdir to contain the new repository; must already
- be initialized.
- :param shared: If true the repository will be initialized as a shared
- repository.
- """
- mutter('creating repository in %s.', a_bzrdir.transport.base)
- dirs = ['indices', 'obsolete_packs', 'packs', 'upload']
- builder = GraphIndexBuilder()
- files = [('pack-names', builder.finish())]
- utf8_files = [('format', self.get_format_string())]
-
- self._upload_blank_content(a_bzrdir, dirs, files, utf8_files, shared)
- return self.open(a_bzrdir=a_bzrdir, _found=True)
-
- def open(self, a_bzrdir, _found=False, _override_transport=None):
- """See RepositoryFormat.open().
-
- :param _override_transport: INTERNAL USE ONLY. Allows opening the
- repository at a slightly different url
- than normal. I.e. during 'upgrade'.
- """
- if not _found:
- format = RepositoryFormat.find_format(a_bzrdir)
- if _override_transport is not None:
- repo_transport = _override_transport
- else:
- repo_transport = a_bzrdir.get_repository_transport(None)
- control_files = lockable_files.LockableFiles(repo_transport,
- 'lock', lockdir.LockDir)
- return self.repository_class(_format=self,
- a_bzrdir=a_bzrdir,
- control_files=control_files,
- _commit_builder_class=self._commit_builder_class,
- _serializer=self._serializer)
-
-
-class RepositoryFormatKnitPack1(RepositoryFormatPack):
- """A no-subtrees parameterized Pack repository.
-
- This format was introduced in 0.92.
- """
-
- repository_class = KnitPackRepository
- _commit_builder_class = PackCommitBuilder
- _serializer = xml5.serializer_v5
-
- def _get_matching_bzrdir(self):
- return bzrdir.format_registry.make_bzrdir('pack-0.92')
-
- def _ignore_setting_bzrdir(self, format):
- pass
-
- _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
-
- def get_format_string(self):
- """See RepositoryFormat.get_format_string()."""
- return "Bazaar pack repository format 1 (needs bzr 0.92)\n"
-
- def get_format_description(self):
- """See RepositoryFormat.get_format_description()."""
- return "Packs containing knits without subtree support"
-
- def check_conversion_target(self, target_format):
- pass
-
-
class RepositoryFormatKnitPack3(RepositoryFormatPack):
"""A subtrees parameterized Pack repository.
More information about the bazaar-commits
mailing list