~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ian Clatworthy
  • Date: 2010-02-19 03:02:07 UTC
  • mto: (4797.23.1 integration-2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: ian.clatworthy@canonical.com-20100219030207-zpbzx021zavx4sqt
What's New in 2.1 - a summary of changes since 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
29
29
    urlutils,
30
30
    )
31
31
from bzrlib.osutils import format_date
32
 
from bzrlib.tests import TestSkipped
 
32
from bzrlib.tests import TestSkipped, MemoryServer
33
33
from bzrlib.tests.blackbox import ExternalBase
34
34
 
35
35
 
36
36
class TestInfo(ExternalBase):
37
37
 
 
38
    def setUp(self):
 
39
        ExternalBase.setUp(self)
 
40
        self._repo_strings = "2a"
 
41
 
38
42
    def test_info_non_existing(self):
39
 
        if sys.platform == "win32":
40
 
            location = "C:/i/do/not/exist/"
41
 
        else:
42
 
            location = "/i/do/not/exist/"
 
43
        self.vfs_transport_factory = MemoryServer
 
44
        location = self.get_url()
43
45
        out, err = self.run_bzr('info '+location, retcode=3)
44
46
        self.assertEqual(out, '')
45
47
        self.assertEqual(err, 'bzr: ERROR: Not a branch: "%s".\n' % location)
276
278
        branch5 = tree5.branch
277
279
        out, err = self.run_bzr('info -v lightcheckout')
278
280
        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)
 
281
"""Lightweight checkout (format: %s)
283
282
Location:
284
283
  light checkout root: lightcheckout
285
284
   checkout of branch: standalone
286
285
 
287
286
Format:
288
287
       control: Meta directory format 1
289
 
  working tree: Working tree format 4
 
288
  working tree: Working tree format 6
290
289
        branch: Branch format 4
291
290
    repository: Weave repository format 6
292
291
 
308
307
 
309
308
Repository:
310
309
         1 revision
311
 
""" % (datestring_first, datestring_first,), out)
 
310
""" % (self._repo_strings, datestring_first, datestring_first,), out)
312
311
        self.assertEqual('', err)
313
312
 
314
313
        # Update initial standalone branch
441
440
        # Out of date lightweight checkout
442
441
        out, err = self.run_bzr('info lightcheckout --verbose')
443
442
        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)
 
443
"""Lightweight checkout (format: %s)
448
444
Location:
449
445
  light checkout root: lightcheckout
450
446
   checkout of branch: standalone
451
447
 
452
448
Format:
453
449
       control: Meta directory format 1
454
 
  working tree: Working tree format 4
 
450
  working tree: Working tree format 6
455
451
        branch: Branch format 4
456
452
    repository: Weave repository format 6
457
453
 
475
471
 
476
472
Repository:
477
473
         2 revisions
478
 
""" % (datestring_first, datestring_last,), out)
 
474
""" % (self._repo_strings, datestring_first, datestring_last,), out)
479
475
        self.assertEqual('', err)
480
476
 
481
477
    def test_info_standalone_no_tree(self):
576
572
        datestring_first = format_date(rev.timestamp, rev.timezone)
577
573
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
578
574
        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)
 
575
"""Lightweight checkout (format: %s)
583
576
Location:
584
577
  light checkout root: tree/lightcheckout
585
578
   checkout of branch: repo/branch
587
580
 
588
581
Format:
589
582
       control: Meta directory format 1
590
 
  working tree: Working tree format 4
 
583
  working tree: Working tree format 6
591
584
        branch: %s
592
585
    repository: %s
593
586
 
609
602
 
610
603
Repository:
611
604
         1 revision
612
 
""" % (format.get_branch_format().get_format_description(),
 
605
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
613
606
       format.repository_format.get_format_description(),
614
607
       datestring_first, datestring_first,
615
608
       ), out)
618
611
        # Out of date checkout
619
612
        out, err = self.run_bzr('info -v tree/checkout')
620
613
        self.assertEqualDiff(
621
 
"""Checkout (format: dirstate)
 
614
"""Checkout (format: unnamed)
622
615
Location:
623
616
       checkout root: tree/checkout
624
617
  checkout of branch: repo/branch
625
618
 
626
619
Format:
627
620
       control: Meta directory format 1
628
 
  working tree: Working tree format 4
 
621
  working tree: Working tree format 6
629
622
        branch: %s
630
623
    repository: %s
631
624
 
657
650
        tree3.add('b')
658
651
        out, err = self.run_bzr('info tree/checkout --verbose')
659
652
        self.assertEqualDiff(
660
 
"""Checkout (format: dirstate)
 
653
"""Checkout (format: unnamed)
661
654
Location:
662
655
       checkout root: tree/checkout
663
656
  checkout of branch: repo/branch
664
657
 
665
658
Format:
666
659
       control: Meta directory format 1
667
 
  working tree: Working tree format 4
 
660
  working tree: Working tree format 6
668
661
        branch: %s
669
662
    repository: %s
670
663
 
698
691
        datestring_last = format_date(rev.timestamp, rev.timezone)
699
692
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
700
693
        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)
 
694
"""Lightweight checkout (format: %s)
705
695
Location:
706
696
  light checkout root: tree/lightcheckout
707
697
   checkout of branch: repo/branch
709
699
 
710
700
Format:
711
701
       control: Meta directory format 1
712
 
  working tree: Working tree format 4
 
702
  working tree: Working tree format 6
713
703
        branch: %s
714
704
    repository: %s
715
705
 
733
723
 
734
724
Repository:
735
725
         2 revisions
736
 
""" % (format.get_branch_format().get_format_description(),
 
726
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
737
727
       format.repository_format.get_format_description(),
738
728
       datestring_first, datestring_last,
739
729
       ), out)
1134
1124
            (False, True): 'Lightweight checkout',
1135
1125
            (False, False): 'Checkout',
1136
1126
            }[(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]
 
1127
        format = {True: self._repo_strings,
 
1128
                  False: 'unnamed'}[light_checkout]
1142
1129
        if repo_locked:
1143
1130
            repo_locked = lco_tree.branch.repository.get_physical_lock_status()
1144
1131
        if repo_locked or branch_locked or tree_locked:
1339
1326
    def test_info_locking_oslocks(self):
1340
1327
        if sys.platform == "win32":
1341
1328
            raise TestSkipped("don't use oslocks on win32 in unix manner")
 
1329
        # This test tests old (all-in-one, OS lock using) behaviour which
 
1330
        # simply cannot work on windows (and is indeed why we changed our
 
1331
        # design. As such, don't try to remove the thisFailsStrictLockCheck
 
1332
        # call here.
 
1333
        self.thisFailsStrictLockCheck()
1342
1334
 
1343
1335
        tree = self.make_branch_and_tree('branch',
1344
1336
                                         format=bzrdir.BzrDirFormat6())