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