/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
5557.1.7 by John Arbash Meinel
Merge in the bzr.dev 5582
1
# Copyright (C) 2006-2011 Canonical Ltd
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
2
#
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
7
#
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
12
#
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
16
17
"""Black box tests for the upgrade ui."""
5036.3.8 by Parth Malwankar
closed review comments from vila
18
import os
19
import stat
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
20
2323.6.1 by Martin Pool
(broken) Give a message when opening old workingtree formats suggesting upgrade
21
from bzrlib import (
22
    bzrdir,
5363.2.7 by Jelmer Vernooij
Fix tests.
23
    controldir,
5684.1.2 by Jelmer Vernooij
Fix tests.
24
    lockable_files,
25
    ui,
2323.6.1 by Martin Pool
(broken) Give a message when opening old workingtree formats suggesting upgrade
26
    )
27
from bzrlib.tests import (
5036.3.8 by Parth Malwankar
closed review comments from vila
28
    features,
2323.6.1 by Martin Pool
(broken) Give a message when opening old workingtree formats suggesting upgrade
29
    TestCaseWithTransport,
30
    )
1666.1.3 by Robert Collins
Fix and test upgrades from bzrdir 6 over SFTP.
31
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
32
from bzrlib.repofmt.pack_repo import RepositoryFormatKnitPack1
1534.5.9 by Robert Collins
Advise users running upgrade on a checkout to also run it on the branch.
33
34
5684.1.2 by Jelmer Vernooij
Fix tests.
35
class OldBzrDir(bzrdir.BzrDirMeta1):
36
    """An test bzr dir implementation"""
37
38
    def needs_format_conversion(self, format):
39
        return not isinstance(format, self.__class__)
40
41
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
42
class ConvertOldTestToMeta(controldir.Converter):
5684.1.2 by Jelmer Vernooij
Fix tests.
43
    """A trivial converter, used for testing."""
44
45
    def convert(self, to_convert, pb):
46
        ui.ui_factory.note('starting upgrade from old test format to 2a')
47
        to_convert.control_transport.put_bytes(
48
            'branch-format',
49
            bzrdir.BzrDirMetaFormat1().get_format_string(),
50
            mode=to_convert._get_file_mode())
51
        return bzrdir.BzrDir.open(to_convert.user_url)
52
53
54
class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1):
55
56
    _lock_class = lockable_files.TransportLock
57
58
    def get_converter(self, format=None):
59
        return ConvertOldTestToMeta()
60
61
    def get_format_string(self):
62
        return "Ancient Test Format"
63
64
    def _open(self, transport):
65
        return OldBzrDir(transport, self)
66
67
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
68
class TestWithUpgradableBranches(TestCaseWithTransport):
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
69
70
    def setUp(self):
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
71
        super(TestWithUpgradableBranches, self).setUp()
4608.1.1 by Martin Pool
Refactor blackbox.test_upgrade to do less work from setUp()
72
73
    def make_current_format_branch_and_checkout(self):
74
        current_tree = self.make_branch_and_tree('current_format_branch',
75
                                                 format='default')
76
        current_tree.branch.create_checkout(
77
            self.get_url('current_format_checkout'), lightweight=True)
78
1534.4.13 by Robert Collins
Give a reasonable warning on attempts to upgrade a readonly url.
79
    def test_readonly_url_error(self):
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
80
        self.make_branch_and_tree("old_format_branch", format="knit")
2530.3.4 by Martin Pool
Deprecate run_bzr_captured in favour of just run_bzr
81
        (out, err) = self.run_bzr(
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
82
            ['upgrade', self.get_readonly_url("old_format_branch")], retcode=3)
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
83
        err_msg = 'Upgrade URL cannot work with readonly URLs.'
84
        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
85
                             % (err_msg, err_msg),
86
                             err)
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
87
88
    def test_upgrade_up_to_date(self):
