~bzr-pqm/bzr/bzr.dev

4988.10.5 by John Arbash Meinel
Merge bzr.dev 5021 to resolve NEWS
1
# Copyright (C) 2006-2010 Canonical Ltd
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
2
#
1534.5.1 by Robert Collins
Give info some reasonable output and tests.
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.5.1 by Robert Collins
Give info some reasonable output and tests.
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.5.1 by Robert Collins
Give info some reasonable output and tests.
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.5.1 by Robert Collins
Give info some reasonable output and tests.
16
17
18
"""Tests for the info command of bzr."""
19
6241.4.3 by Jelmer Vernooij
Add test for dangling tree references.
20
import shutil
1769.2.1 by Alexander Belchenko
win32 fix for blackbox.test_info.TestInfo.test_info_non_existing
21
import sys
1534.5.1 by Robert Collins
Give info some reasonable output and tests.
22
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
23
from bzrlib import (
3575.1.1 by Andrew Bennetts
Tidy imports in blackbox.test_info, fixing trivial test failure caused by a missing import.
24
    branch,
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
25
    bzrdir,
6207.3.3 by jelmer at samba
Fix tests and the like.
26
    controldir,
2804.4.1 by Alexander Belchenko
some win32-specific fixes for selftest
27
    errors,
3010.1.13 by Robert Collins
Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
28
    info,
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
29
    osutils,
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
30
    tests,
3575.1.1 by Andrew Bennetts
Tidy imports in blackbox.test_info, fixing trivial test failure caused by a missing import.
31
    upgrade,
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
32
    urlutils,
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
33
    )
6352.2.3 by Jelmer Vernooij
s/NoVfsCalls/ContainsNoVfsCalls/.
34
from bzrlib.tests.matchers import ContainsNoVfsCalls
5017.3.45 by Vincent Ladeuil
Move MemoryServer back into bzrlib.transport.memory as it's needed as soon as a MemoryTransport is used. Add a NEWS entry.
35
from bzrlib.transport import memory
5017.3.38 by Vincent Ladeuil
-s bb.test_info passing
36
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
37
38
class TestInfo(tests.TestCaseWithTransport):
1534.5.1 by Robert Collins
Give info some reasonable output and tests.
39
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
40
    def setUp(self):
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
41
        super(TestInfo, self).setUp()
4976.2.1 by Ian Clatworthy
Hide most storage formats
42
        self._repo_strings = "2a"
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
43
1694.2.6 by Martin Pool
[merge] bzr.dev
44
    def test_info_non_existing(self):
5017.3.45 by Vincent Ladeuil
Move MemoryServer back into bzrlib.transport.memory as it's needed as soon as a MemoryTransport is used. Add a NEWS entry.
45
        self.vfs_transport_factory = memory.MemoryServer
4691.2.1 by Robert Collins
Add stronger test isolation by interception BzrDir.open and checking the thing being opened is known to the test suite.
46
        location = self.get_url()
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
47
        out, err = self.run_bzr('info '+location, retcode=3)
1694.2.6 by Martin Pool
[merge] bzr.dev
48
        self.assertEqual(out, '')
2745.3.2 by Daniel Watkins
Updated tests to reflect new error text.
49
        self.assertEqual(err, 'bzr: ERROR: Not a branch: "%s".\n' % location)
1694.2.6 by Martin Pool
[merge] bzr.dev
50
6241.4.2 by Jelmer Vernooij
No longer show empty output when only control directory is present.
51
    def test_info_empty_controldir(self):
52
        self.make_bzrdir('ctrl')
53
        out, err = self.run_bzr('info ctrl')
54
        self.assertEquals(out,
6294.1.4 by Jelmer Vernooij
Fix tests.
55
            'Empty control directory (format: 2a or pack-0.92)\n'
6241.4.2 by Jelmer Vernooij
No longer show empty output when only control directory is present.
56
            'Location:\n'
57
            '  control directory: ctrl\n')
58
        self.assertEquals(err, '')
59
6241.4.3 by Jelmer Vernooij
Add test for dangling tree references.
60
    def test_info_dangling_branch_reference(self):
61
        br = self.make_branch('target')
62
        br.create_checkout('from', lightweight=True)
63
        shutil.rmtree('target')
64
        out, err = self.run_bzr('info from')
65
        self.assertEquals(out,
6294.1.4 by Jelmer Vernooij
Fix tests.
66
            'Dangling branch reference (format: 2a or pack-0.92)\n'
6241.4.3 by Jelmer Vernooij
Add test for dangling tree references.
67
            'Location:\n'
68
            '   control directory: from\n'
69
            '  checkout of branch: target\n')
70
        self.assertEquals(err, '')
71
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
72
    def test_info_standalone(self):
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
73
        transport = self.get_transport()
74
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
75
        # Create initial standalone branch
5582.10.91 by Jelmer Vernooij
Fix some tests.
76
        tree1 = self.make_branch_and_tree('standalone', 'knit')
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
77
        self.build_tree(['standalone/a'])
78
        tree1.add('a')
79
        branch1 = tree1.branch
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
80
81
        out, err = self.run_bzr('info standalone')
82
        self.assertEqualDiff(
5582.10.91 by Jelmer Vernooij
Fix some tests.
83
"""Standalone tree (format: knit)
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
84
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
85
  branch root: standalone
86
""", out)
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
87
        self.assertEqual('', err)
88
4032.2.1 by Ian Clatworthy
omit branch committers from info -v (now requires -vv)
89
        # Standalone branch - verbose mode
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
90
        out, err = self.run_bzr('info standalone -v')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
91
        self.assertEqualDiff(
5582.10.91 by Jelmer Vernooij
Fix some tests.
92
"""Standalone tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
93
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
94
  branch root: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
95
96
Format:
5582.10.91 by Jelmer Vernooij
Fix some tests.
97
       control: Meta directory format 1
98
  working tree: Working tree format 3
99
        branch: Branch format 5
100
    repository: Knit repository format 1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
101
102
In the working tree:
103
         0 unchanged
104
         0 modified
105
         1 added
106
         0 removed
107
         0 renamed
108
         0 unknown
109
         0 ignored
110
         0 versioned subdirectories
111
112
Branch history:
113
         0 revisions
4032.2.1 by Ian Clatworthy
omit branch committers from info -v (now requires -vv)
114
115
Repository:
116
         0 revisions
117
""", out)
118
        self.assertEqual('', err)
119
120
        # Standalone branch - really verbose mode
121
        out, err = self.run_bzr('info standalone -vv')
