/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

Merge from integration, mode-changes are broken.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
from bzrlib.xml4 import serializer_v4
82
82
from bzrlib.xml5 import serializer_v5
83
83
from bzrlib.trace import mutter, note, warning
84
 
from bzrlib.osutils import sha_strings, sha_string
 
84
from bzrlib.osutils import sha_strings, sha_string, pathjoin, abspath
85
85
 
86
86
 
87
87
class Convert(object):
116
116
            finally:
117
117
                self.branch.unlock()
118
118
            self._open_branch()
119
 
        cache = hashcache.HashCache(os.path.abspath(self.base))
 
119
        cache = hashcache.HashCache(abspath(self.base))
120
120
        cache.clear()
121
121
        cache.write()
122
122
        note("finished")
126
126
        from bzrlib.store import hash_prefix
127
127
        for store_name in ["weaves", "revision-store"]:
128
128
            note("adding prefixes to %s" % store_name) 
129
 
            store_dir = os.path.join(self.base, ".bzr", store_name)
 
129
            store_dir = pathjoin(self.base, ".bzr", store_name)
130
130
            for filename in os.listdir(store_dir):
131
131
                if filename.endswith(".weave") or filename.endswith(".gz"):
132
132
                    file_id = os.path.splitext(filename)[0]
133
133
                else:
134
134
                    file_id = filename
135
 
                prefix_dir = os.path.join(store_dir, hash_prefix(file_id))
 
135
                prefix_dir = pathjoin(store_dir, hash_prefix(file_id))
136
136
                if not os.path.isdir(prefix_dir):
137
137
                    os.mkdir(prefix_dir)
138
 
                os.rename(os.path.join(store_dir, filename),
139
 
                          os.path.join(prefix_dir, filename))
 
138
                os.rename(pathjoin(store_dir, filename),
 
139
                          pathjoin(prefix_dir, filename))
140
140
        self._set_new_format(BZR_BRANCH_FORMAT_6)
141
141
 
142
142