~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2005-05-30 01:39:13 UTC
  • Revision ID: mbp@sourcefrog.net-20050530013913-4ac43c29e1302170
- make sure any bzr output is flushed before 
  running external diff

Show diffs side-by-side

added added

removed removed

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