~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

merge merge tweaks from aaron, which includes latest .dev

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
                
18
20
import bzrlib.errors
 
21
import bzrlib.progress
 
22
from bzrlib.xml import serializer_v4
19
23
 
20
24
 
21
25
def upgrade(branch):
34
38
 
35
39
    from bzrlib.trace import mutter
36
40
    from bzrlib.errors import BzrCheckError
37
 
    from bzrlib.progress import ProgressBar
 
41
    import bzrlib.ui
38
42
 
39
43
    branch.lock_write()
40
44
 
 
45
    pb = bzrlib.ui.ui_factory.progress_bar()
 
46
 
41
47
    try:
42
 
        pb = ProgressBar(show_spinner=True)
43
48
        last_rev_id = None
44
49
 
45
50
        history = branch.revision_history()
94
99
                # revision entry. I'm not supremely happy about it, but
95
100
                # there should be *some* way of making old entries have
96
101
                # the full meta information.
97
 
                import tempfile, os, errno
98
 
                from bzrlib.xml import pack_xml
99
 
                
100
102
                rev_tmp = tempfile.TemporaryFile()
101
 
                pack_xml(rev, rev_tmp)
 
103
                serializer_v4.write_revision(rev, rev_tmp)
102
104
                rev_tmp.seek(0)
103
105
 
104
106
                tmpfd, tmp_path = tempfile.mkstemp(prefix=rev_id, suffix='.gz',