~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Martin Pool
  • Date: 2005-08-23 00:40:27 UTC
  • Revision ID: mbp@sourcefrog.net-20050823004027-e6e45a392f540bb4
todo

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
import tempfile, os, errno
19
 
                
20
18
import bzrlib.errors
21
 
import bzrlib.progress
22
 
from bzrlib.xml import serializer_v4
23
19
 
24
20
 
25
21
def upgrade(branch):
38
34
 
39
35
    from bzrlib.trace import mutter
40
36
    from bzrlib.errors import BzrCheckError
41
 
    import bzrlib.ui
 
37
    from bzrlib.progress import ProgressBar
42
38
 
43
39
    branch.lock_write()
44
40
 
45
 
    pb = bzrlib.ui.ui_factory.progress_bar()
46
 
 
47
41
    try:
 
42
        pb = ProgressBar(show_spinner=True)
48
43
        last_rev_id = None
49
44
 
50
45
        history = branch.revision_history()
99
94
                # revision entry. I'm not supremely happy about it, but
100
95
                # there should be *some* way of making old entries have
101
96
                # the full meta information.
 
97
                import tempfile, os, errno
 
98
                from bzrlib.xml import pack_xml
 
99
                
102
100
                rev_tmp = tempfile.TemporaryFile()
103
 
                serializer_v4.write_revision(rev, rev_tmp)
 
101
                pack_xml(rev, rev_tmp)
104
102
                rev_tmp.seek(0)
105
103
 
106
104
                tmpfd, tmp_path = tempfile.mkstemp(prefix=rev_id, suffix='.gz',