74
from bzrlib.atomicfile import AtomicFile
74
75
from bzrlib.branch import Branch, find_branch
75
76
from bzrlib.branch import BZR_BRANCH_FORMAT_5, BZR_BRANCH_FORMAT_6
76
77
from bzrlib.branch import BzrBranchFormat4, BzrBranchFormat5, BzrBranchFormat6
78
from bzrlib.errors import UpgradeReadonly
77
79
import bzrlib.hashcache as hashcache
80
from bzrlib.osutils import sha_strings, sha_string, pathjoin, abspath
81
from bzrlib.ui import ui_factory
82
from bzrlib.trace import mutter, note, warning
83
from bzrlib.transport import get_transport
78
84
from bzrlib.weave import Weave
79
85
from bzrlib.weavefile import read_weave, write_weave
80
from bzrlib.ui import ui_factory
81
from bzrlib.atomicfile import AtomicFile
82
86
from bzrlib.xml4 import serializer_v4
83
87
from bzrlib.xml5 import serializer_v5
84
from bzrlib.trace import mutter, note, warning
85
from bzrlib.osutils import sha_strings, sha_string, pathjoin, abspath
88
90
class Convert(object):
89
def __init__(self, base_dir):
92
def __init__(self, transport):
93
self.base = transport.base
91
94
self.converted_revs = set()
92
95
self.absent_revisions = set()
93
96
self.text_count = 0
94
97
self.revisions = {}
98
self.transport = transport
98
101
def convert(self):
102
if self.transport.is_readonly():
103
raise UpgradeReadonly
99
104
if not self._open_branch():
101
106
note('starting upgrade of %s', os.path.abspath(self.base))