122
        self.assertEqualDiff(
5582.10.91 by Jelmer Vernooij
Fix some tests.
123
"""Standalone tree (format: knit)
4032.2.1 by Ian Clatworthy
omit branch committers from info -v (now requires -vv)
124
Location:
125
  branch root: standalone
126
127
Format:
5582.10.91 by Jelmer Vernooij
Fix some tests.
128
       control: Meta directory format 1
129
  working tree: Working tree format 3
130
        branch: Branch format 5
131
    repository: Knit repository format 1
4032.2.1 by Ian Clatworthy
omit branch committers from info -v (now requires -vv)
132
133
In the working tree:
134
         0 unchanged
135
         0 modified
136
         1 added
137
         0 removed
138
         0 renamed
139
         0 unknown
140
         0 ignored
141
         0 versioned subdirectories
142
143
Branch history:
144
         0 revisions
2363.5.11 by Aaron Bentley
All info tests pass
145
         0 committers
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
146
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
147
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
148
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
149
""", out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
150
        self.assertEqual('', err)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
151
        tree1.commit('commit one')
6165.4.1 by Jelmer Vernooij
Avoid using revision_history.
152
        rev = branch1.repository.get_revision(branch1.last_revision())
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
153
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
154
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
155
        # Branch standalone with push location
156
        branch2 = branch1.bzrdir.sprout('branch').open_branch()
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
157
        branch2.set_push_location(branch1.bzrdir.root_transport.base)
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
158
159
        out, err = self.run_bzr('info branch')
160
        self.assertEqualDiff(
5582.10.91 by Jelmer Vernooij
Fix some tests.
161
"""Standalone tree (format: knit)
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
162
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
163
  branch root: branch
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
164
165
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
166
    push branch: standalone
167
  parent branch: standalone
168
""", out)
2584.2.1 by Adeodato Simó
Make `bzr info` show related branches in non-verbose mode.
169
        self.assertEqual('', err)
170
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
171
        out, err = self.run_bzr('info branch --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
172
        self.assertEqualDiff(
5582.10.91 by Jelmer Vernooij
Fix some tests.
173
"""Standalone tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
174
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
175
  branch root: branch
1694.2.6 by Martin Pool
[merge] bzr.dev
176
177
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
178
    push branch: standalone
179
  parent branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
180
181
Format:
5582.10.91 by Jelmer Vernooij
Fix some tests.
182
       control: Meta directory format 1
183
  working tree: Working tree format 3
184
        branch: Branch format 5
185
    repository: Knit repository format 1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
186
187
In the working tree:
188
         1 unchanged
189
         0 modified
190
         0 added
191
         0 removed
192
         0 renamed
193
         0 unknown
194
         0 ignored
195
         0 versioned subdirectories
196
197
Branch history:
198
         1 revision
199
         0 days old
200
   first revision: %s
201
  latest revision: %s
202
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
203
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
204
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
205
""" % (datestring_first, datestring_first,
1694.2.6 by Martin Pool
[merge] bzr.dev
206
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
207
        self.assertEqual('', err)
208
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
209
        # Branch and bind to standalone, needs upgrade to metadir
210
        # (creates backup as unknown)
1624.3.47 by Olaf Conradi
Fix test case for bzr info in upgrading a standalone branch to metadir,
211
        branch1.bzrdir.sprout('bound')
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
212
        knit1_format = bzrdir.format_registry.make_bzrdir('knit')
3575.1.1 by Andrew Bennetts
Tidy imports in blackbox.test_info, fixing trivial test failure caused by a missing import.
213
        upgrade.upgrade('bound', knit1_format)
6207.3.3 by jelmer at samba
Fix tests and the like.
214
        branch3 = controldir.ControlDir.open('bound').open_branch()
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
215
        branch3.bind(branch1)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
216
        bound_tree = branch3.bzrdir.open_workingtree()
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
217
        out, err = self.run_bzr('info -v bound')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
218
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
219
"""Checkout (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
220
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
221
       checkout root: bound
222
  checkout of branch: standalone
1694.2.6 by Martin Pool
[merge] bzr.dev
223
224
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
225
  parent branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
226
227
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
228
       control: Meta directory format 1
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
229
  working tree: %s
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
230
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
231
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
232
233
In the working tree:
234
         1 unchanged
235
         0 modified
236
         0 added
237
         0 removed
238
         0 renamed
5035.4.8 by Martin Pool
Update info tests to cope with backup.bzr being ignored
239
         0 unknown
5582.10.91 by Jelmer Vernooij
Fix some tests.
240
         0 ignored
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
241
         0 versioned subdirectories
242
243
Branch history:
244
         1 revision
245
         0 days old
246
   first revision: %s
247
  latest revision: %s
248
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
249
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
250
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
251
""" % (bound_tree._format.get_format_description(),
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
252
       branch3._format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
253
       branch3.repository._format.get_format_description(),
254
       datestring_first, datestring_first,
255
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
256
        self.assertEqual('', err)
257
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
258
        # Checkout standalone (same as above, but does not have parent set)
6207.3.3 by jelmer at samba
Fix tests and the like.
259
        branch4 = controldir.ControlDir.create_branch_convenience('checkout',
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
260
            format=knit1_format)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
261
        branch4.bind(branch1)
262
        branch4.bzrdir.open_workingtree().update()
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
263
        out, err = self.run_bzr('info checkout --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
264
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
265
"""Checkout (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
266
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
267
       checkout root: checkout
268
  checkout of branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
269
270
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
271
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
272
  working tree: Working tree format 3
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
273
        branch: Branch format 5
1666.1.6 by Robert Collins
Make knit the default format.
274
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
275
276
In the working tree:
277
         1 unchanged
278
         0 modified
279
         0 added
280
         0 removed
281
         0 renamed
282
         0 unknown
283
         0 ignored
284
         0 versioned subdirectories
285
286
Branch history:
287
         1 revision
288
         0 days old
289
   first revision: %s
290
  latest revision: %s
291
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
292
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
293
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
294
""" % (branch4.repository._format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
295
       datestring_first, datestring_first,
296
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
297
        self.assertEqual('', err)
298
299
        # Lightweight checkout (same as above, different branch and repository)
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
300
        tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
301
        branch5 = tree5.branch
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
302
        out, err = self.run_bzr('info -v lightcheckout')
5728.2.1 by Jelmer Vernooij
Fix bb.test_info with both --no-plugins and without --no-plugins.
303
        if "metaweave" in bzrdir.format_registry:
304
            format_description = "knit or metaweave"
305
        else:
306
            format_description = "knit"
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
307
        self.assertEqualDiff(
5728.2.1 by Jelmer Vernooij
Fix bb.test_info with both --no-plugins and without --no-plugins.
308
"""Lightweight checkout (format: %s)
2363.5.3 by Aaron Bentley
Add layout description to info output
309
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
310
  light checkout root: lightcheckout
311
   checkout of branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
312
313
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
314
       control: Meta directory format 1
5582.10.91 by Jelmer Vernooij
Fix some tests.
315
  working tree: Working tree format 3
316
        branch: Branch format 5
317
    repository: Knit repository format 1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
318
319
In the working tree:
320
         1 unchanged
321
         0 modified
322
         0 added
323
         0 removed
324
         0 renamed
325
         0 unknown
326
         0 ignored
327
         0 versioned subdirectories
328
329
Branch history:
330
         1 revision
331
         0 days old
332
   first revision: %s
333
  latest revision: %s
334
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
335
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
336
         1 revision
5728.2.1 by Jelmer Vernooij
Fix bb.test_info with both --no-plugins and without --no-plugins.
337
""" % (format_description, datestring_first, datestring_first,), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
338
        self.assertEqual('', err)
339
340
        # Update initial standalone branch
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
341
        self.build_tree(['standalone/b'])
342
        tree1.add('b')
343
        tree1.commit('commit two')
6165.4.1 by Jelmer Vernooij
Avoid using revision_history.
344
        rev = branch1.repository.get_revision(branch1.last_revision())
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
345
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
346
347
        # Out of date branched standalone branch will not be detected
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
348
        out, err = self.run_bzr('info -v branch')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
349
        self.assertEqualDiff(
5582.10.91 by Jelmer Vernooij
Fix some tests.
350
"""Standalone tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
351
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
352
  branch root: branch
1694.2.6 by Martin Pool
[merge] bzr.dev
353
354
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
355
    push branch: standalone
356
  parent branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
357
358
Format:
5582.10.91 by Jelmer Vernooij
Fix some tests.
359
       control: Meta directory format 1
360
  working tree: Working tree format 3
361
        branch: Branch format 5
362
    repository: Knit repository format 1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
363
364
In the working tree:
365
         1 unchanged
366
         0 modified
367
         0 added
368
         0 removed
369
         0 renamed
370
         0 unknown
371
         0 ignored
372
         0 versioned subdirectories
373
374
Branch history:
375
         1 revision
376
         0 days old
377
   first revision: %s
378
  latest revision: %s
379
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
380
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
381
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
382
""" % (datestring_first, datestring_first,
1694.2.6 by Martin Pool
[merge] bzr.dev
383
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
384
        self.assertEqual('', err)
385
386
        # Out of date bound branch
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
387
        out, err = self.run_bzr('info -v bound')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
388
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
389
"""Checkout (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
390
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
391
       checkout root: bound
392
  checkout of branch: standalone
1694.2.6 by Martin Pool
[merge] bzr.dev
393
394
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
395
  parent branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
396
397
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
398
       control: Meta directory format 1
399
  working tree: Working tree format 3
400
        branch: Branch format 5
1666.1.6 by Robert Collins
Make knit the default format.
401
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
402
403
Branch is out of date: missing 1 revision.
404
405
In the working tree:
406
         1 unchanged
407
         0 modified
408
         0 added
409
         0 removed
410
         0 renamed
5035.4.8 by Martin Pool
Update info tests to cope with backup.bzr being ignored
411
         0 unknown
5582.10.91 by Jelmer Vernooij
Fix some tests.
412
         0 ignored
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
413
         0 versioned subdirectories
414
415
Branch history:
416
         1 revision
417
         0 days old
418
   first revision: %s
419
  latest revision: %s
420
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
421
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
422
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
423
""" % (branch3.repository._format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
424
       datestring_first, datestring_first,
425
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
426
        self.assertEqual('', err)
427
428
        # Out of date checkout
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
429
        out, err = self.run_bzr('info -v checkout')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
430
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
431
"""Checkout (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
432
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
433
       checkout root: checkout
434
  checkout of branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
435
436
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
437
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
438
  working tree: Working tree format 3
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
439
        branch: Branch format 5
1666.1.6 by Robert Collins
Make knit the default format.
440
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
441
442
Branch is out of date: missing 1 revision.
443
444
In the working tree:
445
         1 unchanged
446
         0 modified
447
         0 added
448
         0 removed
449
         0 renamed
450
         0 unknown
451
         0 ignored
452
         0 versioned subdirectories
453
454
Branch history:
455
         1 revision
456
         0 days old
457
   first revision: %s
458
  latest revision: %s
459
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
460
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
461
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
462
""" % (branch4.repository._format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
463
       datestring_first, datestring_first,
464
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
465
        self.assertEqual('', err)
466
467
        # Out of date lightweight checkout
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
468
        out, err = self.run_bzr('info lightcheckout --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
469
        self.assertEqualDiff(
5728.2.1 by Jelmer Vernooij
Fix bb.test_info with both --no-plugins and without --no-plugins.
470
"""Lightweight checkout (format: %s)
2363.5.3 by Aaron Bentley
Add layout description to info output
471
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
472
  light checkout root: lightcheckout
473
   checkout of branch: standalone
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
474
475
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
476
       control: Meta directory format 1
5582.10.91 by Jelmer Vernooij
Fix some tests.
477
  working tree: Working tree format 3
478
        branch: Branch format 5
479
    repository: Knit repository format 1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
480
481
Working tree is out of date: missing 1 revision.
482
483
In the working tree:
484
         1 unchanged
485
         0 modified
486
         0 added
487
         0 removed
488
         0 renamed
489
         0 unknown
490
         0 ignored
491
         0 versioned subdirectories
492
493
Branch history:
494
         2 revisions
495
         0 days old
496
   first revision: %s
497
  latest revision: %s
498
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
499
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
500
         2 revisions
5728.2.1 by Jelmer Vernooij
Fix bb.test_info with both --no-plugins and without --no-plugins.
501
""" % (format_description, datestring_first, datestring_last,), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
502
        self.assertEqual('', err)
503
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
504
    def test_info_standalone_no_tree(self):
505
        # create standalone branch without a working tree
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
506
        format = bzrdir.format_registry.make_bzrdir('default')
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
507
        branch = self.make_branch('branch')
508
        repo = branch.repository
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
509
        out, err = self.run_bzr('info branch -v')
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
510
        self.assertEqualDiff(
3010.1.13 by Robert Collins
Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
511
"""Standalone branch (format: %s)
2363.5.3 by Aaron Bentley
Add layout description to info output
512
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
513
  branch root: branch
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
514
515
Format:
516
       control: Meta directory format 1
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
517
        branch: %s
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
518
    repository: %s
519
520
Branch history:
521
         0 revisions
522
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
523
Repository:
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
524
         0 revisions
3010.1.13 by Robert Collins
Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
525
""" % (info.describe_format(repo.bzrdir, repo, branch, None),
526
       format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
527
       format.repository_format.get_format_description(),
1624.3.48 by Olaf Conradi
Add info on standalone branches without a working tree.
528
       ), out)
529
        self.assertEqual('', err)
530
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
531
    def test_info_shared_repository(self):
2241.1.4 by Martin Pool
Moved old weave-based repository formats into bzrlib.repofmt.weaverepo.
532
        format = bzrdir.format_registry.make_bzrdir('knit')
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
533
        transport = self.get_transport()
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
534
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
535
        # Create shared repository
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
536
        repo = self.make_repository('repo', shared=True, format=format)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
537
        repo.set_make_working_trees(False)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
538
        out, err = self.run_bzr('info -v repo')
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
539
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
540
"""Shared repository (format: dirstate or dirstate-tags or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
541
Location:
1694.2.6 by Martin Pool
[merge] bzr.dev
542
  shared repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
543
544
Format:
545
       control: Meta directory format 1
1666.1.6 by Robert Collins
Make knit the default format.
546
    repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
547
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
548
Repository:
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
549
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
550
""" % ('repo', format.repository_format.get_format_description(),
1694.2.6 by Martin Pool
[merge] bzr.dev
551
       ), out)
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
552
        self.assertEqual('', err)
553
554
        # Create branch inside shared repository
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
555
        repo.bzrdir.root_transport.mkdir('branch')
6207.3.8 by Jelmer Vernooij
Fix a bunch of tests.
556
        branch1 = controldir.ControlDir.create_branch_convenience(
557
            'repo/branch', format=format)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
558
        out, err = self.run_bzr('info -v repo/branch')
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
559
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
560
"""Repository branch (format: dirstate or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
561
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
562
  shared repository: repo
563
  repository branch: repo/branch
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
564
565
Format:
566
       control: Meta directory format 1
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
567
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
568
    repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
569
570
Branch history:
571
         0 revisions
572
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
573
Repository:
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
574
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
575
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
576
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
577
       ), out)
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
578
        self.assertEqual('', err)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
579
580
        # Create lightweight checkout
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
581
        transport.mkdir('tree')
582
        transport.mkdir('tree/lightcheckout')
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
583
        tree2 = branch1.create_checkout('tree/lightcheckout',
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
584
            lightweight=True)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
585
        branch2 = tree2.branch
2363.5.11 by Aaron Bentley
All info tests pass
586
        self.assertCheckoutStatusOutput('-v tree/lightcheckout', tree2,
2363.5.18 by Aaron Bentley
Get all tests passing
587
                   shared_repo=repo, repo_branch=branch1, verbose=True)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
588
589
        # Create normal checkout
1551.8.5 by Aaron Bentley
Change name to create_checkout
590
        tree3 = branch1.create_checkout('tree/checkout')
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
591
        self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
592
            verbose=True,
593
            light_checkout=False, repo_branch=branch1)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
594
        # Update lightweight checkout
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
595
        self.build_tree(['tree/lightcheckout/a'])
596
        tree2.add('a')
597
        tree2.commit('commit one')
6165.4.1 by Jelmer Vernooij
Avoid using revision_history.
598
        rev = repo.get_revision(branch2.last_revision())
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
599
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
600
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
601
        self.assertEqualDiff(
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
602
"""Lightweight checkout (format: %s)
2363.5.3 by Aaron Bentley
Add layout description to info output
603
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
604
  light checkout root: tree/lightcheckout
605
   checkout of branch: repo/branch
606
    shared repository: repo
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
607
608
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
609
       control: Meta directory format 1
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
610
  working tree: Working tree format 6
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
611
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
612
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
613
614
In the working tree:
615
         1 unchanged
616
         0 modified
617
         0 added
618
         0 removed
619
         0 renamed
620
         0 unknown
621
         0 ignored
622
         0 versioned subdirectories
623
624
Branch history:
625
         1 revision
626
         0 days old
627
   first revision: %s
628
  latest revision: %s
629
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
630
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
631
         1 revision
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
632
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
633
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
634
       datestring_first, datestring_first,
635
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
636
        self.assertEqual('', err)
637
638
        # Out of date checkout
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
639
        out, err = self.run_bzr('info -v tree/checkout')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
640
        self.assertEqualDiff(
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
641
"""Checkout (format: unnamed)
2363.5.3 by Aaron Bentley
Add layout description to info output
642
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
643
       checkout root: tree/checkout
644
  checkout of branch: repo/branch
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
645
646
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
647
       control: Meta directory format 1
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
648
  working tree: Working tree format 6
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
649
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
650
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
651
652
Branch is out of date: missing 1 revision.
653
654
In the working tree:
655
         0 unchanged
656
         0 modified
657
         0 added
658
         0 removed
659
         0 renamed
660
         0 unknown
661
         0 ignored
662
         0 versioned subdirectories
663
664
Branch history:
665
         0 revisions
666
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
667
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
668
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
669
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
670
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
671
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
672
        self.assertEqual('', err)
673
674
        # Update checkout
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
675
        tree3.update()
676
        self.build_tree(['tree/checkout/b'])
677
        tree3.add('b')
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
678
        out, err = self.run_bzr('info tree/checkout --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
679
        self.assertEqualDiff(
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
680
"""Checkout (format: unnamed)
2363.5.3 by Aaron Bentley
Add layout description to info output
681
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
682
       checkout root: tree/checkout
683
  checkout of branch: repo/branch
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
684
685
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
686
       control: Meta directory format 1
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
687
  working tree: Working tree format 6
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
688
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
689
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
690
691
In the working tree:
692
         1 unchanged
693
         0 modified
694
         1 added
695
         0 removed
696
         0 renamed
697
         0 unknown
698
         0 ignored
699
         0 versioned subdirectories
700
701
Branch history:
702
         1 revision
703
         0 days old
704
   first revision: %s
705
  latest revision: %s
706
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
707
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
708
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
709
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
710
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
711
       datestring_first, datestring_first,
712
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
713
        self.assertEqual('', err)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
714
        tree3.commit('commit two')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
715
716
        # Out of date lightweight checkout
6165.4.1 by Jelmer Vernooij
Avoid using revision_history.
717
        rev = repo.get_revision(branch1.last_revision())
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
718
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
719
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
720
        self.assertEqualDiff(
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
721
"""Lightweight checkout (format: %s)
2363.5.3 by Aaron Bentley
Add layout description to info output
722
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
723
  light checkout root: tree/lightcheckout
724
   checkout of branch: repo/branch
725
    shared repository: repo
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
726
727
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
728
       control: Meta directory format 1
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
729
  working tree: Working tree format 6
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
730
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
731
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
732
733
Working tree is out of date: missing 1 revision.
734
735
In the working tree:
736
         1 unchanged
737
         0 modified
738
         0 added
739
         0 removed
740
         0 renamed
741
         0 unknown
742
         0 ignored
743
         0 versioned subdirectories
744
745
Branch history:
746
         2 revisions
747
         0 days old
748
   first revision: %s
749
  latest revision: %s
750
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
751
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
752
         2 revisions
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
753
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
754
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
755
       datestring_first, datestring_last,
756
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
757
        self.assertEqual('', err)
758
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
759
        # Show info about shared branch
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
760
        out, err = self.run_bzr('info repo/branch --verbose')
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
761
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
762
"""Repository branch (format: dirstate or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
763
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
764
  shared repository: repo
765
  repository branch: repo/branch
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
766
767
Format:
768
       control: Meta directory format 1
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
769
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
770
    repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
771
772
Branch history:
773
         2 revisions
774
         0 days old
775
   first revision: %s
776
  latest revision: %s
777
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
778
Repository:
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
779
         2 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
780
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
781
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
782
       datestring_first, datestring_last,
783
       ), out)
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
784
        self.assertEqual('', err)
785
786
        # Show info about repository with revisions
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
787
        out, err = self.run_bzr('info -v repo')
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
788
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
789
"""Shared repository (format: dirstate or dirstate-tags or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
790
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
791
  shared repository: repo
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
792
793
Format:
794
       control: Meta directory format 1
1666.1.6 by Robert Collins
Make knit the default format.
795
    repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
796
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
797
Repository:
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
798
         2 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
799
""" % (format.repository_format.get_format_description(),
1694.2.6 by Martin Pool
[merge] bzr.dev
800
       ), out)
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
801
        self.assertEqual('', err)
802
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
803
    def test_info_shared_repository_with_trees(self):
2241.1.4 by Martin Pool
Moved old weave-based repository formats into bzrlib.repofmt.weaverepo.
804
        format = bzrdir.format_registry.make_bzrdir('knit')
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
805
        transport = self.get_transport()
806
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
807
        # Create shared repository with working trees
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
808
        repo = self.make_repository('repo', shared=True, format=format)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
809
        repo.set_make_working_trees(True)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
810
        out, err = self.run_bzr('info -v repo')
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
811
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
812
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
813
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
814
  shared repository: repo
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
815
816
Format:
817
       control: Meta directory format 1
1666.1.6 by Robert Collins
Make knit the default format.
818
    repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
819
820
Create working tree for new branches inside the repository.
821
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
822
Repository:
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
823
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
824
""" % (format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
825
       ), out)
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
826
        self.assertEqual('', err)
827
828
        # Create two branches
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
829
        repo.bzrdir.root_transport.mkdir('branch1')
6207.3.3 by jelmer at samba
Fix tests and the like.
830
        branch1 = controldir.ControlDir.create_branch_convenience('repo/branch1',
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
831
            format=format)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
832
        branch2 = branch1.bzrdir.sprout('repo/branch2').open_branch()
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
833
834
        # Empty first branch
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
835
        out, err = self.run_bzr('info repo/branch1 --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
836
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
837
"""Repository tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
838
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
839
  shared repository: repo
840
  repository branch: repo/branch1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
841
842
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
843
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
844
  working tree: Working tree format 3
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
845
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
846
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
847
848
In the working tree:
849
         0 unchanged
850
         0 modified
851
         0 added
852
         0 removed
853
         0 renamed
854
         0 unknown
855
         0 ignored
856
         0 versioned subdirectories
857
858
Branch history:
859
         0 revisions
860
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
861
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
862
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
863
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
864
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
865
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
866
        self.assertEqual('', err)
867
868
        # Update first branch
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
869
        self.build_tree(['repo/branch1/a'])
870
        tree1 = branch1.bzrdir.open_workingtree()
871
        tree1.add('a')
872
        tree1.commit('commit one')
6165.4.1 by Jelmer Vernooij
Avoid using revision_history.
873
        rev = repo.get_revision(branch1.last_revision())
5010.2.2 by Vincent Ladeuil
Fix blackbox/test_infp.py imports.
874
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
875
        out, err = self.run_bzr('info -v repo/branch1')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
876
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
877
"""Repository tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
878
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
879
  shared repository: repo
880
  repository branch: repo/branch1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
881
882
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
883
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
884
  working tree: Working tree format 3
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
885
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
886
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
887
888
In the working tree:
889
         1 unchanged
890
         0 modified
891
         0 added
892
         0 removed
893
         0 renamed
894
         0 unknown
895
         0 ignored
896
         0 versioned subdirectories
897
898
Branch history:
899
         1 revision
900
         0 days old
901
   first revision: %s
902
  latest revision: %s
903
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
904
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
905
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
906
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
907
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
908
       datestring_first, datestring_first,
909
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
910
        self.assertEqual('', err)
911
912
        # Out of date second branch
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
913
        out, err = self.run_bzr('info repo/branch2 --verbose')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
914
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
915
"""Repository tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
916
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
917
  shared repository: repo
918
  repository branch: repo/branch2
1694.2.6 by Martin Pool
[merge] bzr.dev
919
920
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
921
  parent branch: repo/branch1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
922
923
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
924
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
925
  working tree: Working tree format 3
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
926
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
927
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
928
929
In the working tree:
930
         0 unchanged
931
         0 modified
932
         0 added
933
         0 removed
934
         0 renamed
935
         0 unknown
936
         0 ignored
937
         0 versioned subdirectories
938
939
Branch history:
940
         0 revisions
941
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
942
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
943
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
944
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
945
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
946
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
947
        self.assertEqual('', err)
948
949
        # Update second branch
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
950
        tree2 = branch2.bzrdir.open_workingtree()
951
        tree2.pull(branch1)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
952
        out, err = self.run_bzr('info -v repo/branch2')
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
953
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
954
"""Repository tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
955
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
956
  shared repository: repo
957
  repository branch: repo/branch2
1694.2.6 by Martin Pool
[merge] bzr.dev
958
959
Related branches:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
960
  parent branch: repo/branch1
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
961
962
Format:
1624.3.19 by Olaf Conradi
New call get_format_description to give a user-friendly description of a
963
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
964
  working tree: Working tree format 3
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
965
        branch: %s
1666.1.6 by Robert Collins
Make knit the default format.
966
    repository: %s
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
967
968
In the working tree:
969
         1 unchanged
970
         0 modified
971
         0 added
972
         0 removed
973
         0 renamed
974
         0 unknown
975
         0 ignored
976
         0 versioned subdirectories
977
978
Branch history:
979
         1 revision
980
         0 days old
981
   first revision: %s
982
  latest revision: %s
983
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
984
Repository:
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
985
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
986
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
987
       format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
988
       datestring_first, datestring_first,
989
       ), out)
1624.3.10 by Olaf Conradi
Add blackbox test case for command bzr info.
990
        self.assertEqual('', err)
1624.3.18 by Olaf Conradi
Move to using bzrlib API for blackbox test cases.
991
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
992
        # Show info about repository with revisions
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
993
        out, err = self.run_bzr('info -v repo')
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
994
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
995
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
996
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
997
  shared repository: repo
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
998
999
Format:
1000
       control: Meta directory format 1
1666.1.6 by Robert Collins
Make knit the default format.
1001
    repository: %s
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
1002
1003
Create working tree for new branches inside the repository.
1004
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
1005
Repository:
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
1006
         1 revision
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1007
""" % (format.repository_format.get_format_description(),
1666.1.6 by Robert Collins
Make knit the default format.
1008
       ),
1009
       out)
1624.3.21 by Olaf Conradi
Make bzr info command work on both local and remote locations. Support
1010
        self.assertEqual('', err)
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
1011
1694.2.6 by Martin Pool
[merge] bzr.dev
1012
    def test_info_shared_repository_with_tree_in_root(self):
2241.1.4 by Martin Pool
Moved old weave-based repository formats into bzrlib.repofmt.weaverepo.
1013
        format = bzrdir.format_registry.make_bzrdir('knit')
1694.2.6 by Martin Pool
[merge] bzr.dev
1014
        transport = self.get_transport()
1015
1016
        # Create shared repository with working trees
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
1017
        repo = self.make_repository('repo', shared=True, format=format)
1694.2.6 by Martin Pool
[merge] bzr.dev
1018
        repo.set_make_working_trees(True)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
1019
        out, err = self.run_bzr('info -v repo')
1694.2.6 by Martin Pool
[merge] bzr.dev
1020
        self.assertEqualDiff(
2363.5.17 by Aaron Bentley
Change separator from '/' to 'or'
1021
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
1022
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1023
  shared repository: repo
1694.2.6 by Martin Pool
[merge] bzr.dev
1024
1025
Format:
1026
       control: Meta directory format 1
1027
    repository: %s
1028
1029
Create working tree for new branches inside the repository.
1030
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
1031
Repository:
1694.2.6 by Martin Pool
[merge] bzr.dev
1032
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1033
""" % (format.repository_format.get_format_description(),
1694.2.6 by Martin Pool
[merge] bzr.dev
1034
       ), out)
1035
        self.assertEqual('', err)
1036
1037
        # Create branch in root of repository
1038
        control = repo.bzrdir
1039
        branch = control.create_branch()
1040
        control.create_workingtree()
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
1041
        out, err = self.run_bzr('info -v repo')
1694.2.6 by Martin Pool
[merge] bzr.dev
1042
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
1043
"""Repository tree (format: knit)
2363.5.3 by Aaron Bentley
Add layout description to info output
1044
Location:
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1045
  shared repository: repo
1046
  repository branch: repo
1694.2.6 by Martin Pool
[merge] bzr.dev
1047
1048
Format:
1049
       control: Meta directory format 1
2255.2.201 by Robert Collins
Test_info needed updating after freezing the meaning of 'knit' format dirs.
1050
  working tree: Working tree format 3
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
1051
        branch: %s
1694.2.6 by Martin Pool
[merge] bzr.dev
1052
    repository: %s
1053
1054
In the working tree:
1055
         0 unchanged
1056
         0 modified
1057
         0 added
1058
         0 removed
1059
         0 renamed
1060
         0 unknown
1061
         0 ignored
1062
         0 versioned subdirectories
1063
1064
Branch history:
1065
         0 revisions
1066
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
1067
Repository:
1694.2.6 by Martin Pool
[merge] bzr.dev
1068
         0 revisions
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1069
""" % (format.get_branch_format().get_format_description(),
2204.4.13 by Aaron Bentley
Update all test cases to avoid set_default_format
1070
       format.repository_format.get_format_description(),
1694.2.6 by Martin Pool
[merge] bzr.dev
1071
       ), out)
1072
        self.assertEqual('', err)
1073
4307.3.2 by Jelmer Vernooij
Add tests for the repository info hook.
1074
    def test_info_repository_hook(self):
1075
        format = bzrdir.format_registry.make_bzrdir('knit')
4307.3.3 by Jelmer Vernooij
Add repository argument to 'repository' info hook, per Roberts review.
1076
        def repo_info(repo, stats, outf):
4307.3.2 by Jelmer Vernooij
Add tests for the repository info hook.
1077
            outf.write("more info\n")
1078
        info.hooks.install_named_hook('repository', repo_info, None)
1079
        # Create shared repository with working trees
1080
        repo = self.make_repository('repo', shared=True, format=format)
1081
        out, err = self.run_bzr('info -v repo')
1082
        self.assertEqualDiff(
1083
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
1084
Location:
1085
  shared repository: repo
1086
1087
Format:
1088
       control: Meta directory format 1
1089
    repository: %s
1090
1091
Create working tree for new branches inside the repository.
1092
1093
Repository:
1094
         0 revisions
1095
more info
1096
""" % (format.repository_format.get_format_description(),
1097
       ), out)
1098
        self.assertEqual('', err)
1099
6437.9.1 by Jelmer Vernooij
Report present but unused colocated branches in `bzr info`.
1100
    def test_info_unshared_repository_with_colocated_branches(self):
1101
        format = bzrdir.format_registry.make_bzrdir('development-colo')
1102
        transport = self.get_transport()
1103
6437.9.2 by Jelmer Vernooij
Fix typo in comment.
1104
        # Create unshared repository
6437.9.1 by Jelmer Vernooij
Report present but unused colocated branches in `bzr info`.
1105
        repo = self.make_repository('repo', shared=False, format=format)
1106
        repo.set_make_working_trees(True)
1107
        repo.bzrdir.create_branch(name='foo')
1108
        out, err = self.run_bzr('info repo')
1109
        self.assertEqualDiff(
1110
"""Unshared repository with trees and colocated branches (format: development-colo)
1111
Location:
1112
  repository: repo
1113
""", out)
1114
        self.assertEqual('', err)
1115
3010.1.13 by Robert Collins
Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
1116
    def assertCheckoutStatusOutput(self,
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1117
        command_string, lco_tree, shared_repo=None,
1118
        repo_branch=None,
1119
        tree_locked=False,
1120
        branch_locked=False, repo_locked=False,
1121
        verbose=False,
2363.5.18 by Aaron Bentley
Get all tests passing
1122
        light_checkout=True,
1123
        checkout_root=None):
1124
        """Check the output of info in a checkout.
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1125
1126
        This is not quite a mirror of the info code: rather than using the
1127
        tree being examined to predict output, it uses a bunch of flags which
1128
        allow us, the test writers, to document what *should* be present in
1129
        the output. Removing this separation would remove the value of the
1130
        tests.
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
1131
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1132
        :param path: the path to the light checkout.
1133
        :param lco_tree: the tree object for the light checkout.
1134
        :param shared_repo: A shared repository is in use, expect that in
1135
            the output.
1136
        :param repo_branch: A branch in a shared repository for non light
1137
            checkouts.
1138
        :param tree_locked: If true, expect the tree to be locked.
1139
        :param branch_locked: If true, expect the branch to be locked.
1140
        :param repo_locked: If true, expect the repository to be locked.
3010.1.13 by Robert Collins
Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
1141
            Note that the lco_tree.branch.repository is inspected, and if is not
1142
            actually locked then this parameter is overridden. This is because
1143
            pack repositories do not have any public API for obtaining an
1144
            exclusive repository wide lock.
4032.2.1 by Ian Clatworthy
omit branch committers from info -v (now requires -vv)
1145
        :param verbose: verbosity level: 2 or higher to show committers
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1146
        """
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1147
        def friendly_location(url):
1148
            path = urlutils.unescape_for_display(url, 'ascii')
1149
            try:
2804.4.3 by Alexander Belchenko
fix for test_info-tests: using osutils.getcwd instead of os.getcwd (sigh)
1150
                return osutils.relpath(osutils.getcwd(), path)
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1151
            except errors.PathNotChild:
1152
                return path
1153
3113.5.1 by Alexander Belchenko
XFAIL test for #174055: can't run bzr info while dirstate is locked
1154
        if tree_locked:
1155
            # We expect this to fail because of locking errors.
1156
            # (A write-locked file cannot be read-locked
1157
            # in the different process -- either on win32 or on linux).
2425.3.3 by John Arbash Meinel
Update comment according to Martin
1158
            # This should be removed when the locking errors are fixed.
3113.5.1 by Alexander Belchenko
XFAIL test for #174055: can't run bzr info while dirstate is locked
1159
            self.expectFailure('OS locks are exclusive '
1160
                'for different processes (Bug #174055)',
1161
                self.run_bzr_subprocess,
1162
                'info ' + command_string)
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
1163
        out, err = self.run_bzr('info %s' % command_string)
2363.5.3 by Aaron Bentley
Add layout description to info output
1164
        description = {
2363.5.4 by Aaron Bentley
Eliminate the concept of a 'repository lightweight checkout'
1165
            (True, True): 'Lightweight checkout',
2363.5.3 by Aaron Bentley
Add layout description to info output
1166
            (True, False): 'Repository checkout',
1167
            (False, True): 'Lightweight checkout',
1168
            (False, False): 'Checkout',
1169
            }[(shared_repo is not None, light_checkout)]
4599.3.1 by Robert Collins
Factor out some string duplication from blackbox.test_info to make changing the default format easier.
1170
        format = {True: self._repo_strings,
4599.4.7 by Robert Collins
Update blackbox.test_info tests for 2a as default.
1171
                  False: 'unnamed'}[light_checkout]
3010.1.13 by Robert Collins
Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
1172
        if repo_locked:
1173
            repo_locked = lco_tree.branch.repository.get_physical_lock_status()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1174
        if repo_locked or branch_locked or tree_locked:
1175
            def locked_message(a_bool):
1176
                if a_bool:
1177
                    return 'locked'
1178
                else:
1179
                    return 'unlocked'
1180
            expected_lock_output = (
1181
                "\n"
1182
                "Lock status:\n"
1183
                "  working tree: %s\n"
1184
                "        branch: %s\n"
1185
                "    repository: %s\n" % (
1186
                    locked_message(tree_locked),
1187
                    locked_message(branch_locked),
1188
                    locked_message(repo_locked)))
1189
        else:
1190
            expected_lock_output = ''
2363.5.18 by Aaron Bentley
Get all tests passing
1191
        tree_data = ''
1192
        extra_space = ''
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1193
        if light_checkout:
2363.5.18 by Aaron Bentley
Get all tests passing
1194
            tree_data = ("  light checkout root: %s\n" %
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1195
                friendly_location(lco_tree.bzrdir.root_transport.base))
2363.5.18 by Aaron Bentley
Get all tests passing
1196
            extra_space = ' '
1197
        if lco_tree.branch.get_bound_location() is not None:
1198
            tree_data += ("%s       checkout root: %s\n" % (extra_space,
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1199
                friendly_location(lco_tree.branch.bzrdir.root_transport.base)))
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1200
        if shared_repo is not None:
1201
            branch_data = (
2363.5.18 by Aaron Bentley
Get all tests passing
1202
                "   checkout of branch: %s\n"
1203
                "    shared repository: %s\n" %
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1204
                (friendly_location(repo_branch.bzrdir.root_transport.base),
1205
                 friendly_location(shared_repo.bzrdir.root_transport.base)))
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1206
        elif repo_branch is not None:
1207
            branch_data = (
2363.5.18 by Aaron Bentley
Get all tests passing
1208
                "%s  checkout of branch: %s\n" %
1209
                (extra_space,
1551.15.41 by Aaron Bentley
Make info provide more related brances, and format all branches nicely
1210
                 friendly_location(repo_branch.bzrdir.root_transport.base)))
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1211
        else:
2363.5.18 by Aaron Bentley
Get all tests passing
1212
            branch_data = ("   checkout of branch: %s\n" %
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1213
                lco_tree.branch.bzrdir.root_transport.base)
4035.1.2 by Ian Clatworthy
clean-up trailing whitespace
1214
4032.2.1 by Ian Clatworthy
omit branch committers from info -v (now requires -vv)
1215
        if verbose >= 2:
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1216
            verbose_info = '         0 committers\n'
1217
        else:
1218
            verbose_info = ''
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
1219
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1220
        self.assertEqualDiff(
2363.5.6 by Aaron Bentley
Add short format description
1221
"""%s (format: %s)
2363.5.3 by Aaron Bentley
Add layout description to info output
1222
Location:
2363.5.18 by Aaron Bentley
Get all tests passing
1223
%s%s
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1224
Format:
1225
       control: Meta directory format 1
1226
  working tree: %s
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
1227
        branch: %s
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1228
    repository: %s
1229
%s
1230
In the working tree:
1231
         0 unchanged
1232
         0 modified
1233
         0 added
1234
         0 removed
1235
         0 renamed
1236
         0 unknown
1237
         0 ignored
1238
         0 versioned subdirectories
1239
1240
Branch history:
1241
         0 revisions
1242
%s
2395.1.1 by Martin Pool
rename 'revision store' to 'repository' in bzr info
1243
Repository:
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1244
         0 revisions
2363.5.3 by Aaron Bentley
Add layout description to info output
1245
""" %  (description,
2363.5.6 by Aaron Bentley
Add short format description
1246
        format,
2363.5.3 by Aaron Bentley
Add layout description to info output
1247
        tree_data,
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1248
        branch_data,
1249
        lco_tree._format.get_format_description(),
2230.3.13 by Aaron Bentley
Fix most info tests (but some depend on odd cloning behavior)
1250
        lco_tree.branch._format.get_format_description(),
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1251
        lco_tree.branch.repository._format.get_format_description(),
1252
        expected_lock_output,
1253
        verbose_info,
1254
        ), out)
1255
        self.assertEqual('', err)
1256
1694.2.6 by Martin Pool
[merge] bzr.dev
1257
    def test_info_locking(self):
1258
        transport = self.get_transport()
1259
        # Create shared repository with a branch
1260
        repo = self.make_repository('repo', shared=True,
3575.1.1 by Andrew Bennetts
Tidy imports in blackbox.test_info, fixing trivial test failure caused by a missing import.
1261
                                    format=bzrdir.BzrDirMetaFormat1())
1694.2.6 by Martin Pool
[merge] bzr.dev
1262
        repo.set_make_working_trees(False)
1263
        repo.bzrdir.root_transport.mkdir('branch')
6207.3.3 by jelmer at samba
Fix tests and the like.
1264
        repo_branch = controldir.ControlDir.create_branch_convenience(
1265
            'repo/branch', format=bzrdir.BzrDirMetaFormat1())
1694.2.6 by Martin Pool
[merge] bzr.dev
1266
        # Do a heavy checkout
1267
        transport.mkdir('tree')
1268
        transport.mkdir('tree/checkout')
6207.3.8 by Jelmer Vernooij
Fix a bunch of tests.
1269
        co_branch = controldir.ControlDir.create_branch_convenience(
1270
            'tree/checkout', format=bzrdir.BzrDirMetaFormat1())
1694.2.6 by Martin Pool
[merge] bzr.dev
1271
        co_branch.bind(repo_branch)
1272
        # Do a light checkout of the heavy one
1273
        transport.mkdir('tree/lightcheckout')
3575.1.1 by Andrew Bennetts
Tidy imports in blackbox.test_info, fixing trivial test failure caused by a missing import.
1274
        lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
6437.7.3 by Jelmer Vernooij
Use ControlDir.set_branch_reference.
1275
        lco_dir.set_branch_reference(co_branch)
1694.2.6 by Martin Pool
[merge] bzr.dev
1276
        lco_dir.create_workingtree()
1277
        lco_tree = lco_dir.open_workingtree()
1278
1279
        # Test all permutations of locking the working tree, branch and repository
1280
        # W B R
1281
1282
        # U U U
2363.5.11 by Aaron Bentley
All info tests pass
1283
        self.assertCheckoutStatusOutput('-v tree/lightcheckout', lco_tree,
2363.5.18 by Aaron Bentley
Get all tests passing
1284
                                        repo_branch=repo_branch,
1285
                                        verbose=True, light_checkout=True)
1694.2.6 by Martin Pool
[merge] bzr.dev
1286
        # U U L
1287
        lco_tree.branch.repository.lock_write()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1288
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1289
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
2363.5.18 by Aaron Bentley
Get all tests passing
1290
            lco_tree, repo_branch=repo_branch,
1291
            repo_locked=True, verbose=True, light_checkout=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1292
        finally:
1293
            lco_tree.branch.repository.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1294
        # U L L
1295
        lco_tree.branch.lock_write()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1296
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1297
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1298
            lco_tree,
1299
            branch_locked=True,
2363.5.11 by Aaron Bentley
All info tests pass
1300
            repo_locked=True,
2363.5.18 by Aaron Bentley
Get all tests passing
1301
            repo_branch=repo_branch,
2363.5.11 by Aaron Bentley
All info tests pass
1302
            verbose=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1303
        finally:
1304
            lco_tree.branch.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1305
        # L L L
1306
        lco_tree.lock_write()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1307
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1308
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
2363.5.18 by Aaron Bentley
Get all tests passing
1309
            lco_tree, repo_branch=repo_branch,
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1310
            tree_locked=True,
1311
            branch_locked=True,
2363.5.11 by Aaron Bentley
All info tests pass
1312
            repo_locked=True,
1313
            verbose=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1314
        finally:
1315
            lco_tree.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1316
        # L L U
1317
        lco_tree.lock_write()
1318
        lco_tree.branch.repository.unlock()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1319
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1320
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
2363.5.18 by Aaron Bentley
Get all tests passing
1321
            lco_tree, repo_branch=repo_branch,
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1322
            tree_locked=True,
2363.5.11 by Aaron Bentley
All info tests pass
1323
            branch_locked=True,
1324
            verbose=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1325
        finally:
1326
            lco_tree.branch.repository.lock_write()
1327
            lco_tree.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1328
        # L U U
1329
        lco_tree.lock_write()
1330
        lco_tree.branch.unlock()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1331
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1332
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
2363.5.18 by Aaron Bentley
Get all tests passing
1333
            lco_tree, repo_branch=repo_branch,
2363.5.11 by Aaron Bentley
All info tests pass
1334
            tree_locked=True,
1335
            verbose=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1336
        finally:
1337
            lco_tree.branch.lock_write()
1338
            lco_tree.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1339
        # L U L
1340
        lco_tree.lock_write()
1341
        lco_tree.branch.unlock()
1342
        lco_tree.branch.repository.lock_write()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1343
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1344
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
2363.5.18 by Aaron Bentley
Get all tests passing
1345
            lco_tree, repo_branch=repo_branch,
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1346
            tree_locked=True,
2363.5.11 by Aaron Bentley
All info tests pass
1347
            repo_locked=True,
1348
            verbose=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1349
        finally:
1350
            lco_tree.branch.repository.unlock()
1351
            lco_tree.branch.lock_write()
1352
            lco_tree.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1353
        # U L U
1354
        lco_tree.branch.lock_write()
1355
        lco_tree.branch.repository.unlock()
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1356
        try:
2363.5.11 by Aaron Bentley
All info tests pass
1357
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
2363.5.18 by Aaron Bentley
Get all tests passing
1358
            lco_tree, repo_branch=repo_branch,
2363.5.11 by Aaron Bentley
All info tests pass
1359
            branch_locked=True,
1360
            verbose=True)
1780.1.2 by Robert Collins
(robertc)Partial refactoring of info tests to be more robust to format changes.
1361
        finally:
1362
            lco_tree.branch.repository.lock_write()
1363
            lco_tree.branch.unlock()
1694.2.6 by Martin Pool
[merge] bzr.dev
1364
2425.3.2 by John Arbash Meinel
Make "test_info_locking" an expected failure on win32 for now.
1365
        if sys.platform == 'win32':
1366
            self.knownFailure('Win32 cannot run "bzr info"'
1367
                              ' when the tree is locked.')
1368
3221.21.3 by Ian Clatworthy
shallow -> stacked
1369
    def test_info_stacked(self):
3221.11.21 by Robert Collins
Have info report on stacked branches.
1370
        # We have a mainline
1371
        trunk_tree = self.make_branch_and_tree('mainline',
3735.1.2 by Robert Collins
Remove 1.5 series dev formats and document development2 a little better.
1372
            format='1.6')
3221.11.21 by Robert Collins
Have info report on stacked branches.
1373
        trunk_tree.commit('mainline')
3221.21.3 by Ian Clatworthy
shallow -> stacked
1374
        # and a branch from it which is stacked
1375
        new_dir = trunk_tree.bzrdir.sprout('newbranch', stacked=True)
3221.11.21 by Robert Collins
Have info report on stacked branches.
1376
        out, err = self.run_bzr('info newbranch')
1377
        self.assertEqual(
3735.1.2 by Robert Collins
Remove 1.5 series dev formats and document development2 a little better.
1378
"""Standalone tree (format: 1.6)
3221.11.21 by Robert Collins
Have info report on stacked branches.
1379
Location:
1380
  branch root: newbranch
1381
1382
Related branches:
1383
  parent branch: mainline
1384
     stacked on: mainline
1385
""", out)
1386
        self.assertEqual("", err)
6181.1.1 by Jelmer Vernooij
If the branch doesn't support last_revision_info, don't display
1387
1388
    def test_info_revinfo_optional(self):
1389
        tree = self.make_branch_and_tree('.')
1390
        def last_revision_info(self):
1391
            raise errors.UnsupportedOperation(last_revision_info, self)
1392
        self.overrideAttr(
1393
            branch.Branch, "last_revision_info", last_revision_info)
1394
        out, err = self.run_bzr('info -v .')
1395
        self.assertEqual(
1396
"""Standalone tree (format: 2a)
1397
Location:
1398
  branch root: .
1399
1400
Format:
1401
       control: Meta directory format 1
1402
  working tree: Working tree format 6
1403
        branch: Branch format 7
1404
    repository: Repository format 2a - rich roots, group compression and chk inventories
1405
1406
In the working tree:
1407
         0 unchanged
1408
         0 modified
1409
         0 added
1410
         0 removed
1411
         0 renamed
1412
         0 unknown
1413
         0 ignored
1414
         0 versioned subdirectories
1415
""", out)
1416
        self.assertEqual("", err)
6240.1.1 by Jelmer Vernooij
Show the number of colocated branches in 'bzr info -v'.
1417
1418
    def test_info_shows_colocated_branches(self):
1419
        bzrdir = self.make_branch('.', format='development-colo').bzrdir
1420
        bzrdir.create_branch(name="colo1")
1421
        bzrdir.create_branch(name="colo2")
1422
        bzrdir.create_branch(name="colo3")
1423
        out, err = self.run_bzr('info -v .')
1424
        self.assertEqualDiff(
1425
"""Standalone branch (format: development-colo)
1426
Location:
1427
  branch root: .
1428
1429
Format:
1430
       control: Meta directory format 1 with support for colocated branches
1431
        branch: Branch format 7
1432
    repository: Repository format 2a - rich roots, group compression and chk inventories
1433
1434
Control directory:
1435
         4 branches
1436
1437
Branch history:
1438
         0 revisions
1439
1440
Repository:
1441
         0 revisions
1442
""", out)
1443
        self.assertEqual("", err)
6283.1.3 by Jelmer Vernooij
Add hpss call count test for 'bzr info' and 'bzr info -v'.
1444
1445
1446
class TestSmartServerInfo(tests.TestCaseWithTransport):
1447
1448
    def test_simple_branch_info(self):
1449
        self.setup_smart_server_with_call_log()
1450
        t = self.make_branch_and_tree('branch')
1451
        self.build_tree_contents([('branch/foo', 'thecontents')])
1452
        t.add("foo")
1453
        t.commit("message")
1454
        self.reset_smart_call_log()
1455
        out, err = self.run_bzr(['info', self.get_url('branch')])
1456
        # This figure represent the amount of work to perform this use case. It
1457
        # is entirely ok to reduce this number if a test fails due to rpc_count
1458
        # being too low. If rpc_count increases, more network roundtrips have
1459
        # become necessary for this use case. Please do not adjust this number
1460
        # upwards without agreement from bzr's network support maintainers.
1461
        self.assertLength(12, self.hpss_calls)
6366.1.4 by Jelmer Vernooij
Test connection count calls for most blackbox commands.
1462
        self.assertLength(1, self.hpss_connections)
6352.2.3 by Jelmer Vernooij
s/NoVfsCalls/ContainsNoVfsCalls/.
1463
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
6283.1.3 by Jelmer Vernooij
Add hpss call count test for 'bzr info' and 'bzr info -v'.
1464
1465
    def test_verbose_branch_info(self):
1466
        self.setup_smart_server_with_call_log()
1467
        t = self.make_branch_and_tree('branch')
1468
        self.build_tree_contents([('branch/foo', 'thecontents')])
1469
        t.add("foo")
1470
        t.commit("message")
1471
        self.reset_smart_call_log()
1472
        out, err = self.run_bzr(['info', '-v', self.get_url('branch')])
1473
        # This figure represent the amount of work to perform this use case. It
1474
        # is entirely ok to reduce this number if a test fails due to rpc_count
1475
        # being too low. If rpc_count increases, more network roundtrips have
1476
        # become necessary for this use case. Please do not adjust this number
1477
        # upwards without agreement from bzr's network support maintainers.
6280.6.5 by Jelmer Vernooij
Merge bzr.dev, fix HPSS call count.
1478
        self.assertLength(16, self.hpss_calls)
6366.1.4 by Jelmer Vernooij
Test connection count calls for most blackbox commands.
1479
        self.assertLength(1, self.hpss_connections)
6352.2.3 by Jelmer Vernooij
s/NoVfsCalls/ContainsNoVfsCalls/.
1480
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)