4608.1.1 by Martin Pool
Refactor blackbox.test_upgrade to do less work from setUp()
89
        self.make_current_format_branch_and_checkout()
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
90
        # when up to date we should get a message to that effect
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
91
        (out, err) = self.run_bzr('upgrade current_format_branch', retcode=3)
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
92
        err_msg = ('The branch format %s is already at the most recent format.'
93
                   % ('Meta directory format 1'))
94
        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
95
                             % (err_msg, err_msg),
96
                             err)
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
97
98
    def test_upgrade_up_to_date_checkout_warns_branch_left_alone(self):
4608.1.1 by Martin Pool
Refactor blackbox.test_upgrade to do less work from setUp()
99
        self.make_current_format_branch_and_checkout()
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
100
        # when upgrading a checkout, the branch location and a suggestion
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
101
        # to upgrade it should be emitted even if the checkout is up to
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
102
        # date
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
103
        burl = self.get_transport('current_format_branch').base
104
        curl = self.get_transport('current_format_checkout').base
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
105
        (out, err) = self.run_bzr('upgrade current_format_checkout', retcode=3)
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
106
        self.assertEqual(
107
            'Upgrading branch %s ...\nThis is a checkout.'
108
            ' The branch (%s) needs to be upgraded separately.\n'
109
            % (curl, burl),
110
            out)
111
        msg = 'The branch format %s is already at the most recent format.' % (
112
            'Meta directory format 1')
113
        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
114
                             % (msg, msg),
115
                             err)
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
116
117
    def test_upgrade_checkout(self):
118
        # upgrading a checkout should work
119
        pass
120
121
    def test_upgrade_repository_scans_branches(self):
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
122
        # we should get individual upgrade notes for each branch even the
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
123
        # anonymous branch
124
        pass
125
5582.9.11 by Jelmer Vernooij
Remove some more redundancy.
126
    def test_upgrade_branch_in_repo(self):
1534.5.6 by Robert Collins
split out converter logic into per-format objects.
127
        # upgrading a branch in a repo should warn about not upgrading the repo
128
        pass
1534.5.13 by Robert Collins
Correct buggy test.
129
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
130
    def test_upgrade_control_dir(self):
131
        old_format = OldBzrDirFormat()
132
        self.addCleanup(bzrdir.BzrDirFormat.unregister_format, old_format)
133
        bzrdir.BzrDirFormat.register_format(old_format)
134
        self.addCleanup(controldir.ControlDirFormat._set_default_format,
135
                        controldir.ControlDirFormat.get_default_format())
136
137
        # setup an old format branch we can upgrade from.
138
        path = 'old_format_branch'
139
        self.make_branch_and_tree(path, format=old_format)
5609.9.4 by Vincent Ladeuil
Use self.get_transport instead of transport.get_transport where possible.
140
        url = self.get_transport(path).base
1857.1.20 by Aaron Bentley
Strip out all the EnumOption stuff
141
        # check --format takes effect
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
142
        controldir.ControlDirFormat._set_default_format(old_format)
5035.4.3 by Parth Malwankar
updated existing upgrade tests to work.
143
        backup_dir = 'backup.bzr.~1~'
2530.3.4 by Martin Pool
Deprecate run_bzr_captured in favour of just run_bzr
144
        (out, err) = self.run_bzr(
5684.1.2 by Jelmer Vernooij
Fix tests.
145
            ['upgrade', '--format=2a', url])
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
146
        self.assertEqualDiff("""Upgrading branch %s ...
147
starting upgrade of %s
3943.2.4 by Martin Pool
Move backup progress indicators from upgrade.py into backup_bzrdir, and tweak text
148
making backup of %s.bzr
5035.4.3 by Parth Malwankar
updated existing upgrade tests to work.
149
  to %s%s
5684.1.2 by Jelmer Vernooij
Fix tests.
150
starting upgrade from old test format to 2a
1534.5.13 by Robert Collins
Correct buggy test.
151
finished
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
152
""" % (url, url, url, url, backup_dir), out)
1534.5.13 by Robert Collins
Correct buggy test.
153
        self.assertEqualDiff("", err)
