~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: 2009-09-14 01:48:28 UTC
  • mfrom: (4685 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4688.
  • Revision ID: mbp@sourcefrog.net-20090914014828-ydr9rlkdfq2sv57z
Merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
class TestInfo(ExternalBase):
37
37
 
 
38
    def setUp(self):
 
39
        ExternalBase.setUp(self)
 
40
        self._repo_strings = "2a or development-subtree"
 
41
 
38
42
    def test_info_non_existing(self):
39
43
        if sys.platform == "win32":
40
44
            location = "C:/i/do/not/exist/"
276
280
        branch5 = tree5.branch
277
281
        out, err = self.run_bzr('info -v lightcheckout')
278
282
        self.assertEqualDiff(
279
 
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root \
280
 
or 1.9 or 1.9-rich-root \
281
 
or dirstate or dirstate-tags or \
282
 
pack-0.92 or rich-root or rich-root-pack)
 
283
"""Lightweight checkout (format: %s)
283
284
Location:
284
285
  light checkout root: lightcheckout
285
286
   checkout of branch: standalone
286
287
 
287
288
Format:
288
289
       control: Meta directory format 1
289
 
  working tree: Working tree format 4
 
290
  working tree: Working tree format 6
290
291
        branch: Branch format 4
291
292
    repository: Weave repository format 6
292
293
 
308
309
 
309
310
Repository:
310
311
         1 revision
311
 
""" % (datestring_first, datestring_first,), out)
 
312
""" % (self._repo_strings, datestring_first, datestring_first,), out)
312
313
        self.assertEqual('', err)
313
314
 
314
315
        # Update initial standalone branch
441
442
        # Out of date lightweight checkout
442
443
        out, err = self.run_bzr('info lightcheckout --verbose')
443
444
        self.assertEqualDiff(
444
 
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
445
 
1.9 or 1.9-rich-root or \
446
 
dirstate or dirstate-tags or \
447
 
pack-0.92 or rich-root or rich-root-pack)
 
445
"""Lightweight checkout (format: %s)
448
446
Location:
449
447
  light checkout root: lightcheckout
450
448
   checkout of branch: standalone
451
449
 
452
450
Format:
453
451
       control: Meta directory format 1
454
 
  working tree: Working tree format 4
 
452
  working tree: Working tree format 6
455
453
        branch: Branch format 4
456
454
    repository: Weave repository format 6
457
455
 
475
473
 
476
474
Repository:
477
475
         2 revisions
478
 
""" % (datestring_first, datestring_last,), out)
 
476
""" % (self._repo_strings, datestring_first, datestring_last,), out)
479
477
        self.assertEqual('', err)
480
478
 
481
479
    def test_info_standalone_no_tree(self):
576
574
        datestring_first = format_date(rev.timestamp, rev.timezone)
577
575
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
578
576
        self.assertEqualDiff(
579
 
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
580
 
1.9 or 1.9-rich-root or \
581
 
dirstate or dirstate-tags or \
582
 
pack-0.92 or rich-root or rich-root-pack)
 
577
"""Lightweight checkout (format: %s)
583
578
Location:
584
579
  light checkout root: tree/lightcheckout
585
580
   checkout of branch: repo/branch
587
582
 
588
583
Format:
589
584
       control: Meta directory format 1
590
 
  working tree: Working tree format 4
 
585
  working tree: Working tree format 6
591
586
        branch: %s
592
587
    repository: %s
593
588
 
609
604
 
610
605
Repository:
611
606
         1 revision
612
 
""" % (format.get_branch_format().get_format_description(),
 
607
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
613
608
       format.repository_format.get_format_description(),
614
609
       datestring_first, datestring_first,
615
610
       ), out)
618
613
        # Out of date checkout
619
614
        out, err = self.run_bzr('info -v tree/checkout')
620
615
        self.assertEqualDiff(
621
 
"""Checkout (format: dirstate)
 
616
"""Checkout (format: unnamed)
622
617
Location:
623
618
       checkout root: tree/checkout
624
619
  checkout of branch: repo/branch
625
620
 
626
621
Format:
627
622
       control: Meta directory format 1
628
 
  working tree: Working tree format 4
 
623
  working tree: Working tree format 6
629
624
        branch: %s
630
625
    repository: %s
631
626
 
657
652
        tree3.add('b')
658
653
        out, err = self.run_bzr('info tree/checkout --verbose')
659
654
        self.assertEqualDiff(
660
 
"""Checkout (format: dirstate)
 
655
"""Checkout (format: unnamed)
661
656
Location:
662
657
       checkout root: tree/checkout
663
658
  checkout of branch: repo/branch
664
659
 
665
660
Format:
666
661
       control: Meta directory format 1
667
 
  working tree: Working tree format 4
 
662
  working tree: Working tree format 6
668
663
        branch: %s
669
664
    repository: %s
670
665
 
698
693
        datestring_last = format_date(rev.timestamp, rev.timezone)
699
694
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
700
695
        self.assertEqualDiff(
701
 
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
702
 
1.9 or 1.9-rich-root or \
703
 
dirstate or dirstate-tags or \
704
 
pack-0.92 or rich-root or rich-root-pack)
 
696
"""Lightweight checkout (format: %s)
705
697
Location:
706
698
  light checkout root: tree/lightcheckout
707
699
   checkout of branch: repo/branch
709
701
 
710
702
Format:
711
703
       control: Meta directory format 1
712
 
  working tree: Working tree format 4
 
704
  working tree: Working tree format 6
713
705
        branch: %s
714
706
    repository: %s
715
707
 
733
725
 
734
726
Repository:
735
727
         2 revisions
736
 
""" % (format.get_branch_format().get_format_description(),
 
728
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
737
729
       format.repository_format.get_format_description(),
738
730
       datestring_first, datestring_last,
739
731
       ), out)
1134
1126
            (False, True): 'Lightweight checkout',
1135
1127
            (False, False): 'Checkout',
1136
1128
            }[(shared_repo is not None, light_checkout)]
1137
 
        format = {True: '1.6 or 1.6.1-rich-root'
1138
 
                        ' or 1.9 or 1.9-rich-root'
1139
 
                        ' or dirstate or dirstate-tags or pack-0.92'
1140
 
                        ' or rich-root or rich-root-pack',
1141
 
                  False: 'dirstate'}[light_checkout]
 
1129
        format = {True: self._repo_strings,
 
1130
                  False: 'unnamed'}[light_checkout]
1142
1131
        if repo_locked:
1143
1132
            repo_locked = lco_tree.branch.repository.get_physical_lock_status()
1144
1133
        if repo_locked or branch_locked or tree_locked:
1339
1328
    def test_info_locking_oslocks(self):
1340
1329
        if sys.platform == "win32":
1341
1330
            raise TestSkipped("don't use oslocks on win32 in unix manner")
 
1331
        # This test tests old (all-in-one, OS lock using) behaviour which
 
1332
        # simply cannot work on windows (and is indeed why we changed our
 
1333
        # design. As such, don't try to remove the thisFailsStrictLockCheck
 
1334
        # call here.
 
1335
        self.thisFailsStrictLockCheck()
1342
1336
 
1343
1337
        tree = self.make_branch_and_tree('branch',
1344
1338
                                         format=bzrdir.BzrDirFormat6())