~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Shannon Weyrick
  • Date: 2011-11-04 13:40:04 UTC
  • mfrom: (6238 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6256.
  • Revision ID: weyrick@mozek.us-20111104134004-033t2wqhc3ydzm0a
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import (
23
23
    branch,
24
24
    bzrdir,
 
25
    controldir,
25
26
    errors,
26
27
    info,
27
28
    osutils,
187
188
        branch1.bzrdir.sprout('bound')
188
189
        knit1_format = bzrdir.format_registry.make_bzrdir('knit')
189
190
        upgrade.upgrade('bound', knit1_format)
190
 
        branch3 = bzrdir.BzrDir.open('bound').open_branch()
 
191
        branch3 = controldir.ControlDir.open('bound').open_branch()
191
192
        branch3.bind(branch1)
192
193
        bound_tree = branch3.bzrdir.open_workingtree()
193
194
        out, err = self.run_bzr('info -v bound')
232
233
        self.assertEqual('', err)
233
234
 
234
235
        # Checkout standalone (same as above, but does not have parent set)
235
 
        branch4 = bzrdir.BzrDir.create_branch_convenience('checkout',
 
236
        branch4 = controldir.ControlDir.create_branch_convenience('checkout',
236
237
            format=knit1_format)
237
238
        branch4.bind(branch1)
238
239
        branch4.bzrdir.open_workingtree().update()
529
530
 
530
531
        # Create branch inside shared repository
531
532
        repo.bzrdir.root_transport.mkdir('branch')
532
 
        branch1 = repo.bzrdir.create_branch_convenience('repo/branch',
533
 
            format=format)
 
533
        branch1 = controldir.ControlDir.create_branch_convenience(
 
534
            'repo/branch', format=format)
534
535
        out, err = self.run_bzr('info -v repo/branch')
535
536
        self.assertEqualDiff(
536
537
"""Repository branch (format: dirstate or knit)
803
804
 
804
805
        # Create two branches
805
806
        repo.bzrdir.root_transport.mkdir('branch1')
806
 
        branch1 = repo.bzrdir.create_branch_convenience('repo/branch1',
 
807
        branch1 = controldir.ControlDir.create_branch_convenience('repo/branch1',
807
808
            format=format)
808
809
        branch2 = branch1.bzrdir.sprout('repo/branch2').open_branch()
809
810
 
1221
1222
                                    format=bzrdir.BzrDirMetaFormat1())
1222
1223
        repo.set_make_working_trees(False)
1223
1224
        repo.bzrdir.root_transport.mkdir('branch')
1224
 
        repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1225
 
                                    format=bzrdir.BzrDirMetaFormat1())
 
1225
        repo_branch = controldir.ControlDir.create_branch_convenience(
 
1226
            'repo/branch', format=bzrdir.BzrDirMetaFormat1())
1226
1227
        # Do a heavy checkout
1227
1228
        transport.mkdir('tree')
1228
1229
        transport.mkdir('tree/checkout')
1229
 
        co_branch = bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1230
 
            format=bzrdir.BzrDirMetaFormat1())
 
1230
        co_branch = controldir.ControlDir.create_branch_convenience(
 
1231
            'tree/checkout', format=bzrdir.BzrDirMetaFormat1())
1231
1232
        co_branch.bind(repo_branch)
1232
1233
        # Do a light checkout of the heavy one
1233
1234
        transport.mkdir('tree/lightcheckout')
1345
1346
     stacked on: mainline
1346
1347
""", out)
1347
1348
        self.assertEqual("", err)
 
1349
 
 
1350
    def test_info_revinfo_optional(self):
 
1351
        tree = self.make_branch_and_tree('.')
 
1352
        def last_revision_info(self):
 
1353
            raise errors.UnsupportedOperation(last_revision_info, self)
 
1354
        self.overrideAttr(
 
1355
            branch.Branch, "last_revision_info", last_revision_info)
 
1356
        out, err = self.run_bzr('info -v .')
 
1357
        self.assertEqual(
 
1358
"""Standalone tree (format: 2a)
 
1359
Location:
 
1360
  branch root: .
 
1361
 
 
1362
Format:
 
1363
       control: Meta directory format 1
 
1364
  working tree: Working tree format 6
 
1365
        branch: Branch format 7
 
1366
    repository: Repository format 2a - rich roots, group compression and chk inventories
 
1367
 
 
1368
In the working tree:
 
1369
         0 unchanged
 
1370
         0 modified
 
1371
         0 added
 
1372
         0 removed
 
1373
         0 renamed
 
1374
         0 unknown
 
1375
         0 ignored
 
1376
         0 versioned subdirectories
 
1377
""", out)
 
1378
        self.assertEqual("", err)