~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-09-08 11:01:15 UTC
  • mfrom: (6123.1.16 gpg-typo)
  • Revision ID: pqm@cupuasso-20110908110115-gbb9benwkdksvzk5
(jelmer) Fix a typo (invalid format identifier) in an error message in
 bzrlib.gpg. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
""", out)
126
126
        self.assertEqual('', err)
127
127
        tree1.commit('commit one')
128
 
        rev = branch1.repository.get_revision(branch1.last_revision())
 
128
        rev = branch1.repository.get_revision(branch1.revision_history()[0])
129
129
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
130
130
 
131
131
        # Branch standalone with push location
317
317
        self.build_tree(['standalone/b'])
318
318
        tree1.add('b')
319
319
        tree1.commit('commit two')
320
 
        rev = branch1.repository.get_revision(branch1.last_revision())
 
320
        rev = branch1.repository.get_revision(branch1.revision_history()[-1])
321
321
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
322
322
 
323
323
        # Out of date branched standalone branch will not be detected
571
571
        self.build_tree(['tree/lightcheckout/a'])
572
572
        tree2.add('a')
573
573
        tree2.commit('commit one')
574
 
        rev = repo.get_revision(branch2.last_revision())
 
574
        rev = repo.get_revision(branch2.revision_history()[0])
575
575
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
576
576
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
577
577
        self.assertEqualDiff(
690
690
        tree3.commit('commit two')
691
691
 
692
692
        # Out of date lightweight checkout
693
 
        rev = repo.get_revision(branch1.last_revision())
 
693
        rev = repo.get_revision(branch1.revision_history()[-1])
694
694
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
695
695
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
696
696
        self.assertEqualDiff(
846
846
        tree1 = branch1.bzrdir.open_workingtree()
847
847
        tree1.add('a')
848
848
        tree1.commit('commit one')
849
 
        rev = repo.get_revision(branch1.last_revision())
 
849
        rev = repo.get_revision(branch1.revision_history()[0])
850
850
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
851
851
        out, err = self.run_bzr('info -v repo/branch1')
852
852
        self.assertEqualDiff(
1345
1345
     stacked on: mainline
1346
1346
""", out)
1347
1347
        self.assertEqual("", err)
1348
 
 
1349
 
    def test_info_revinfo_optional(self):
1350
 
        tree = self.make_branch_and_tree('.')
1351
 
        def last_revision_info(self):
1352
 
            raise errors.UnsupportedOperation(last_revision_info, self)
1353
 
        self.overrideAttr(
1354
 
            branch.Branch, "last_revision_info", last_revision_info)
1355
 
        out, err = self.run_bzr('info -v .')
1356
 
        self.assertEqual(
1357
 
"""Standalone tree (format: 2a)
1358
 
Location:
1359
 
  branch root: .
1360
 
 
1361
 
Format:
1362
 
       control: Meta directory format 1
1363
 
  working tree: Working tree format 6
1364
 
        branch: Branch format 7
1365
 
    repository: Repository format 2a - rich roots, group compression and chk inventories
1366
 
 
1367
 
In the working tree:
1368
 
         0 unchanged
1369
 
         0 modified
1370
 
         0 added
1371
 
         0 removed
1372
 
         0 renamed
1373
 
         0 unknown
1374
 
         0 ignored
1375
 
         0 versioned subdirectories
1376
 
""", out)
1377
 
        self.assertEqual("", err)