~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_upgrade.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    def get_converter(self, format=None):
60
60
        return ConvertOldTestToMeta()
61
61
 
62
 
    def get_format_string(self):
 
62
    @classmethod
 
63
    def get_format_string(cls):
63
64
        return "Ancient Test Format"
64
65
 
65
66
    def _open(self, transport):
89
90
    def test_upgrade_up_to_date(self):
90
91
        self.make_current_format_branch_and_checkout()
91
92
        # when up to date we should get a message to that effect
92
 
        (out, err) = self.run_bzr('upgrade current_format_branch', retcode=3)
93
 
        err_msg = ('The branch format %s is already at the most recent format.'
94
 
                   % ('Meta directory format 1'))
95
 
        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
96
 
                             % (err_msg, err_msg),
97
 
                             err)
 
93
        burl = self.get_transport('current_format_branch').local_abspath(".")
 
94
        (out, err) = self.run_bzr('upgrade current_format_branch', retcode=0)
 
95
        self.assertEqual(
 
96
            'Upgrading branch %s/ ...\n'
 
97
            'The branch format %s is already at the most recent format.\n'
 
98
            % (burl, 'Meta directory format 1'),
 
99
            out)
98
100
 
99
101
    def test_upgrade_up_to_date_checkout_warns_branch_left_alone(self):
100
102
        self.make_current_format_branch_and_checkout()
103
105
        # date
104
106
        burl = self.get_transport('current_format_branch').local_abspath(".")
105
107
        curl = self.get_transport('current_format_checkout').local_abspath(".")
106
 
        (out, err) = self.run_bzr('upgrade current_format_checkout', retcode=3)
 
108
        (out, err) = self.run_bzr('upgrade current_format_checkout', retcode=0)
107
109
        self.assertEqual(
108
110
            'Upgrading branch %s/ ...\nThis is a checkout.'
109
111
            ' The branch (%s/) needs to be upgraded separately.\n'
110
 
            % (curl, burl),
 
112
            'The branch format %s is already at the most recent format.\n'
 
113
            % (curl, burl, 'Meta directory format 1'),
111
114
            out)
112
 
        msg = 'The branch format %s is already at the most recent format.' % (
113
 
            'Meta directory format 1')
114
 
        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
115
 
                             % (msg, msg),
116
 
                             err)
117
115
 
118
116
    def test_upgrade_checkout(self):
119
117
        # upgrading a checkout should work