~bzr-pqm/bzr/bzr.dev

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