154
        self.assertTrue(isinstance(
5582.9.6 by Jelmer Vernooij
More cleanups, remove more dependencies on specific formats.
155
            bzrdir.BzrDir.open(self.get_url(path))._format,
1534.5.13 by Robert Collins
Correct buggy test.
156
            bzrdir.BzrDirMetaFormat1))
1556.1.4 by Robert Collins
Add a new format for what will become knit, and the surrounding logic to upgrade repositories within metadirs, and tests for the same.
157
158
    def test_upgrade_explicit_knit(self):
5684.1.2 by Jelmer Vernooij
Fix tests.
159
        # users can force an upgrade to knit format from a metadir pack 0.92
160
        # branch to a 2a branch.
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
161
        self.make_branch_and_tree('branch', format='knit')
5684.1.2 by Jelmer Vernooij
Fix tests.
162
        url = self.get_transport('branch').base
1857.1.20 by Aaron Bentley
Strip out all the EnumOption stuff
163
        # check --format takes effect
5035.4.3 by Parth Malwankar
updated existing upgrade tests to work.
164
        backup_dir = 'backup.bzr.~1~'
2530.3.4 by Martin Pool
Deprecate run_bzr_captured in favour of just run_bzr
165
        (out, err) = self.run_bzr(
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
166
            ['upgrade', '--format=pack-0.92', url])
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
167
        self.assertEqualDiff("""Upgrading branch %s ...
168
starting upgrade of %s
3943.2.4 by Martin Pool
Move backup progress indicators from upgrade.py into backup_bzrdir, and tweak text
169
making backup of %s.bzr
5035.4.3 by Parth Malwankar
updated existing upgrade tests to work.
170
  to %s%s
1556.1.4 by Robert Collins
Add a new format for what will become knit, and the surrounding logic to upgrade repositories within metadirs, and tests for the same.
171
starting repository conversion
172
repository converted
173
finished
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
174
""" % (url, url, url, url, backup_dir),
175
                             out)
1556.1.4 by Robert Collins
Add a new format for what will become knit, and the surrounding logic to upgrade repositories within metadirs, and tests for the same.
176
        self.assertEqualDiff("", err)
5684.1.2 by Jelmer Vernooij
Fix tests.
177
        converted_dir = bzrdir.BzrDir.open(self.get_url('branch'))
1556.1.4 by Robert Collins
Add a new format for what will become knit, and the surrounding logic to upgrade repositories within metadirs, and tests for the same.
178
        self.assertTrue(isinstance(converted_dir._format,
179
                                   bzrdir.BzrDirMetaFormat1))
180
        self.assertTrue(isinstance(converted_dir.open_repository()._format,
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
181
                                   RepositoryFormatKnitPack1))
1558.7.2 by Aaron Bentley
Upgrade works in repositories
182
183
    def test_upgrade_repo(self):
5684.1.2 by Jelmer Vernooij
Fix tests.
184
        self.run_bzr('init-repository --format=pack-0.92 repo')
185
        self.run_bzr('upgrade --format=2a repo')
1666.1.3 by Robert Collins
Fix and test upgrades from bzrdir 6 over SFTP.
186
4360.10.38 by Vincent Ladeuil
Use assertXXX instead of _assert_xxx helpers.
187
    def assertLegalOption(self, option_str):
4360.10.8 by Ian Clatworthy
add blackbox tests
188
        # Confirm that an option is legal. (Lower level tests are
189
        # expected to validate the actual functionality.)
190
        self.run_bzr('init --format=pack-0.92 branch-foo')
191
        self.run_bzr('upgrade --format=2a branch-foo %s' % (option_str,))
192
4360.10.38 by Vincent Ladeuil
Use assertXXX instead of _assert_xxx helpers.
193
    def assertBranchFormat(self, dir, format):
4360.10.18 by Ian Clatworthy
Add basic checks to blackbox tests (beyond legal usage) as requested by poolie
194
        branch = bzrdir.BzrDir.open_tree_or_branch(self.get_url(dir))[1]
195
        branch_format = branch._format
