/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-19 23:15:49 UTC
  • mto: This revision was merged to the branch mainline in revision 5808.
  • Revision ID: jelmer@samba.org-20110419231549-s07z2eftiqor6vxl
Fix use of _set_last_revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1377
1377
class TestBranchSetLastRevision(RemoteBranchTestCase):
1378
1378
 
1379
1379
    def test_set_empty(self):
1380
 
        # set_last_revision_info(0, 'null:') is translated to calling
 
1380
        # _set_last_revision_info('null:') is translated to calling
1381
1381
        # Branch.set_last_revision(path, '') on the wire.
1382
1382
        transport = MemoryTransport()
1383
1383
        transport.mkdir('branch')
1405
1405
        # unnecessarily invokes _ensure_real upon a call to lock_write.
1406
1406
        branch._ensure_real = lambda: None
1407
1407
        branch.lock_write()
1408
 
        result = branch.set_last_revision_info(0, NULL_REVISION)
 
1408
        result = branch._set_last_revision(NULL_REVISION)
1409
1409
        branch.unlock()
1410
1410
        self.assertEqual(None, result)
1411
1411
        self.assertFinished(client)
1443
1443
        branch._ensure_real = lambda: None
1444
1444
        # Lock the branch, reset the record of remote calls.
1445
1445
        branch.lock_write()
1446
 
        result = branch.set_last_revision_info(2, 'rev-id2')
 
1446
        result = branch._set_last_revision('rev-id2')
1447
1447
        branch.unlock()
1448
1448
        self.assertEqual(None, result)
1449
1449
        self.assertFinished(client)
1479
1479
        branch = self.make_remote_branch(transport, client)
1480
1480
        branch.lock_write()
1481
1481
        self.assertRaises(
1482
 
            errors.NoSuchRevision, branch.generate_revision_history, 'rev-id')
 
1482
            errors.NoSuchRevision, branch._set_last_revision, 'rev-id')
1483
1483
        branch.unlock()
1484
1484
        self.assertFinished(client)
1485
1485
 
1519
1519
        # set_last_revision_info causes a TipChangeRejected exception.
1520
1520
        err = self.assertRaises(
1521
1521
            errors.TipChangeRejected,
1522
 
            branch.set_last_revision_info, 1, 'rev-id')
 
1522
            branch._set_last_revision, 'rev-id')
1523
1523
        # The UTF-8 message from the response has been decoded into a unicode
1524
1524
        # object.
1525
1525
        self.assertIsInstance(err.msg, unicode)