196
        meta_format = bzrdir.format_registry.make_bzrdir(format)
197
        expected_format = meta_format.get_branch_format()
198
        self.assertEqual(expected_format, branch_format)
199
4360.10.8 by Ian Clatworthy
add blackbox tests
200
    def test_upgrade_clean_supported(self):
4360.10.38 by Vincent Ladeuil
Use assertXXX instead of _assert_xxx helpers.
201
        self.assertLegalOption('--clean')
202
        self.assertBranchFormat('branch-foo', '2a')
4360.10.26 by Matthew Fuller
Test the [non-]existence of the current backup dir name.
203
        backup_bzr_dir = os.path.join("branch-foo", "backup.bzr.~1~")
4360.10.18 by Ian Clatworthy
Add basic checks to blackbox tests (beyond legal usage) as requested by poolie
204
        self.assertFalse(os.path.exists(backup_bzr_dir))
4360.10.8 by Ian Clatworthy
add blackbox tests
205
206
    def test_upgrade_dry_run_supported(self):
4360.10.38 by Vincent Ladeuil
Use assertXXX instead of _assert_xxx helpers.
207
        self.assertLegalOption('--dry-run')
208
        self.assertBranchFormat('branch-foo', 'pack-0.92')
4360.10.8 by Ian Clatworthy
add blackbox tests
209
4634.148.1 by Martin Pool
Backport fix for permissions of backup.bzr
210
    def test_upgrade_permission_check(self):
211
        """'backup.bzr' should retain permissions of .bzr. Bug #262450"""
5094.3.2 by Martin Pool
Fix up feature name
212
        self.requireFeature(features.posix_permissions_feature)
4634.148.1 by Martin Pool
Backport fix for permissions of backup.bzr
213
        old_perms = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
5036.3.10 by Parth Malwankar
merged in trunk. fixed blackbox.test_upgrade to use backup.bzr.~N~ convention.
214
        backup_dir = 'backup.bzr.~1~'
4634.148.1 by Martin Pool
Backport fix for permissions of backup.bzr
215
        self.run_bzr('init --format=1.6')
216
        os.chmod('.bzr', old_perms)
217
        self.run_bzr('upgrade')
218
        new_perms = os.stat(backup_dir).st_mode & 0777
219
        self.assertTrue(new_perms == old_perms)
220
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
221
    def test_upgrade_with_existing_backup_dir(self):
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
222
        self.make_branch_and_tree("old_format_branch", format="knit")
223
        t = self.get_transport("old_format_branch")
5273.1.7 by Vincent Ladeuil
No more use of the get_transport imported *symbol*, all uses are through
224
        url = t.base
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
225
        backup_dir1 = 'backup.bzr.~1~'
226
        backup_dir2 = 'backup.bzr.~2~'
5035.4.6 by Parth Malwankar
added doc to test
227
        # explicitly create backup_dir1. bzr should create the .~2~ directory
228
        # as backup
5273.1.7 by Vincent Ladeuil
No more use of the get_transport imported *symbol*, all uses are through
229
        t.mkdir(backup_dir1)
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
230
        (out, err) = self.run_bzr(
5684.1.2 by Jelmer Vernooij
Fix tests.
231
            ['upgrade', '--format=2a', url])
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
232
        self.assertEqualDiff("""Upgrading branch %s ...
233
starting upgrade of %s
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
234
making backup of %s.bzr
235
  to %s%s
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
236
starting repository conversion
237
repository converted
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
238
finished
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
239
""" % (url, url, url, url, backup_dir2), out)
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
240
        self.assertEqualDiff("", err)
241
        self.assertTrue(isinstance(
5684.1.4 by Jelmer Vernooij
Use knits generally for testing
242
            bzrdir.BzrDir.open(self.get_url("old_format_branch"))._format,
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
243
            bzrdir.BzrDirMetaFormat1))
5273.1.7 by Vincent Ladeuil
No more use of the get_transport imported *symbol*, all uses are through
244
        self.assertTrue(t.has(backup_dir2))
5035.4.4 by Parth Malwankar
test updated to check for creation of backup.bzr.~2~ when backup.bzr.~1~ exists
245
5582.9.17 by Jelmer Vernooij
Fix formatting.
246
1666.1.3 by Robert Collins
Fix and test upgrades from bzrdir 6 over SFTP.
247
class SFTPTests(TestCaseWithSFTPServer):
248
    """Tests for upgrade over sftp."""
249
250
    def test_upgrade_url(self):
5684.1.2 by Jelmer Vernooij
Fix tests.
251
        self.run_bzr('init --format=pack-0.92')
5609.9.4 by Vincent Ladeuil
Use self.get_transport instead of transport.get_transport where possible.
252
        t = self.get_transport()
1666.1.3 by Robert Collins
Fix and test upgrades from bzrdir 6 over SFTP.
253
        url = t.base
5684.1.2 by Jelmer Vernooij
Fix tests.
254
        out, err = self.run_bzr(['upgrade', '--format=2a', url])
5035.4.3 by Parth Malwankar
updated existing upgrade tests to work.
255
        backup_dir = 'backup.bzr.~1~'
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
256
        self.assertEqualDiff("""Upgrading branch %s ...
257
starting upgrade of %s
3943.2.4 by Martin Pool
Move backup progress indicators from upgrade.py into backup_bzrdir, and tweak text
258
making backup of %s.bzr
5035.4.3 by Parth Malwankar
updated existing upgrade tests to work.
259
  to %s%s
1666.1.3 by Robert Collins
Fix and test upgrades from bzrdir 6 over SFTP.
260
starting repository conversion
261
repository converted
262
finished
4360.10.46 by Vincent Ladeuil
Get rid of _verbose_warning and rework the messages overall display (revealing some incoherences) and fixing the tests accordingly.
263
""" % (url, url, url, url,backup_dir), out)
1666.1.3 by Robert Collins
Fix and test upgrades from bzrdir 6 over SFTP.
264
        self.assertEqual('', err)
2323.6.1 by Martin Pool
(broken) Give a message when opening old workingtree formats suggesting upgrade
265
266
4634.2.1 by Robert Collins
Fix regression in upgrade introduced with the change to upgrade in rev 4622.
267
class UpgradeRecommendedTests(TestCaseWithTransport):
2323.6.1 by Martin Pool
(broken) Give a message when opening old workingtree formats suggesting upgrade
268
269
    def test_recommend_upgrade_wt4(self):
270
        # using a deprecated format gives a warning
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
271
        self.run_bzr('init --knit a')
272
        out, err = self.run_bzr('status a')
2323.6.1 by Martin Pool
(broken) Give a message when opening old workingtree formats suggesting upgrade
273
        self.assertContainsRe(err, 'bzr upgrade .*[/\\\\]a')
2323.5.19 by Martin Pool
No upgrade recommendation on source when cloning
274
275
    def test_no_upgrade_recommendation_from_bzrdir(self):
276
        # we should only get a recommendation to upgrade when we're accessing
277
        # the actual workingtree, not when we only open a bzrdir that contains
278
        # an old workngtree
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
279
        self.run_bzr('init --knit a')
3123.5.22 by Aaron Bentley
Change failing test to use another command, since checkout now uses trees
280
        out, err = self.run_bzr('revno a')
2323.5.19 by Martin Pool
No upgrade recommendation on source when cloning
281
        if err.find('upgrade') > -1:
282
            self.fail("message shouldn't suggest upgrade:\n%s" % err)
4634.2.1 by Robert Collins
Fix regression in upgrade introduced with the change to upgrade in rev 4622.
283
284
    def test_upgrade_shared_repo(self):
285
        repo = self.make_repository('repo', format='2a', shared=True)
286
        branch = self.make_branch_and_tree('repo/branch', format="pack-0.92")
287
        self.get_transport('repo/branch/.bzr/repository').delete_tree('.')
288
        out, err = self.run_bzr(['upgrade'], working_dir='repo/branch')